Skip to content

Commit 9a401a1

Browse files
Initial commit
0 parents  commit 9a401a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+18435
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
blank_issues_enabled: true
2+
3+
contact_links:
4+
- name: E-Com Plus Community
5+
url: https://community.e-com.plus/
6+
about: If you have an E-Com Plus store, please ask and answer questions here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/deploy

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.github/renovate.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"github>ecomclub/renovate-config:app"
4+
]
5+
}

.github/workflows/create-release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Create GitHub release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
name: Create release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Release tag
19+
id: release_tag
20+
uses: Akryum/release-tag@8eeb62bcf949a368763f4057c34e7eb834467122
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
preset: angular

.github/workflows/deploy.yml

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'functions/**'
9+
- 'scripts/_constants.js'
10+
- 'scripts/firebase-deploy.js'
11+
- '*.json'
12+
- '.github/deploy'
13+
14+
jobs:
15+
deploy:
16+
name: Deploy to Firebase
17+
runs-on: ubuntu-latest
18+
if: |
19+
github.event.head_commit.message != 'Initial commit' &&
20+
!contains(github.event.head_commit.message, '[skip ci]')
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '18.x'
30+
31+
- name: Cache dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.npm
35+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36+
restore-keys: |
37+
${{ runner.os }}-node-
38+
39+
- name: Install root dependencies
40+
run: npm ci --only=production --ignore-scripts
41+
42+
- name: Install functions dependencies
43+
run: cd functions && npm ci --only=production --no-optional && cd ..
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Run deploy
48+
env:
49+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
50+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
51+
SERVER_OPERATOR_TOKEN: ${{ secrets.SERVER_OPERATOR_TOKEN }}
52+
run: npm run deploy
53+
54+
update-app-json:
55+
name: Update application and publish
56+
runs-on: ubuntu-latest
57+
needs: deploy
58+
if: github.repository != 'ecomplus/application-starter'
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Write README with base URI
65+
env:
66+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
67+
run: |
68+
echo "App base URI: https://us-central1-$FIREBASE_PROJECT_ID.cloudfunctions.net/app/" \
69+
> ./assets/README
70+
71+
- name: Run Wget and write to JSON file
72+
env:
73+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
74+
run: |
75+
sleep 20
76+
wget -O ./assets/application.json \
77+
https://us-central1-$FIREBASE_PROJECT_ID.cloudfunctions.net/app/
78+
79+
- name: Config Git and check diff
80+
run: |
81+
git config --local user.email 'action@github.com'
82+
git config --local user.name 'GitHub Action'
83+
git add ./assets/
84+
(git diff-index --quiet HEAD && echo "::set-output name=diff::0") || echo "::set-output name=diff::1"
85+
id: git_diff
86+
87+
- name: Commit local file changes
88+
if: steps.git_diff.outputs.diff == 1
89+
run: |
90+
git commit -m 'chore(assets): update application body [skip ci]'
91+
92+
- name: Push changes
93+
if: steps.git_diff.outputs.diff == 1
94+
uses: ad-m/github-push-action@master
95+
with:
96+
github_token: ${{ secrets.GITHUB_TOKEN }}
97+
branch: master
98+
99+
- name: Check stable package version
100+
env:
101+
APP_CHANGED: ${{ steps.git_diff.outputs.diff }}
102+
run: |
103+
CAN_PUBLISH=$(node -p "!(/-/.test(require('./package.json').version)) && process.env.APP_CHANGED")
104+
echo "::set-output name=publish::$CAN_PUBLISH"
105+
id: pkg_version
106+
107+
- name: Setup Node
108+
if: steps.pkg_version.outputs.publish == 1
109+
uses: actions/setup-node@v4
110+
with:
111+
node-version: '18.x'
112+
registry-url: 'https://registry.npmjs.org/'
113+
114+
- name: Cache dependencies
115+
if: steps.pkg_version.outputs.publish == 1
116+
uses: actions/cache@v4
117+
with:
118+
path: ~/.npm
119+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
120+
restore-keys: |
121+
${{ runner.os }}-node-
122+
123+
- name: Install root dependencies
124+
if: steps.pkg_version.outputs.publish == 1
125+
run: npm ci --only=production --ignore-scripts
126+
127+
- name: Run publish script
128+
if: steps.pkg_version.outputs.publish == 1
129+
env:
130+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
131+
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }}
132+
run: "npm run publish:market"
133+
continue-on-error: true

.github/workflows/init-repository.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Init repository
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
init-repository:
10+
name: Prepare repo after generation
11+
runs-on: ubuntu-latest
12+
if: startsWith(github.event.head_commit.message, 'Initial commit')
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Remove LICENSE and generate app ID
19+
run: |
20+
git config --local user.email 'action@github.com'
21+
git config --local user.name 'GitHub Action'
22+
rm ./LICENSE
23+
rm ./.github/workflows/init-repository.yml
24+
sed -i "s/9000/$(( 100000 + RANDOM % 800000 ))/g" ./functions/ecom.config.js
25+
git commit -am "chore(init): remove default license and generate \`app_id\` [skip ci]"
26+
27+
- name: Push changes
28+
uses: ad-m/github-push-action@master
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
branch: master

.github/workflows/publish.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'assets/application.json'
9+
- 'ecomplus-market.json'
10+
- 'hosting/description.md'
11+
- 'hosting/icon.png'
12+
- 'scripts/_constants.js'
13+
- 'scripts/market-publication.js'
14+
- '.github/workflows/publish.yml'
15+
16+
jobs:
17+
pulish:
18+
name: Publish app to E-Com Plus Market
19+
runs-on: ubuntu-latest
20+
if: github.repository != 'ecomplus/application-starter'
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '18.x'
30+
registry-url: 'https://registry.npmjs.org/'
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.npm
36+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-node-
39+
40+
- name: Install root dependencies
41+
run: npm ci --only=production --ignore-scripts
42+
43+
- name: Run publish script
44+
env:
45+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
46+
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }}
47+
run: "npm run publish:market"

.gitignore

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
dist/
2+
.runtimeconfig.json
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
*.pid.lock
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
35+
# Compiled binary addons (https://nodejs.org/api/addons.html)
36+
build/Release
37+
38+
# Dependency directories
39+
node_modules/
40+
jspm_packages/
41+
42+
# TypeScript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
# next.js build output
64+
.next

.gitpod.Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM gitpod/workspace-full:latest
2+
3+
RUN bash -c ". .nvm/nvm.sh && nvm install 18 && nvm use 18 && nvm alias default 18"
4+
5+
RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix

.gitpod.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
tasks:
4+
- init: npm i
5+
vscode:
6+
extensions:
7+
- standard.vscode-standard
8+
- atishay-jain.all-autocomplete
9+
- xabikos.javascriptsnippets

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

0 commit comments

Comments
 (0)