Skip to content

Commit 41f1213

Browse files
authored
Merge branch 'main' into matter-labs#79-ellipsis
2 parents 8bf1aed + 53ae782 commit 41f1213

Some content is hidden

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

41 files changed

+3033
-2546
lines changed

.cSpell.json

-15
This file was deleted.

.eslintignore

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
node_modules
2-
.nuxt
1+
node_modules/*
2+
.nuxt/*
33
src/static/*
4-
.github
5-
.idea
6-
environments
7-
public
4+
.github/*
5+
.idea/*
6+
environments/*
7+
public/*
8+
_nuxt/*
9+
src/static/sw.js
810
.eslintrc.js
9-
sw.js*
10-
tests
11+
tests/*

.eslintrc.js

+86-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,93 @@ module.exports = {
33
env: {
44
browser: true,
55
node: true
6-
},
6+
},
77
extends: [
88
'@nuxtjs/eslint-config-typescript',
9-
'plugin:nuxt/recommended',
10-
'prettier'
11-
],
12-
plugins: [
9+
'plugin:prettier-vue/recommended',
10+
'prettier',
1311
],
12+
settings: {
13+
"prettier-vue": {
14+
// Settings for how to process Vue SFC Blocks
15+
SFCBlocks: {
16+
/**
17+
* Use prettier to process `<template>` blocks or not
18+
*
19+
* If set to `false`, you may need to enable those vue rules that are disabled by `eslint-config-prettier`,
20+
* because you need them to lint `<template>` blocks
21+
*
22+
* @default true
23+
*/
24+
template: true,
25+
26+
/**
27+
* Use prettier to process `<script>` blocks or not
28+
*
29+
* If set to `false`, you may need to enable those rules that are disabled by `eslint-config-prettier`,
30+
* because you need them to lint `<script>` blocks
31+
*
32+
* @default true
33+
*/
34+
script: true,
35+
36+
/**
37+
* Use prettier to process `<style>` blocks or not
38+
*
39+
* @default true
40+
*/
41+
style: true,
42+
43+
// Settings for how to process custom blocks
44+
customBlocks: {
45+
// Treat the `<docs>` block as a `.markdown` file
46+
docs: { lang: "markdown" },
47+
48+
// Treat the `<config>` block as a `.json` file
49+
config: { lang: "json" },
50+
51+
// Treat the `<module>` block as a `.js` file
52+
module: { lang: "js" },
53+
54+
// Ignore `<comments>` block (omit it or set it to `false` to ignore the block)
55+
comments: false
56+
57+
// Other custom blocks that are not listed here will be ignored
58+
}
59+
},
60+
61+
// Use prettierrc for prettier options or not (default: `true`)
62+
usePrettierrc: true,
63+
64+
// Set the options for `prettier.getFileInfo`.
65+
// @see https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath-options
66+
fileInfoOptions: {
67+
// Path to ignore file (default: `'.prettierignore'`)
68+
// Notice that the ignore file is only used for this plugin
69+
ignorePath: '.prettierignore',
70+
71+
// Process the files in `node_modules` or not (default: `false`)
72+
withNodeModules: false
73+
}
74+
}
75+
},
1476
// add your custom rules here
15-
rules: {}
16-
}
77+
rules: {
78+
"vue/multi-word-component-names": 0,
79+
"vue/html-self-closing": 0,
80+
"prettier-vue/prettier": [
81+
"error",
82+
{
83+
// Override all options of `prettier` here
84+
// @see https://prettier.io/docs/en/options.html
85+
printWidth: 180,
86+
bracketSpacing: true,
87+
singleQuote: false,
88+
semi: true,
89+
trailingComma: "es5",
90+
bracketSameLine: true,
91+
jsxSingleQuote: false
92+
}
93+
]
94+
}
95+
};

.firebaserc

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@
1414
"prod-ropsten": [
1515
"ropsten-checkout-zksync"
1616
],
17-
"rinkeby-beta": [
18-
"rinkeby-beta-checkout-zksync"
19-
],
20-
"ropsten-beta": [
21-
"ropsten-beta-checkout-zksync"
22-
],
2317
"staging": [
2418
"staging-checkout-v1-zksync"
2519
]
2620
}
2721
}
2822
}
29-
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
1-
# This file was auto-generated by the Firebase CLI
2-
# https://github.com/firebase/firebase-tools
3-
4-
name: "Deploy PR preview"
1+
name: "Deploy preview"
52
"on": pull_request
63
jobs:
74
build_and_preview:
8-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} && {{ !contains(github.event.head_commit.message, 'skip ci') }}
5+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
96
runs-on: ubuntu-latest
107
environment: dev
118
steps:
129
- uses: actions/checkout@v2
1310

14-
- name: "Prepare: apply cache"
11+
- name: "Enable yarn cache"
1512
uses: c-hive/gha-yarn-cache@v2 # using cache
1613

17-
- name: "Prepare: node@lts setup"
14+
- name: "Setup node@14"
1815
uses: actions/setup-node@v2
1916
with:
20-
node-version: 'lts/*'
17+
node-version: 14
2118

