@ttoss/config 1.10.0 → 1.11.2
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.
- package/README.md +7 -9
- package/dist/esm/index.js +11 -1
- package/dist/index.js +11 -1
- package/package.json +7 -3
- package/src/babel.ts +9 -0
- package/src/jest.ts +1 -1
- package/tsconfig.json +30 -0
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ module.exports = babelConfig();
|
|
|
26
26
|
|
|
27
27
|
### Jest
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```ts title="jest.config.ts"
|
|
30
30
|
import { jestConfig } from '@ttoss/config';
|
|
31
31
|
|
|
32
32
|
const config = jestConfig({
|
|
@@ -42,18 +42,16 @@ export default config;
|
|
|
42
42
|
|
|
43
43
|
### Tsup
|
|
44
44
|
|
|
45
|
-
```
|
|
45
|
+
```ts title="tsup.config.ts"
|
|
46
46
|
import { tsupConfig } from '@ttoss/config';
|
|
47
47
|
|
|
48
48
|
export const tsup = tsupConfig();
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
### TypeScript
|
|
52
52
|
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const tsupConfig: () => any;
|
|
53
|
+
```json title="tsconfig.json"
|
|
54
|
+
{
|
|
55
|
+
"extends": "@ttoss/config/tsconfig.json"
|
|
56
|
+
}
|
|
59
57
|
```
|
package/dist/esm/index.js
CHANGED
|
@@ -9,6 +9,15 @@ var defaultConfig = {
|
|
|
9
9
|
["@babel/preset-env", { loose: true, targets: { node: "current" } }],
|
|
10
10
|
"@babel/preset-typescript",
|
|
11
11
|
["@babel/preset-react", { runtime: "automatic" }]
|
|
12
|
+
],
|
|
13
|
+
plugins: [
|
|
14
|
+
[
|
|
15
|
+
"formatjs",
|
|
16
|
+
{
|
|
17
|
+
idInterpolationPattern: "[sha512:contenthash:base64:6]",
|
|
18
|
+
ast: true
|
|
19
|
+
}
|
|
20
|
+
]
|
|
12
21
|
]
|
|
13
22
|
};
|
|
14
23
|
var babelConfig = configCreator(defaultConfig);
|
|
@@ -21,7 +30,8 @@ var defaultConfig2 = {
|
|
|
21
30
|
coverageProvider: "v8",
|
|
22
31
|
moduleNameMapper: {
|
|
23
32
|
"\\.(css)$": "identity-obj-proxy"
|
|
24
|
-
}
|
|
33
|
+
},
|
|
34
|
+
timers: "fake"
|
|
25
35
|
};
|
|
26
36
|
var jestConfig = configCreator(defaultConfig2);
|
|
27
37
|
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,15 @@ var defaultConfig = {
|
|
|
45
45
|
["@babel/preset-env", { loose: true, targets: { node: "current" } }],
|
|
46
46
|
"@babel/preset-typescript",
|
|
47
47
|
["@babel/preset-react", { runtime: "automatic" }]
|
|
48
|
+
],
|
|
49
|
+
plugins: [
|
|
50
|
+
[
|
|
51
|
+
"formatjs",
|
|
52
|
+
{
|
|
53
|
+
idInterpolationPattern: "[sha512:contenthash:base64:6]",
|
|
54
|
+
ast: true
|
|
55
|
+
}
|
|
56
|
+
]
|
|
48
57
|
]
|
|
49
58
|
};
|
|
50
59
|
var babelConfig = configCreator(defaultConfig);
|
|
@@ -57,7 +66,8 @@ var defaultConfig2 = {
|
|
|
57
66
|
coverageProvider: "v8",
|
|
58
67
|
moduleNameMapper: {
|
|
59
68
|
"\\.(css)$": "identity-obj-proxy"
|
|
60
|
-
}
|
|
69
|
+
},
|
|
70
|
+
timers: "fake"
|
|
61
71
|
};
|
|
62
72
|
var jestConfig = configCreator(defaultConfig2);
|
|
63
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "Default configuration for packages.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"module": "dist/esm/index.js",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
|
-
"src"
|
|
14
|
+
"src",
|
|
15
|
+
"tsconfig.json"
|
|
15
16
|
],
|
|
16
17
|
"keywords": [],
|
|
17
18
|
"author": "ttoss",
|
|
@@ -31,10 +32,13 @@
|
|
|
31
32
|
"@babel/preset-react": "^7.16.7",
|
|
32
33
|
"@babel/preset-typescript": "^7.16.7",
|
|
33
34
|
"@emotion/jest": "^11.7.1",
|
|
35
|
+
"@formatjs/ts-transformer": "^3.9.1",
|
|
36
|
+
"babel-plugin-formatjs": "^10.3.18",
|
|
34
37
|
"deepmerge": "^4.2.2",
|
|
38
|
+
"identity-obj-proxy": "^3.0.0",
|
|
35
39
|
"tsup": "^5.11.11"
|
|
36
40
|
},
|
|
37
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "bfa85a01a6aee10490a91752afe3ca95fa5e52a8",
|
|
38
42
|
"devDependencies": {
|
|
39
43
|
"@jest/types": "^27.4.2"
|
|
40
44
|
}
|
package/src/babel.ts
CHANGED
|
@@ -14,6 +14,15 @@ export const defaultConfig: any = {
|
|
|
14
14
|
'@babel/preset-typescript',
|
|
15
15
|
['@babel/preset-react', { runtime: 'automatic' }],
|
|
16
16
|
],
|
|
17
|
+
plugins: [
|
|
18
|
+
[
|
|
19
|
+
'formatjs',
|
|
20
|
+
{
|
|
21
|
+
idInterpolationPattern: '[sha512:contenthash:base64:6]',
|
|
22
|
+
ast: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
],
|
|
17
26
|
};
|
|
18
27
|
|
|
19
28
|
export const babelConfig = configCreator(defaultConfig);
|
package/src/jest.ts
CHANGED
|
@@ -174,7 +174,7 @@ export const defaultConfig: Config.InitialOptions = {
|
|
|
174
174
|
// testURL: "http://localhost",
|
|
175
175
|
|
|
176
176
|
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
|
177
|
-
|
|
177
|
+
timers: 'fake',
|
|
178
178
|
|
|
179
179
|
// A map from regular expressions to paths to transformers
|
|
180
180
|
// transform: undefined,
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"plugins": [
|
|
4
|
+
{
|
|
5
|
+
"transform": "@formatjs/ts-transformer",
|
|
6
|
+
"import": "transform",
|
|
7
|
+
"type": "config",
|
|
8
|
+
"overrideIdFn": "[sha512:contenthash:base64:6]",
|
|
9
|
+
"ast": true
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"lib": ["dom", "esnext"],
|
|
14
|
+
"importHelpers": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noFallthroughCasesInSwitch": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"moduleResolution": "node",
|
|
23
|
+
"jsx": "react-jsx",
|
|
24
|
+
"esModuleInterop": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"forceConsistentCasingInFileNames": true,
|
|
27
|
+
"noEmit": true,
|
|
28
|
+
"resolveJsonModule": true
|
|
29
|
+
}
|
|
30
|
+
}
|