Skip to content

Commit

Permalink
refactor(stencil-toolkit): 调整基础代码结构
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmysh committed Dec 7, 2021
1 parent fae45b5 commit 14ad99c
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
3 changes: 3 additions & 0 deletions libs/stencil-toolkit/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
}
33 changes: 7 additions & 26 deletions libs/stencil-toolkit/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,15 @@
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"parserOptions": {
"project": ["libs/stencil-toolkit/tsconfig.*?.json"]
},
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "aiao",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "aiao",
"style": "kebab-case"
}
]
},
"plugins": ["@typescript-eslint"]
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
Expand Down
24 changes: 12 additions & 12 deletions libs/stencil-toolkit/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
name: 'stencil-toolkit',
displayName: 'stencil-toolkit',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/libs/stencil-toolkit',
collectCoverageFrom: ['./src/lib/**/*.ts'],

setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } },
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
],
testEnvironment: 'node'
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json'
}
},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/stencil-toolkit'
};
8 changes: 2 additions & 6 deletions libs/stencil-toolkit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"projectType": "library",
"root": "libs/stencil-toolkit",
"sourceRoot": "libs/stencil-toolkit/src",
"prefix": "aiao",
"tags": ["stencil-tool"],
"targets": {
"build": {
"executor": "@nrwl/node:package",
Expand All @@ -24,9 +24,6 @@
],
"srcRootForCompilationRoot": "libs/stencil-toolkit/src"
},
"configurations": {
"production": {}
},
"outputs": ["{options.outputPath}"]
},
"lint": {
Expand All @@ -44,6 +41,5 @@
},
"outputs": ["coverage/libs/stencil-toolkit"]
}
},
"tags": ["stencil-tool"]
}
}
Empty file.
14 changes: 8 additions & 6 deletions libs/stencil-toolkit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": [],
"exclude": ["**/files/**/*"],
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
],
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}
}
7 changes: 6 additions & 1 deletion libs/stencil-toolkit/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": { "module": "commonjs", "outDir": "../../dist/out-tsc", "declaration": true, "types": ["node"] },
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts"]
}
19 changes: 16 additions & 3 deletions libs/stencil-toolkit/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
{
"extends": "./tsconfig.json",
"compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] },
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.test.ts",
"**/*.spec.ts",
"**/*.test.tsx",
"**/*.spec.tsx",
"**/*.test.js",
"**/*.spec.js",
"**/*.test.jsx",
"**/*.spec.jsx",
"**/*.d.ts"
]
}

0 comments on commit 14ad99c

Please sign in to comment.