mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-10-07 16:35:15 +08:00
feat: add monorepo
This commit is contained in:
18
packages/shared/.eslintrc.json
Normal file
18
packages/shared/.eslintrc.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
11
packages/shared/README.md
Normal file
11
packages/shared/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# shared
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build shared` to build the library.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test shared` to execute the unit tests via [Jest](https://jestjs.io).
|
14
packages/shared/jest.config.js
Normal file
14
packages/shared/jest.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
displayName: 'shared',
|
||||
preset: '../../jest.preset.js',
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
},
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/shared',
|
||||
};
|
5
packages/shared/package.json
Normal file
5
packages/shared/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@bitdance/shared",
|
||||
"version": "0.0.1",
|
||||
"type": "commonjs"
|
||||
}
|
33
packages/shared/project.json
Normal file
33
packages/shared/project.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"root": "packages/shared",
|
||||
"sourceRoot": "packages/shared/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/js:tsc",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/shared",
|
||||
"main": "packages/shared/src/index.ts",
|
||||
"tsConfig": "packages/shared/tsconfig.lib.json",
|
||||
"assets": ["packages/shared/*.md"]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["packages/shared/**/*.ts"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/packages/shared"],
|
||||
"options": {
|
||||
"jestConfig": "packages/shared/jest.config.js",
|
||||
"passWithNoTests": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
1
packages/shared/src/index.ts
Normal file
1
packages/shared/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib/shared';
|
7
packages/shared/src/lib/shared.spec.ts
Normal file
7
packages/shared/src/lib/shared.spec.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { shared } from './shared';
|
||||
|
||||
describe('shared', () => {
|
||||
it('should work', () => {
|
||||
expect(shared()).toEqual('shared');
|
||||
});
|
||||
});
|
3
packages/shared/src/lib/shared.ts
Normal file
3
packages/shared/src/lib/shared.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function shared(): string {
|
||||
return 'shared';
|
||||
}
|
22
packages/shared/tsconfig.json
Normal file
22
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
}
|
10
packages/shared/tsconfig.lib.json
Normal file
10
packages/shared/tsconfig.lib.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": []
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["**/*.spec.ts"]
|
||||
}
|
9
packages/shared/tsconfig.spec.json
Normal file
9
packages/shared/tsconfig.spec.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
|
||||
}
|
Reference in New Issue
Block a user