22-
- name: "Prepare: yarn@3 & firebase-tools setup"
19+
- name: "Install dependencies"
2320
run: |
24-
yarn set version 3.1.0
21+
yarn set version 3.1.1
2522
yarn install
26-
npm install -g firebase-tools
2723
2824
- name: "Build: dapp"
2925
run: yarn run ci:build:rinkeby
30-
26+
3127
- name: "Deploy: preview"
3228
uses: matter-labs/action-hosting-deploy@v0
3329
with:
3430
repoToken: '${{ secrets.GITHUB_TOKEN }}'
3531
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_DEV }}"
36-
target: prod-rinkeby
32+
target: staging
3733
projectId: zsync-dapp-checkout
3834
env:
3935
FIREBASE_CLI_PREVIEWS: hostingchannels

.github/workflows/deploy-prod.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: "Deploy production"
2+
"on":
3+
workflow_dispatch:
4+
inputs:
5+
ref:
6+
type: string
7+
description: "The branch, tag or SHA to checkout"
8+
required: true
9+
default: "main"
10+
preview_env:
11+
type: string
12+
description: "Test on Rinkeby, ropsten or mainnet"
13+
required: true
14+
default: "rinkeby"
15+
jobs:
16+
build_and_preview:
17+
if: ${{ github.event.repository.full_name == github.repository }}
18+
runs-on: ubuntu-latest
19+
environment: dev
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
ref: "${{ github.event.inputs.ref }}"
24+
25+
- name: "Enable yarn cache"
26+
uses: c-hive/gha-yarn-cache@v2 # using cache
27+
28+
- name: "Setup node@14"
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: 14
32+
33+
- name: "Install dependencies"
34+
run: |
35+
yarn set version 3.1.1
36+
yarn install
37+
38+
39+
- name: "Build: env:${{github.event.inputs.preview_env}} for the preview"
40+
run: "yarn run ci:build:${{github.event.inputs.preview_env}}"
41+
- uses: actions/upload-artifact@v2
42+
with:
43+
name: "checkout-dist"
44+
path: "public/"
45+
if-no-files-found: error # "warn" or "ignore" are also available, defaults to `warn`
46+
retention-days: 5
47+
48+
- name: "Deploy: preview prod-${{github.event.inputs.preview_env}}"
49+
uses: matter-labs/action-hosting-deploy@v0
50+
with:
51+
repoToken: "${{secrets.GITHUB_TOKEN}}"
52+
firebaseServiceAccount: "${{secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_DEV}}"
53+
target: "staging"
54+
projectId: zsync-dapp-checkout
55+
channelID: "staging_preview"
56+
57+
build_and_deploy:
58+
if: ${{ github.event.repository.full_name == github.repository }}
59+
needs: build_and_preview
60+
runs-on: ubuntu-latest
61+
environment: prod
62+
steps:
63+
- uses: actions/checkout@v2
64+
with:
65+
ref: "${{github.event.inputs.ref}}"
66+
67+
- name: "Enable yarn cache"
68+
uses: c-hive/gha-yarn-cache@v2 # using cache
69+
70+
- name: "Setup node@14"
71+
uses: actions/setup-node@v2
72+
with:
73+
node-version: 14
74+
75+
- name: "Install dependencies"
76+
run: |
77+
yarn set version 3.1.1
78+
yarn install
79+
80+
- name: "Deploy target: prod-mainnet"
81+
run: yarn run ci:build:mainnet
82+
- uses: matter-labs/action-hosting-deploy@v0
83+
with:
84+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
85+
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_PROD }}"
86+
target: "prod-mainnet"
87+
projectId: zsync-dapp-checkout
88+
channelID: live
89+
90+
- name: "Build rinkeby"
91+
run: yarn run ci:build:rinkeby
92+
- uses: matter-labs/action-hosting-deploy@v0
93+
with:
94+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
95+
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_PROD }}"
96+
target: "prod-rinkeby"
97+
projectId: zsync-dapp-checkout
98+
channelID: live
99+
100+
- name: "Build ropsten"
101+
run: yarn run ci:build:ropsten
102+
103+
- name: "Deploy target: prod-ropsten"
104+
run: yarn run ci:build:ropsten
105+
- uses: matter-labs/action-hosting-deploy@v0
106+
with:
107+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
108+
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_PROD }}"
109+
target: "prod-ropsten"
110+
projectId: zsync-dapp-checkout
111+
channelID: live

.github/workflows/deploy-staging.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Deploy staging"
2+
"on":
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
build_and_deploy:
7+
if: ${{ github.event.repository.full_name == github.repository }}
8+
runs-on: ubuntu-latest
9+
environment: dev
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: "Enable yarn cache"
13+
uses: c-hive/gha-yarn-cache@v2 # using cache
14+
15+
- name: "Setup node@14"
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 14
19+
20+
- name: "Install dependencies"
21+
run: |
22+
yarn set version 3.1.1
23+
yarn install
24+
25+
- name: "Deploy target: rinkeby"
26+
run: yarn run ci:build:rinkeby
27+
- uses: matter-labs/action-hosting-deploy@v0
28+
with:
29+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
30+
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_DEV }}"
31+
target: staging
32+
projectId: zsync-dapp-checkout
33+
channelID: live

0 commit comments

Comments
 (0)