Skip to content

Commit 4402b2b

Browse files
committed
feat: init project
0 parents  commit 4402b2b

Some content is hidden

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

46 files changed

+1622
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
indent_size = 2
11+
indent_style = space
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage
2+
dist
3+
node_modules
4+
example
5+
*.test.js
6+
src/_src
7+
.next
8+
.nuxt
9+
build
10+
11+
src/_shims
12+
src/_fixtures
13+
examples

.eslintrc.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['prettier'],
4+
plugins: ['import', 'prettier'],
5+
env: {
6+
es6: true,
7+
jest: true,
8+
node: true,
9+
},
10+
parser: '@typescript-eslint/parser',
11+
parserOptions: {
12+
ecmaVersion: 2018,
13+
sourceType: 'module',
14+
ecmaFeatures: {
15+
jsx: true,
16+
},
17+
},
18+
globals: {
19+
on: true, // for the Socket file
20+
},
21+
rules: {
22+
'array-bracket-spacing': [
23+
'error',
24+
'never',
25+
{
26+
objectsInArrays: false,
27+
arraysInArrays: false,
28+
},
29+
],
30+
'arrow-parens': ['error', 'always'],
31+
'arrow-spacing': ['error', { before: true, after: true }],
32+
curly: 'error',
33+
'eol-last': 'error',
34+
'func-names': 'off',
35+
'id-length': [
36+
'error',
37+
{
38+
min: 1,
39+
max: 50,
40+
properties: 'never',
41+
exceptions: ['e', 'i', 'n', 't', 'x', 'y', 'z', '_', '$'],
42+
},
43+
],
44+
'no-alert': 'error',
45+
'no-console': 'off',
46+
'no-const-assign': 'error',
47+
'no-else-return': 'error',
48+
'no-empty': 'off',
49+
'no-shadow': 'error',
50+
'no-undef': 'error',
51+
'no-unused-vars': 'error',
52+
'no-use-before-define': 'error',
53+
'no-useless-constructor': 'error',
54+
'object-curly-newline': 'off',
55+
'object-shorthand': 'off',
56+
'prefer-const': 'error',
57+
'prefer-destructuring': ['error', { object: true, array: false }],
58+
quotes: [
59+
'error',
60+
'single',
61+
{
62+
allowTemplateLiterals: true,
63+
avoidEscape: true,
64+
},
65+
],
66+
semi: ['error', 'always'],
67+
'comma-dangle': ['error', 'always-multiline'],
68+
'spaced-comment': 'error',
69+
strict: ['error', 'global'],
70+
'prettier/prettier': 'error',
71+
},
72+
};

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/_fixtures/** linguist-vendored
2+
examples/** linguist-vendored

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
# Ensure connection with 'master' branch
16+
fetch-depth: 2
17+
18+
- name: Install Node.js and npm
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
registry-url: https://registry.npmjs.org
23+
24+
- name: Retrieve dependencies from cache
25+
id: cacheNpm
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.npm
30+
node_modules
31+
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
32+
restore-keys: |
33+
npm-v14-${{ runner.os }}-${{ github.ref }}-
34+
npm-v14-${{ runner.os }}-refs/heads/master-
35+
36+
- name: Install dependencies
37+
if: steps.cacheNpm.outputs.cache-hit != 'true'
38+
run: |
39+
npm update --no-save
40+
npm update --save-dev --no-save
41+
- name: Running tests
42+
run: npm run test
43+
env:
44+
SERVERLESS_PLATFORM_VENDOR: tencent
45+
GLOBAL_ACCELERATOR_NA: true
46+
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
47+
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}

.github/workflows/validate.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
lintAndFormatting:
9+
name: Lint & Formatting
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
# Ensure connection with 'master' branch
16+
fetch-depth: 2
17+
18+
- name: Install Node.js and npm
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
registry-url: https://registry.npmjs.org
23+
24+
- name: Retrieve dependencies from cache
25+
id: cacheNpm
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.npm
30+
node_modules
31+
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
32+
restore-keys: |
33+
npm-v14-${{ runner.os }}-${{ github.ref }}-
34+
npm-v14-${{ runner.os }}-refs/heads/master-
35+
36+
- name: Install dependencies
37+
if: steps.cacheNpm.outputs.cache-hit != 'true'
38+
run: |
39+
npm update --no-save
40+
npm update --save-dev --no-save
41+
42+
- name: Validate Formatting
43+
run: npm run prettier:fix
44+
- name: Validate Lint rules
45+
run: npm run lint:fix

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.DS_Store
2+
*.sublime-project
3+
*.sublime-workspace
4+
*.log
5+
.serverless
6+
v8-compile-cache-*
7+
jest/*
8+
coverage
9+
.serverless_plugins
10+
testProjects/*/package-lock.json
11+
testProjects/*/yarn.lock
12+
.serverlessUnzipped
13+
node_modules
14+
.vscode/
15+
.eslintcache
16+
dist
17+
.idea
18+
build/
19+
.env*
20+
!.env.example
21+
env.js
22+
package-lock.json
23+
test
24+
yarn.lock
25+
test/src/node_modules
26+
test/src/.next
27+
test/src/package-lock.json
28+
__pycache__

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test
2+
example

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
coverage
2+
dist
3+
node_modules
4+
CHANGELOG.md
5+
*.test.js
6+
tests/src/.next
7+
tests/src/node_modules
8+
9+
.next
10+
.nuxt
11+
build
12+
13+
src/_shims
14+
src/_fixtures
15+
examples

0 commit comments

Comments
 (0)