@deot/dev-cli 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ const options = JSON.parse(decodeURIComponent(process.env.TEST_OPTIONS || '{}'));
2
+ const { packageName } = options;
3
+
4
+ export default {
5
+ preset: 'ts-jest',
6
+ transform: {
7
+ '^.+\\.tsx?$': [
8
+ 'ts-jest',
9
+ {
10
+ tsconfig: {
11
+ module: 'esnext',
12
+ target: 'esnext',
13
+ sourceMap: true
14
+ }
15
+ }
16
+ ],
17
+ // 这里主要用于编译node_modules内的js
18
+ '^.+\\.jsx?$': 'babel-jest'
19
+ },
20
+
21
+ testEnvironment: 'jsdom', // or node
22
+ // 匹配相关
23
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
24
+ // 匹配规则很重要
25
+ rootDir: process.cwd(),
26
+ watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
27
+ testPathIgnorePatterns: [
28
+ '/node_modules/'
29
+ ],
30
+ testMatch: [
31
+ `<rootDir>/packages/${packageName || '**'}/__tests__/**.(spec|test).[jt]s?(x)`
32
+ ],
33
+
34
+ collectCoverage: true,
35
+ coverageDirectory: 'coverage',
36
+ collectCoverageFrom: [
37
+ `packages/${packageName || '*'}/src/**/*.ts`
38
+ ],
39
+ coverageThreshold: {
40
+ global: {
41
+ branches: 95,
42
+ functions: 95,
43
+ lines: 95,
44
+ statements: 95,
45
+ }
46
+ },
47
+ globals: {
48
+ __VERSION__: 'test',
49
+ __TEST__: true
50
+ }
51
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/dev-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@babel/core": "^7.21.3",
17
17
  "@babel/preset-env": "^7.20.2",
18
- "@deot/dev-shared": "^1.0.0",
18
+ "@deot/dev-shared": "^1.0.1",
19
19
  "@microsoft/api-extractor": "^7.34.4",
20
20
  "@rollup/plugin-commonjs": "^24.0.1",
21
21
  "@rollup/plugin-node-resolve": "^15.0.1",
@@ -49,10 +49,10 @@
49
49
  "upath": "^2.0.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@deot/dev-test": "^1.0.0"
52
+ "@deot/dev-test": "^1.0.1"
53
53
  },
54
54
  "bin": {
55
55
  "ddc": "bin/cli.js"
56
56
  },
57
- "gitHead": "f960c31945e60a492e50e835cbf0c987a9fc3d5c"
57
+ "gitHead": "9f098b9a3cfa6deae01cf6066d6cc2e07ee26034"
58
58
  }