@yarn-tool/static-file 2.0.0 → 2.0.3
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/CHANGELOG.md +44 -0
- package/file/github/commit-convention.md +91 -0
- package/file/github/workflows/action-yarnlock-dedupe.yml +2 -0
- package/file/github/workflows/yarn-lock-changes.yml +30 -0
- package/file/gitignore +5 -0
- package/file/jest.config.auto.js +116 -0
- package/file/jest.config.js +78 -4
- package/file/npmignore +10 -0
- package/file/test/__root.d.ts +1 -1
- package/file/test/__root.js +2 -2
- package/file/test/__root.js.map +1 -1
- package/file/test/__root.ts +1 -1
- package/file/ws-root/__root_ws.d.ts +1 -1
- package/file/ws-root/__root_ws.js +2 -2
- package/file/ws-root/__root_ws.js.map +1 -1
- package/file/ws-root/__root_ws.ts +1 -1
- package/file/ws-root/jest-preset.js +5 -0
- package/lib/const.js +9 -1
- package/lib/const.js.map +1 -1
- package/lib/types.d.ts +7 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.2...@yarn-tool/static-file@2.0.3) (2022-08-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update jest preset ([0aafe23](https://github.com/bluelovers/ws-yarn-workspaces/commit/0aafe239e0da4d8cb6f9580fc50c9a42432390a6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ✨ Features
|
|
15
|
+
|
|
16
|
+
* update static-file ([6d3f126](https://github.com/bluelovers/ws-yarn-workspaces/commit/6d3f1261ac1d82d4045293ac2c561ea866156dd4))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.1...@yarn-tool/static-file@2.0.2) (2022-07-31)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ✨ Features
|
|
26
|
+
|
|
27
|
+
* update static files ([2da4c65](https://github.com/bluelovers/ws-yarn-workspaces/commit/2da4c65772856fa729bee66893dd4e347f7ede05))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.0...@yarn-tool/static-file@2.0.1) (2022-07-11)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### ✨ Features
|
|
37
|
+
|
|
38
|
+
* Yarn Lock Changes ([0c3f6fc](https://github.com/bluelovers/ws-yarn-workspaces/commit/0c3f6fc1ec95dc310007958008e39b1d09b22e86))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### 🔖 Miscellaneous
|
|
42
|
+
|
|
43
|
+
* . ([eb33254](https://github.com/bluelovers/ws-yarn-workspaces/commit/eb33254943fd54d5fe54f9c36989670ec0e44d1b))
|
|
44
|
+
* . ([9bf581b](https://github.com/bluelovers/ws-yarn-workspaces/commit/9bf581bf4951c76d9556e04f3c8c84989b217ba4))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
# [2.0.0](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@1.0.103...@yarn-tool/static-file@2.0.0) (2022-07-07)
|
|
7
51
|
|
|
8
52
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
## Git Commit Message Convention
|
|
2
|
+
|
|
3
|
+
> This is adapted from [bluelovers's commit convention](https://github.com/bluelovers/conventional-changelog-bluelovers).
|
|
4
|
+
|
|
5
|
+
### TL;DR:
|
|
6
|
+
|
|
7
|
+
提交信息必須滿足以下正則表達式:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|dep)(\(.+\))?: .{1,50}/
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Changelog
|
|
14
|
+
|
|
15
|
+
後續會從 commit 信息自動生成 changelog
|
|
16
|
+
|
|
17
|
+
- feat: 新增/修改功能 (feature)。
|
|
18
|
+
- fix: 修補 bug (bug fix)。
|
|
19
|
+
- docs: 文件 (documentation)。
|
|
20
|
+
- style: 格式 (不影響程式碼運行的變動 white-space, formatting, missing semi colons, etc)。
|
|
21
|
+
- refactor: 重構 (既不是新增功能,也不是修補 bug 的程式碼變動)。
|
|
22
|
+
- perf: 改善效能 (A code change that improves performance)。
|
|
23
|
+
- test: 增加測試 (when adding missing tests)。
|
|
24
|
+
- chore: 建構程序或輔助工具的變動 (maintain)。
|
|
25
|
+
- revert: 撤銷回覆先前的 commit 例如:revert: type(scope): subject (回覆版本:xxxx)。
|
|
26
|
+
|
|
27
|
+
#### 注意
|
|
28
|
+
|
|
29
|
+
- 如果一次修改涉及到多個類型,選擇最貼切的。
|
|
30
|
+
- 對於涉及到某個或多個 issue 的修改,請在提交信息中附帶 `close #1234` 格式的標註。
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
|
|
34
|
+
### 包含描述以及頁腳有重大變更的提交說明
|
|
35
|
+
|
|
36
|
+
```conventionalcommit
|
|
37
|
+
feat: allow provided config object to extend other configs
|
|
38
|
+
|
|
39
|
+
BREAKING CHANGE: `extends` key in config file is now used for extending other config files
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 包含用以提示重大變更的 `!` 的提交說明
|
|
43
|
+
|
|
44
|
+
```conventionalcommit
|
|
45
|
+
feat!: send an email to the customer when a product is shipped
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 包含作用範圍和提示重大變更的 `!` 的提交說明
|
|
49
|
+
|
|
50
|
+
```conventionalcommit
|
|
51
|
+
feat(api)!: send an email to the customer when a product is shipped
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 包含 `!` 以及頁腳有重大變更的提交說明
|
|
55
|
+
|
|
56
|
+
```conventionalcommit
|
|
57
|
+
chore!: drop support for Node 6
|
|
58
|
+
|
|
59
|
+
BREAKING CHANGE: use JavaScript features not available in Node 6.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 不包含正文的提交說明
|
|
63
|
+
|
|
64
|
+
```conventionalcommit
|
|
65
|
+
docs: correct spelling of CHANGELOG
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 包含作用範圍的提交說明
|
|
69
|
+
|
|
70
|
+
```conventionalcommit
|
|
71
|
+
feat(lang): add polish language
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 正文有多段落以及有多個頁腳的提交說明
|
|
75
|
+
|
|
76
|
+
```conventionalcommit
|
|
77
|
+
fix: prevent racing of requests
|
|
78
|
+
|
|
79
|
+
Introduce a request id and a reference to latest request. Dismiss
|
|
80
|
+
incoming responses other than from latest request.
|
|
81
|
+
|
|
82
|
+
Remove timeouts which were used to mitigate the racing issue but are
|
|
83
|
+
obsolete now.
|
|
84
|
+
|
|
85
|
+
Reviewed-by: Z
|
|
86
|
+
Refs: #123
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Reference
|
|
90
|
+
|
|
91
|
+
- https://www.conventionalcommits.org/zh-hant
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Yarn Lock Changes
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
paths:
|
|
5
|
+
- yarn.lock
|
|
6
|
+
# push:
|
|
7
|
+
# paths:
|
|
8
|
+
# - yarn.lock
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
yarn_lock_changes:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
# Permission overwrite is required for Dependabot PRs, see "Common issues" below.
|
|
14
|
+
permissions:
|
|
15
|
+
pull-requests: write
|
|
16
|
+
steps:
|
|
17
|
+
-
|
|
18
|
+
name: Checkout
|
|
19
|
+
uses: actions/checkout@v3
|
|
20
|
+
-
|
|
21
|
+
name: Yarn Lock Changes
|
|
22
|
+
# Please use `main` as version before the stable release will be published as `v1`.
|
|
23
|
+
uses: Simek/yarn-lock-changes@main
|
|
24
|
+
with:
|
|
25
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
# Optional inputs, can be deleted safely if you are happy with default values.
|
|
27
|
+
collapsibleThreshold: 25
|
|
28
|
+
failOnDowngrade: false
|
|
29
|
+
path: yarn.lock
|
|
30
|
+
updateComment: true
|
package/file/gitignore
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
const { basename, extname, dirname } = require('path');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* // @type { import('@jest/types').Config.InitialOptions }
|
|
7
|
+
* @type { import('ts-jest').InitialOptionsTsJest }
|
|
8
|
+
*/
|
|
9
|
+
let jestConfig = {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} name
|
|
15
|
+
* @returns {string}
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
function _requireResolve(name)
|
|
19
|
+
{
|
|
20
|
+
let result;
|
|
21
|
+
|
|
22
|
+
try
|
|
23
|
+
{
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const { requireResolveExtra, requireResolveCore } = require('@yarn-tool/require-resolve');
|
|
26
|
+
|
|
27
|
+
const paths = [
|
|
28
|
+
requireResolveExtra('@bluelovers/tsdx').result,
|
|
29
|
+
requireResolveExtra('tsdx').result,
|
|
30
|
+
].filter(Boolean);
|
|
31
|
+
|
|
32
|
+
result = requireResolveCore(name, {
|
|
33
|
+
includeGlobal: true,
|
|
34
|
+
includeCurrentDirectory: true,
|
|
35
|
+
paths,
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
catch (e)
|
|
39
|
+
{
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
result = result || require.resolve(name);
|
|
44
|
+
|
|
45
|
+
console.info('[require.resolve]', name, '=>', result)
|
|
46
|
+
|
|
47
|
+
return result
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let _ok = true;
|
|
51
|
+
|
|
52
|
+
try
|
|
53
|
+
{
|
|
54
|
+
if (!jestConfig.preset)
|
|
55
|
+
{
|
|
56
|
+
|
|
57
|
+
let result = require('@yarn-tool/ws-find-up-paths').findUpPathsWorkspaces([
|
|
58
|
+
'jest-preset.js',
|
|
59
|
+
'jest.config.js',
|
|
60
|
+
], {
|
|
61
|
+
ignoreCurrentPackage: true,
|
|
62
|
+
onlyFiles: true,
|
|
63
|
+
}).result;
|
|
64
|
+
|
|
65
|
+
if (result)
|
|
66
|
+
{
|
|
67
|
+
let name = basename(result, extname(result))
|
|
68
|
+
|
|
69
|
+
switch (name)
|
|
70
|
+
{
|
|
71
|
+
case 'jest-preset':
|
|
72
|
+
jestConfig.preset = dirname(result);
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
jestConfig = {
|
|
76
|
+
...require(result),
|
|
77
|
+
jestConfig,
|
|
78
|
+
};
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_ok = false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e)
|
|
87
|
+
{
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
try
|
|
92
|
+
{
|
|
93
|
+
if (_ok && !jestConfig.preset)
|
|
94
|
+
{
|
|
95
|
+
let result = _requireResolve('@bluelovers/jest-config/package.json');
|
|
96
|
+
if (result)
|
|
97
|
+
{
|
|
98
|
+
jestConfig.preset = dirname(result);
|
|
99
|
+
_ok = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (e)
|
|
104
|
+
{
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (_ok && !jestConfig.preset)
|
|
109
|
+
{
|
|
110
|
+
jestConfig.preset = '@bluelovers/jest-config';
|
|
111
|
+
_ok = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
console.info(`jest.config.preset: ${jestConfig.preset}`);
|
|
115
|
+
|
|
116
|
+
module.exports = jestConfig
|
package/file/jest.config.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
+
const { join, dirname } = require('path');
|
|
4
|
+
const { tryRealpath } = require('jest-util');
|
|
5
|
+
const { tmpdir } = require('os');
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
* @param {string} name
|
|
5
9
|
* @returns {string}
|
|
@@ -37,6 +41,27 @@ function _requireResolve(name)
|
|
|
37
41
|
return result
|
|
38
42
|
}
|
|
39
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @returns {string}
|
|
46
|
+
* @see https://github.com/facebook/jest/blob/main/packages/jest-config/src/getCacheDirectory.ts
|
|
47
|
+
*/
|
|
48
|
+
function getCacheDirectory()
|
|
49
|
+
{
|
|
50
|
+
const { getuid } = process;
|
|
51
|
+
const tmpdirPath = process.env['JEST_CACHE_DIRECTORY'] || join(tryRealpath(tmpdir()), 'jest');
|
|
52
|
+
if (getuid == null)
|
|
53
|
+
{
|
|
54
|
+
return tmpdirPath;
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
{
|
|
58
|
+
// On some platforms tmpdir() is `/tmp`, causing conflicts between different
|
|
59
|
+
// users and permission issues. Adding an additional subdivision by UID can
|
|
60
|
+
// help.
|
|
61
|
+
return `${tmpdirPath}_${getuid.call(process).toString(36)}`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
40
65
|
const testExt = [
|
|
41
66
|
'ts',
|
|
42
67
|
'tsx',
|
|
@@ -48,20 +73,19 @@ const testExt = [
|
|
|
48
73
|
// 'cjs',
|
|
49
74
|
].join('|');
|
|
50
75
|
|
|
51
|
-
|
|
52
|
-
console.info(`- file: ${__filename}`);
|
|
53
|
-
console.info(`- cwd: ${process.cwd()}`);
|
|
76
|
+
const cacheDirectory = getCacheDirectory();
|
|
54
77
|
|
|
55
78
|
/**
|
|
56
79
|
* // @type { import('@jest/types').Config.InitialOptions }
|
|
57
80
|
* @type { import('ts-jest').InitialOptionsTsJest }
|
|
58
81
|
*/
|
|
59
|
-
|
|
82
|
+
const jestConfig = {
|
|
60
83
|
globals: {
|
|
61
84
|
'ts-jest': {
|
|
62
85
|
//tsconfig: 'tsconfig.spec.json',
|
|
63
86
|
},
|
|
64
87
|
},
|
|
88
|
+
cacheDirectory,
|
|
65
89
|
maxWorkers: 1,
|
|
66
90
|
clearMocks: true,
|
|
67
91
|
passWithNoTests: true,
|
|
@@ -91,6 +115,7 @@ module.exports = {
|
|
|
91
115
|
'/__tests__/helpers/',
|
|
92
116
|
'/__tests__/utils/',
|
|
93
117
|
'__mocks__',
|
|
118
|
+
'/dist/',
|
|
94
119
|
],
|
|
95
120
|
//testRunner: 'jest-circus/runner',
|
|
96
121
|
setupFilesAfterEnv: [
|
|
@@ -118,12 +143,61 @@ module.exports = {
|
|
|
118
143
|
'/node_modules/',
|
|
119
144
|
'/__snapshots__/',
|
|
120
145
|
'/__tests__/',
|
|
146
|
+
'/__test__/',
|
|
121
147
|
//'**/node_modules/',
|
|
122
148
|
//'**/__snapshots__/',
|
|
123
149
|
//'**/__tests__/',
|
|
150
|
+
'/dist/',
|
|
151
|
+
'/test/',
|
|
152
|
+
'/fixture/',
|
|
124
153
|
],
|
|
125
154
|
/**
|
|
126
155
|
* https://github.com/facebook/jest/issues/9771#issuecomment-872764344
|
|
127
156
|
*/
|
|
128
157
|
//resolver: 'jest-node-exports-resolver',
|
|
129
158
|
}
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
try
|
|
162
|
+
{
|
|
163
|
+
if (!jestConfig.preset)
|
|
164
|
+
{
|
|
165
|
+
let result = require('@yarn-tool/ws-find-up-paths').findUpPathsWorkspaces('jest.config.js', {
|
|
166
|
+
ignoreCurrentPackage: true,
|
|
167
|
+
onlyFiles: true,
|
|
168
|
+
}).result;
|
|
169
|
+
if (result)
|
|
170
|
+
{
|
|
171
|
+
jestConfig.preset = result;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (e)
|
|
176
|
+
{
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
*/
|
|
180
|
+
|
|
181
|
+
try
|
|
182
|
+
{
|
|
183
|
+
if (!jestConfig.preset)
|
|
184
|
+
{
|
|
185
|
+
let result = _requireResolve('@bluelovers/jest-config/package.json');
|
|
186
|
+
if (result)
|
|
187
|
+
{
|
|
188
|
+
jestConfig.preset = dirname(result);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (e)
|
|
193
|
+
{
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
console.info(`jest.config`);
|
|
198
|
+
console.info(`- file: ${__filename}`);
|
|
199
|
+
console.info(`- cwd: ${process.cwd()}`);
|
|
200
|
+
console.info(`- cacheDirectory: ${cacheDirectory}`);
|
|
201
|
+
console.info(`- preset: ${jestConfig.preset}`);
|
|
202
|
+
|
|
203
|
+
module.exports = jestConfig
|
package/file/npmignore
CHANGED
|
@@ -35,12 +35,18 @@ node_modules
|
|
|
35
35
|
/bin/**/*.d.cts
|
|
36
36
|
/bin/*.d.cts
|
|
37
37
|
|
|
38
|
+
!./src/**/*.ts
|
|
39
|
+
!./src/**/*.cts
|
|
40
|
+
!./src/**/*.mts
|
|
41
|
+
!./src/**/*.tsx
|
|
42
|
+
|
|
38
43
|
/src/**/*.d.ts
|
|
39
44
|
/src/**/*.js
|
|
40
45
|
/src/**/*.d.cts
|
|
41
46
|
/src/**/*.d.mts
|
|
42
47
|
/src/**/*.cjs
|
|
43
48
|
/src/**/*.mjs
|
|
49
|
+
/src/**/*.jsx
|
|
44
50
|
|
|
45
51
|
*.tgz
|
|
46
52
|
/tsconfig.json.tpl
|
|
@@ -99,7 +105,9 @@ now.json
|
|
|
99
105
|
*.spec.mjs
|
|
100
106
|
*.spec.mts
|
|
101
107
|
|
|
108
|
+
*.spec.d.tsx
|
|
102
109
|
*.spec.tsx
|
|
110
|
+
|
|
103
111
|
__mocks__
|
|
104
112
|
__tests__
|
|
105
113
|
__snapshots__
|
|
@@ -125,3 +133,5 @@ changelog-option.js
|
|
|
125
133
|
|
|
126
134
|
bin/tsconfig.json
|
|
127
135
|
bin/tsconfig.*.json
|
|
136
|
+
|
|
137
|
+
.yarnrc.yml
|
package/file/test/__root.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const __ROOT: string;
|
|
2
2
|
export declare const isWin: boolean;
|
package/file/test/__root.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWin = exports.
|
|
3
|
+
exports.isWin = exports.__ROOT = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
exports.
|
|
5
|
+
exports.__ROOT = (0, path_1.join)(__dirname, '..');
|
|
6
6
|
exports.isWin = process.platform === "win32";
|
|
7
7
|
//# sourceMappingURL=__root.js.map
|
package/file/test/__root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__root.js","sourceRoot":"","sources":["__root.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAEf,QAAA,MAAM,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE/B,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC","sourcesContent":["import { join } from \"path\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"__root.js","sourceRoot":"","sources":["__root.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAEf,QAAA,MAAM,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE/B,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC","sourcesContent":["import { join } from \"path\";\n\nexport const __ROOT = join(__dirname, '..');\n\nexport const isWin = process.platform === \"win32\";\n"]}
|
package/file/test/__root.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const __ROOT_WS: string;
|
|
2
2
|
export declare const isWin: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWin = exports.
|
|
3
|
+
exports.isWin = exports.__ROOT_WS = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
exports.
|
|
5
|
+
exports.__ROOT_WS = (0, path_1.join)(__dirname);
|
|
6
6
|
exports.isWin = process.platform === "win32";
|
|
7
7
|
//# sourceMappingURL=__root_ws.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__root_ws.js","sourceRoot":"","sources":["__root_ws.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAEf,QAAA,SAAS,GAAG,IAAA,WAAI,EAAC,SAAS,CAAC,CAAC;AAE5B,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC","sourcesContent":["import { join } from \"path\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"__root_ws.js","sourceRoot":"","sources":["__root_ws.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAEf,QAAA,SAAS,GAAG,IAAA,WAAI,EAAC,SAAS,CAAC,CAAC;AAE5B,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC","sourcesContent":["import { join } from \"path\";\n\nexport const __ROOT_WS = join(__dirname);\n\nexport const isWin = process.platform === \"win32\";\n"]}
|
package/lib/const.js
CHANGED
|
@@ -15,7 +15,8 @@ const _defaultCopyStaticFiles = [
|
|
|
15
15
|
['README.md', 'file/README.md'],
|
|
16
16
|
['.nycrc', 'file/nycrc'],
|
|
17
17
|
['.mocharc.yml', 'file/mocharc.yml'],
|
|
18
|
-
['jest.config.js', 'file/jest.config.js'],
|
|
18
|
+
//['jest.config.js', 'file/jest.config.js'],
|
|
19
|
+
['jest.config.js', 'file/jest.config.auto.js'],
|
|
19
20
|
['.nowignore', 'file/nowignore'],
|
|
20
21
|
['now.json.tpl', 'file/now.json.tpl', 'now.json'],
|
|
21
22
|
['.npmrc.tpl', 'file/npmrc', '.npmrc'],
|
|
@@ -31,10 +32,15 @@ const _defaultCopyStaticFilesRootOnly = [
|
|
|
31
32
|
['.github/workflows/coverage.yml', 'file/github/workflows/coverage.yml'],
|
|
32
33
|
['.github/workflows/action-yarnlock-dedupe.yml', 'file/github/workflows/action-yarnlock-dedupe.yml'],
|
|
33
34
|
['.github/workflows/build.yml', 'file/github/workflows/build.yml'],
|
|
35
|
+
['.github/workflows/yarn-lock-changes.yml', 'file/github/workflows/yarn-lock-changes.yml'],
|
|
36
|
+
['.github/commit-convention.md', 'file/github/commit-convention.md'],
|
|
34
37
|
['tsconfig.json', 'file/tsconfig.json.tpl', 'tsconfig.json'],
|
|
35
38
|
['.eslintrc.json', 'file/eslintrc.json.tpl', '.eslintrc.json'],
|
|
36
39
|
//['changelog-option.js', 'file/changelog-option.js', 'changelog-option.js.tpl'],
|
|
37
40
|
['.yarnrc.yml.tpl', 'file/root/yarnrc.yml', '.yarnrc.yml'],
|
|
41
|
+
['jest.config.js', 'file/jest.config.js'],
|
|
42
|
+
['jest.config.js.tpl', 'file/jest.config.js'],
|
|
43
|
+
['jest.config.auto.js.tpl', 'file/jest.config.auto.js'],
|
|
38
44
|
];
|
|
39
45
|
const _defaultCopyStaticFilesWsRootOnly = [
|
|
40
46
|
['lerna.json.tpl', 'file/lerna.json.tpl'],
|
|
@@ -42,6 +48,8 @@ const _defaultCopyStaticFilesWsRootOnly = [
|
|
|
42
48
|
['tsconfig.json', 'file/tsconfig.json.tpl'],
|
|
43
49
|
['tsc-multi.json.tpl', 'file/tsc-multi.json.tpl', 'tsc-multi.json'],
|
|
44
50
|
['__root_ws.ts', 'file/ws-root/__root_ws.ts'],
|
|
51
|
+
['jest.config.js', 'file/ws-root/jest.config.js'],
|
|
52
|
+
['jest-preset.js', 'file/ws-root/jest-preset.js'],
|
|
45
53
|
];
|
|
46
54
|
exports.defaultCopyStaticFiles = Object.freeze(_defaultCopyStaticFiles);
|
|
47
55
|
exports.defaultCopyStaticFilesRootOnly = Object.freeze(_defaultCopyStaticFilesRootOnly);
|
package/lib/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["const.ts"],"names":[],"mappings":";;;AAEA,MAAM,uBAAuB,GAAG;IAE/B,CAAC,YAAY,EAAE,gBAAgB,CAAC;IAChC,CAAC,YAAY,EAAE,gBAAgB,CAAC;IAEhC,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAEtC,CAAC,QAAQ,EAAE,YAAY,CAAC;IACxB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;IAE1C,CAAC,mBAAmB,EAAE,wBAAwB,EAAE,eAAe,CAAC;IAEhE,CAAC,wBAAwB,EAAE,6BAA6B,EAAE,oBAAoB,CAAC;IAE/E,CAAC,uBAAuB,EAAE,4BAA4B,EAAE,mBAAmB,CAAC;IAE5E,CAAC,wBAAwB,EAAE,6BAA6B,EAAE,oBAAoB,CAAC;IAE/E,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,gBAAgB,CAAC;IAElE,CAAC,WAAW,EAAE,gBAAgB,CAAC;IAE/B,CAAC,QAAQ,EAAE,YAAY,CAAC;IAExB,CAAC,cAAc,EAAE,kBAAkB,CAAC;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\t['.gitignore', 'file/gitignore'],\n\n\t['.eslintignore', 'file/eslintignore'],\n\n\t['.nvmrc', 'file/nvmrc'],\n\t['.browserslistrc', 'file/browserslistrc'],\n\n\t['tsconfig.json.tpl', 'file/tsconfig.json.tpl', 'tsconfig.json'],\n\n\t['test/tsconfig.json.tpl', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],\n\n\t['tsconfig.esm.json.tpl', 'file/tsconfig.esm.json.tpl', 'tsconfig.esm.json'],\n\n\t['tsconfig.tsdx.json.tpl', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.tsdx.json'],\n\n\t['.eslintrc.json.tpl', 'file/eslintrc.json.tpl', '.eslintrc.json'],\n\n\t['README.md', 'file/README.md'],\n\n\t['.nycrc', 'file/nycrc'],\n\n\t['.mocharc.yml', 'file/mocharc.yml'],\n\t//['jest.config.js', 'file/jest.config.js'],\n\t['jest.config.js', 'file/jest.config.auto.js'],\n\n\t['.nowignore', 'file/nowignore'],\n\n\t['now.json.tpl', 'file/now.json.tpl', 'now.json'],\n\n\t['.npmrc.tpl', 'file/npmrc', '.npmrc'],\n\n\t['tsdx.config.js.tpl', 'file/tsdx.config.js', 'tsdx.config.js'],\n\n\t['tsc-multi.json.tpl', 'file/tsc-multi.json.tpl', 'tsc-multi.json'],\n\n\t['test/__root.ts', 'file/test/__root.ts'],\n\n\t['.editorconfig.tpl', 'file/tpl.editorconfig'],\n\n\t//['changelog-option.js.tpl', 'file/changelog-option.js', 'changelog-option.js'],\n\n] as const;\n\nconst _defaultCopyStaticFilesRootOnly = [\n\n\t['lerna.json.tpl', 'file/lerna.json.tpl', 'lerna.json'],\n\n\t['pnpm-workspace.yaml.tpl', 'file/pnpm-workspace.yaml', 'pnpm-workspace.yaml'],\n\n\t['.github/workflows/coverage.yml', 'file/github/workflows/coverage.yml'],\n\n\t['.github/workflows/action-yarnlock-dedupe.yml', 'file/github/workflows/action-yarnlock-dedupe.yml'],\n\n\t['.github/workflows/build.yml', 'file/github/workflows/build.yml'],\n\n\t['.github/workflows/yarn-lock-changes.yml', 'file/github/workflows/yarn-lock-changes.yml'],\n\n\t['.github/commit-convention.md', 'file/github/commit-convention.md'],\n\n\t['tsconfig.json', 'file/tsconfig.json.tpl', 'tsconfig.json'],\n\n\t['.eslintrc.json', 'file/eslintrc.json.tpl', '.eslintrc.json'],\n\n\t//['changelog-option.js', 'file/changelog-option.js', 'changelog-option.js.tpl'],\n\n\t['.yarnrc.yml.tpl', 'file/root/yarnrc.yml', '.yarnrc.yml'],\n\n\t['jest.config.js', 'file/jest.config.js'],\n\n\t['jest.config.js.tpl', 'file/jest.config.js'],\n\t['jest.config.auto.js.tpl', 'file/jest.config.auto.js'],\n\n] as const;\n\nconst _defaultCopyStaticFilesWsRootOnly = [\n\n\t['lerna.json.tpl', 'file/lerna.json.tpl'],\n\n\t['pnpm-workspace.yaml', 'file/pnpm-workspace.yaml'],\n\n\t['tsconfig.json', 'file/tsconfig.json.tpl'],\n\n\t['tsc-multi.json.tpl', 'file/tsc-multi.json.tpl', 'tsc-multi.json'],\n\n\t['__root_ws.ts', 'file/ws-root/__root_ws.ts'],\n\n\t['jest.config.js', 'file/ws-root/jest.config.js'],\n\t['jest-preset.js', 'file/ws-root/jest-preset.js'],\n\n] as const;\n\nexport const defaultCopyStaticFiles = Object.freeze(_defaultCopyStaticFiles) as any as IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFiles>>;\n\nexport const defaultCopyStaticFilesRootOnly = Object.freeze(_defaultCopyStaticFilesRootOnly) as any as IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesRootOnly>>;\n\nexport const defaultCopyStaticFilesWsRootOnly = Object.freeze(_defaultCopyStaticFilesWsRootOnly) as any as IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesWsRootOnly>>;\n"]}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { defaultCopyStaticFiles, defaultCopyStaticFilesRootOnly } from './const';
|
|
2
|
-
export
|
|
2
|
+
export type IStaticFilesID<T = typeof defaultCopyStaticFiles & typeof defaultCopyStaticFilesRootOnly> = T extends ({
|
|
3
3
|
[n: number]: IStaticFilesMapArrayEntry<infer U>;
|
|
4
4
|
} | {
|
|
5
5
|
readonly [n: number]: IStaticFilesMapArrayEntry<infer U>;
|
|
6
6
|
}) ? U : never;
|
|
7
|
-
export
|
|
7
|
+
export type IStaticFilesMapArrayEntry<K extends string> = [
|
|
8
8
|
targetFile: K,
|
|
9
9
|
staticFile: string,
|
|
10
10
|
detectFile?: string
|
|
11
11
|
];
|
|
12
|
-
export
|
|
12
|
+
export type IStaticFilesMapRecord<K extends string> = {
|
|
13
13
|
[P in K]: string;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type IStaticFilesMapArray<K extends string> = IStaticFilesMapArrayEntry<K>[];
|
|
16
|
+
export type IStaticFiles<K extends string> = IStaticFilesMapArray<K> | IStaticFilesMapRecord<K>;
|
|
17
17
|
export interface ICopyStaticFilesOptionsBase<K extends string = string> {
|
|
18
18
|
cwd: string;
|
|
19
19
|
staticRoot?: string;
|
|
@@ -22,5 +22,5 @@ export interface ICopyStaticFilesOptionsBase<K extends string = string> {
|
|
|
22
22
|
export interface ICopyStaticFilesOptions<K extends string = string> extends ICopyStaticFilesOptionsBase<K> {
|
|
23
23
|
file_map?: IStaticFiles<K>;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type IStaticFilesKey<T extends IStaticFiles<string> | readonly any[]> = T extends IStaticFilesMapArray<infer K> ? K : T extends readonly IStaticFilesMapArrayEntry<infer K>[] ? K : T extends IStaticFilesMapRecord<infer K> ? K : _Key<T>;
|
|
26
|
+
export type _Key<T> = T extends readonly (infer U)[] | (infer U)[] ? (U extends [infer K, string, string] | readonly [infer K, string, string] ? K : never) : never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/static-file",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/static-file#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "e34c95f09bf1ad26e3a721028a28f6b8bfb44510"
|
|
35
35
|
}
|