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