Skip to content

Commit 33f2649

Browse files
committed
Initial commit
0 parents  commit 33f2649

Some content is hidden

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

44 files changed

+14193
-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/renovate.json

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

.github/workflows/create-release.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
create-release:
10+
name: Create GitHub Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Get semver number
18+
id: get_semver
19+
env:
20+
TAG_NAME: ${{ github.ref }}
21+
run: echo "::set-output name=num::${TAG_NAME:11}"
22+
23+
- name: Create release on GitHub API
24+
id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: "@${{ github.repository }}@${{ steps.get_semver.outputs.num }}"
31+
body: |
32+
:scroll: [Changelog](https://github.com/${{ github.repository }}/blob/v${{ steps.get_semver.outputs.num }}/CHANGELOG.md)
33+
draft: false
34+
prerelease: false

.github/workflows/deploy.yml

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

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'assets/application.json'
9+
- 'ecomplus-market.json'
10+
- 'functions/public/description.md'
11+
- 'functions/public/icon.png'
12+
- 'scripts/_constants.js'
13+
- 'scripts/market-publication.js'
14+
15+
jobs:
16+
pulish:
17+
name: Publish app to E-Com Plus Market
18+
runs-on: ubuntu-latest
19+
if: github.repository != 'ecomplus/application-starter'
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: '12.x'
29+
registry-url: 'https://registry.npmjs.org/'
30+
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
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
41+
42+
- name: Run publish script
43+
env:
44+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
45+
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }}
46+
run: "npm run publish:market"

.gitignore

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

0 commit comments

Comments
 (0)