-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mapengda
committed
Mar 19, 2021
1 parent
6d68e45
commit 37b6cd3
Showing
13 changed files
with
314 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true | ||
}, | ||
"globals": { | ||
"module": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
} | ||
], | ||
"comma-dangle": [ | ||
"error", | ||
"only-multiline" | ||
], | ||
"function-paren-newline": [ | ||
"error", | ||
"multiline-arguments" | ||
], | ||
"no-whitespace-before-property": [ | ||
"error" | ||
], | ||
"space-infix-ops": [ | ||
"error" | ||
], | ||
"space-unary-ops": [ | ||
"error" | ||
], | ||
"rest-spread-spacing": [ | ||
"error", | ||
"never" | ||
], | ||
"object-property-newline": [ | ||
"error", | ||
{ | ||
"allowAllPropertiesOnSameLine": true | ||
} | ||
], | ||
"no-multi-spaces": [ | ||
"error" | ||
], | ||
"keyword-spacing": [ | ||
"error" | ||
], | ||
"object-curly-spacing": [ | ||
"error", | ||
"always", | ||
{ | ||
"objectsInObjects": false | ||
} | ||
], | ||
"space-before-blocks": "error", | ||
"comma-spacing": [ | ||
"error" | ||
], | ||
"@typescript-eslint/explicit-module-boundary-types": 0, | ||
"@typescript-eslint/no-var-requires": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-irregular-whitespace": 0 | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
language: node_js | ||
node_js: | ||
- 14 | ||
|
||
env: | ||
- TEST=1 BUILD_NAME=bd | ||
|
||
install: | ||
- npm install | ||
|
||
branches: | ||
only: | ||
- main | ||
- /^ci-.*$/ | ||
|
||
stages: | ||
- test | ||
- name: publish | ||
if: commit_message =~ /release/ | ||
|
||
_shared_build: &bd | ||
script: npm run $BUILD_NAME | ||
if: env(BUILD_NAME) =~ /^\w/ | ||
|
||
jobs: | ||
exclude: | ||
- if: branch = dev OR commit_message =~ /(no-ci)/ | ||
include: | ||
- stage: test | ||
script: npm run test | ||
|
||
- stage: publish | ||
script: npm run $BUILD_NAME | ||
deploy: | ||
provider: npm | ||
api_key: $NPM_API_KEY | ||
email: $EMAIL | ||
on: | ||
branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
|
||
// This is a custom Jest transformer turning style imports into empty objects. | ||
// http://facebook.github.io/jest/docs/tutorial-webpack.html | ||
|
||
module.exports = { | ||
process() { | ||
return "module.exports = {};"; | ||
}, | ||
getCacheKey() { | ||
// The output is always the same. | ||
return "cssTransform"; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
|
||
// This is a custom Jest transformer turning file imports into filenames. | ||
// http://facebook.github.io/jest/docs/tutorial-webpack.html | ||
|
||
module.exports = { | ||
process(src, filename) { | ||
return `module.exports = ${JSON.stringify(path.basename(filename))};`; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
// jest.mock("app/utils", () => { | ||
// return { | ||
// store: {}, // require("../src/app/utils/index"), | ||
// PicFilter: jest.fn(), | ||
// }; | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
module.exports = { | ||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation | ||
transformIgnorePatterns: ['\\\\node_modules\\\\'], | ||
|
||
// Automatically clear mock calls and instances between every test | ||
clearMocks: true, | ||
// The directory where Jest should output its coverage files | ||
coverageDirectory: 'coverage', | ||
|
||
// An array of file extensions your modules use | ||
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'web.js'], | ||
|
||
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module | ||
moduleNameMapper: { | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': | ||
"<rootDir>/config/jest/fileTransform.js", | ||
'\\.(css|less)$': "<rootDir>/config/jest/cssTransform.js", | ||
'app\\/(.*)$': '<rootDir>/src/app/$1', | ||
'@\\/(.*)$': '<rootDir>/src/app/$1', | ||
}, | ||
|
||
// A preset that is used as a base for Jest's configuration | ||
preset: 'ts-jest', | ||
|
||
// The test environment that will be used for testing | ||
testEnvironment: 'node', | ||
setupFiles: [ | ||
// "<rootDir>/config/polyfills.js", | ||
], | ||
testPathIgnorePatterns: ["scripts"], | ||
transform: { | ||
// "^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest", | ||
"^.+\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest", | ||
// "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js", | ||
// "^(?!.*\\.(css|json)$)": "<rootDir>/config/jest/fileTransform.js" | ||
}, | ||
} | ||
module.exports = { | ||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation | ||
transformIgnorePatterns: ['node_modules'], | ||
|
||
// Automatically clear mock calls and instances between every test | ||
clearMocks: true, | ||
// The directory where Jest should output its coverage files | ||
coverageDirectory: 'coverage', | ||
|
||
// An array of file extensions your modules use | ||
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'web.js'], | ||
|
||
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module | ||
moduleNameMapper: { | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': | ||
"<rootDir>/config/jest/fileTransform.js", | ||
'\\.(css|less)$': "<rootDir>/config/jest/cssTransform.js", | ||
'app\\/(.*)$': '<rootDir>/src/app/$1', | ||
'@\\/(.*)$': '<rootDir>/src/app/$1', | ||
}, | ||
|
||
// A preset that is used as a base for Jest's configuration | ||
preset: 'ts-jest', | ||
|
||
// The test environment that will be used for testing | ||
testEnvironment: 'node', | ||
setupFiles: [ | ||
// "<rootDir>/config/polyfills.js", | ||
], | ||
testPathIgnorePatterns: ["scripts"], | ||
transform: { | ||
// "^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest", | ||
"^.+\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest", | ||
// "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js", | ||
// "^(?!.*\\.(css|json)$)": "<rootDir>/config/jest/fileTransform.js" | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.