mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-10-07 08:25:15 +08:00
feat: add monorepo
This commit is contained in:
18
packages/services/.eslintrc.json
Normal file
18
packages/services/.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/services/README.md
Normal file
11
packages/services/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# services
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build services` to build the library.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test services` to execute the unit tests via [Jest](https://jestjs.io).
|
14
packages/services/jest.config.js
Normal file
14
packages/services/jest.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
displayName: 'services',
|
||||
preset: '../../jest.preset.js',
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
},
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/services',
|
||||
};
|
5
packages/services/package.json
Normal file
5
packages/services/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@bitdance/services",
|
||||
"version": "0.0.1",
|
||||
"type": "commonjs"
|
||||
}
|
33
packages/services/project.json
Normal file
33
packages/services/project.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"root": "packages/services",
|
||||
"sourceRoot": "packages/services/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/js:tsc",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/services",
|
||||
"main": "packages/services/src/index.ts",
|
||||
"tsConfig": "packages/services/tsconfig.lib.json",
|
||||
"assets": ["packages/services/*.md"]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["packages/services/**/*.ts"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/packages/services"],
|
||||
"options": {
|
||||
"jestConfig": "packages/services/jest.config.js",
|
||||
"passWithNoTests": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
1
packages/services/src/index.ts
Normal file
1
packages/services/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib/services';
|
7
packages/services/src/lib/services.spec.ts
Normal file
7
packages/services/src/lib/services.spec.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { services } from './services';
|
||||
|
||||
describe('services', () => {
|
||||
it('should work', () => {
|
||||
expect(services()).toEqual('services');
|
||||
});
|
||||
});
|
3
packages/services/src/lib/services.ts
Normal file
3
packages/services/src/lib/services.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function services(): string {
|
||||
return 'services';
|
||||
}
|
22
packages/services/tsconfig.json
Normal file
22
packages/services/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/services/tsconfig.lib.json
Normal file
10
packages/services/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/services/tsconfig.spec.json
Normal file
9
packages/services/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