Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
matheusgnreis authored Jun 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
0 parents commit 399c990
Showing 56 changed files with 18,807 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
blank_issues_enabled: true

contact_links:
- name: E-Com Plus Community
url: https://community.e-com.plus/
about: If you have an E-Com Plus store, please ask and answer questions here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
1 change: 1 addition & 0 deletions .github/deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"github>ecomclub/renovate-config:app"
]
}
25 changes: 25 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Create GitHub release

on:
push:
tags:
- "v*"

jobs:
build:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Release tag
id: release_tag
uses: Akryum/release-tag@8eeb62bcf949a368763f4057c34e7eb834467122
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
preset: angular
133 changes: 133 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Deploy

on:
push:
branches:
- master
paths:
- 'functions/**'
- 'scripts/_constants.js'
- 'scripts/firebase-deploy.js'
- '*.json'
- '.github/deploy'

jobs:
deploy:
name: Deploy to Firebase
runs-on: ubuntu-latest
if: |
github.event.head_commit.message != 'Initial commit' &&
!contains(github.event.head_commit.message, '[skip ci]')
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install root dependencies
run: npm ci --only=production --ignore-scripts

- name: Install functions dependencies
run: cd functions && npm ci --only=production --no-optional && cd ..
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
SERVER_OPERATOR_TOKEN: ${{ secrets.SERVER_OPERATOR_TOKEN }}
run: npm run deploy

update-app-json:
name: Update application and publish
runs-on: ubuntu-latest
needs: deploy
if: github.repository != 'ecomplus/application-starter'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Write README with base URI
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
run: |
echo "App base URI: https://us-central1-$FIREBASE_PROJECT_ID.cloudfunctions.net/app/" \
> ./assets/README
- name: Run Wget and write to JSON file
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
run: |
sleep 20
wget -O ./assets/application.json \
https://us-central1-$FIREBASE_PROJECT_ID.cloudfunctions.net/app/
- name: Config Git and check diff
run: |
git config --local user.email '[email protected]'
git config --local user.name 'GitHub Action'
git add ./assets/
(git diff-index --quiet HEAD && echo "::set-output name=diff::0") || echo "::set-output name=diff::1"
id: git_diff

- name: Commit local file changes
if: steps.git_diff.outputs.diff == 1
run: |
git commit -m 'chore(assets): update application body [skip ci]'
- name: Push changes
if: steps.git_diff.outputs.diff == 1
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master

- name: Check stable package version
env:
APP_CHANGED: ${{ steps.git_diff.outputs.diff }}
run: |
CAN_PUBLISH=$(node -p "!(/-/.test(require('./package.json').version)) && process.env.APP_CHANGED")
echo "::set-output name=publish::$CAN_PUBLISH"
id: pkg_version

- name: Setup Node
if: steps.pkg_version.outputs.publish == 1
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org/'

- name: Cache dependencies
if: steps.pkg_version.outputs.publish == 1
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install root dependencies
if: steps.pkg_version.outputs.publish == 1
run: npm ci --only=production --ignore-scripts

- name: Run publish script
if: steps.pkg_version.outputs.publish == 1
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }}
run: "npm run publish:market"
continue-on-error: true
31 changes: 31 additions & 0 deletions .github/workflows/init-repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Init repository

on:
push:
branches:
- master

jobs:
init-repository:
name: Prepare repo after generation
runs-on: ubuntu-latest
if: startsWith(github.event.head_commit.message, 'Initial commit')

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Remove LICENSE and generate app ID
run: |
git config --local user.email '[email protected]'
git config --local user.name 'GitHub Action'
rm ./LICENSE
rm ./.github/workflows/init-repository.yml
sed -i "s/9000/$(( 100000 + RANDOM % 800000 ))/g" ./functions/ecom.config.js
git commit -am "chore(init): remove default license and generate \`app_id\` [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish

on:
push:
branches:
- master
paths:
- 'assets/application.json'
- 'ecomplus-market.json'
- 'hosting/description.md'
- 'hosting/icon.png'
- 'scripts/_constants.js'
- 'scripts/market-publication.js'
- '.github/workflows/publish.yml'

jobs:
pulish:
name: Publish app to E-Com Plus Market
runs-on: ubuntu-latest
if: github.repository != 'ecomplus/application-starter'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org/'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install root dependencies
run: npm ci --only=production --ignore-scripts

- name: Run publish script
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }}
run: "npm run publish:market"
64 changes: 64 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
dist/
.runtimeconfig.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
5 changes: 5 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gitpod/workspace-full:latest

RUN bash -c ". .nvm/nvm.sh && nvm install 18 && nvm use 18 && nvm alias default 18"

RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
image:
file: .gitpod.Dockerfile
tasks:
- init: npm i
vscode:
extensions:
- standard.vscode-standard
- atishay-jain.all-autocomplete
- xabikos.javascriptsnippets
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
Loading

0 comments on commit 399c990

Please sign in to comment.