@yarn-tool/static-file 3.0.21 → 3.0.23

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,16 @@
1
+
2
+
3
+ /**
4
+ * @deprecated change this file to match your project structure
5
+ */
6
+ const _ = {};
7
+
8
+ // @ts-ignore
9
+ if (process.env.TSDX_FORMAT !== 'esm')
10
+ {
11
+ Object.defineProperty(_, "__esModule", { value: true });
12
+
13
+ Object.defineProperty(_, "default", { value: _ });
14
+ }
15
+
16
+ export default _
@@ -0,0 +1,19 @@
1
+ import { _Key, IStaticFilesMapArray } from "./types";
2
+ /**
3
+ * 預設的靜態檔案複製映射表
4
+ * Default static file copy mapping table
5
+ *
6
+ * 定義需要複製到目標專案的靜態檔案,每個項目為 [目標路徑, 來源路徑, ?來源檔名] 的格式。
7
+ * Defines static files that need to be copied to the target project,
8
+ * each entry follows [targetPath, sourcePath, ?sourceFileName] format.
9
+ */
10
+ declare const _defaultCopyStaticFilesTsdx: [["tsconfig.json", "file/tsconfig.tsdx.json.tpl"], ["test/tsconfig.json", "file/test/tsconfig.json.tpl"], ["src/index.ts.tpl", "file/tsdx/index.ts", "src/index.cts"], ["src/index.cts", "file/tsdx/index.cts"], ["src/tsconfig.json", "file/tsdx/tsconfig.json.tpl"]];
11
+ /**
12
+ * 凍結的預設靜態檔案映射表
13
+ * Frozen default static file mapping table
14
+ *
15
+ * 凍結是為了避免執行期意外改動全域預設值,影響其他套件的設定流程
16
+ * Frozen to prevent accidental mutation of the global default, which would affect setup runs in other packages
17
+ */
18
+ export declare const defaultCopyStaticFilesTsdx: IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesTsdx>>;
19
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultCopyStaticFilesTsdx = void 0;
4
+ /**
5
+ * 預設的靜態檔案複製映射表
6
+ * Default static file copy mapping table
7
+ *
8
+ * 定義需要複製到目標專案的靜態檔案,每個項目為 [目標路徑, 來源路徑, ?來源檔名] 的格式。
9
+ * Defines static files that need to be copied to the target project,
10
+ * each entry follows [targetPath, sourcePath, ?sourceFileName] format.
11
+ */
12
+ const _defaultCopyStaticFilesTsdx = [
13
+ /**
14
+ * 根目錄的 tsconfig.json 設定檔
15
+ * Root tsconfig.json configuration file
16
+ */
17
+ ['tsconfig.json', 'file/tsconfig.tsdx.json.tpl'],
18
+ /**
19
+ * 測試目錄的 tsconfig.json 設定檔
20
+ * Test directory tsconfig.json configuration file
21
+ */
22
+ ['test/tsconfig.json', 'file/test/tsconfig.json.tpl'],
23
+ ['src/index.ts.tpl', 'file/tsdx/index.ts', 'src/index.cts'],
24
+ /**
25
+ * src 目錄下的 index.cts 檔案
26
+ * index.cts file under src directory
27
+ */
28
+ ['src/index.cts', 'file/tsdx/index.cts'],
29
+ /**
30
+ * src 目錄的 tsconfig.json 設定檔
31
+ * src directory tsconfig.json configuration file
32
+ */
33
+ ['src/tsconfig.json', 'file/tsdx/tsconfig.json.tpl'],
34
+ ];
35
+ /**
36
+ * 凍結的預設靜態檔案映射表
37
+ * Frozen default static file mapping table
38
+ *
39
+ * 凍結是為了避免執行期意外改動全域預設值,影響其他套件的設定流程
40
+ * Frozen to prevent accidental mutation of the global default, which would affect setup runs in other packages
41
+ */
42
+ exports.defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx);
43
+ //# sourceMappingURL=const-tsdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const-tsdx.js","sourceRoot":"","sources":["const-tsdx.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,MAAM,2BAA2B,GAAG;IAEnC;;;OAGG;IACH,CAAC,eAAe,EAAE,6BAA6B,CAAC;IAEhD;;;OAGG;IACH,CAAC,oBAAoB,EAAE,6BAA6B,CAAC;IAErD,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,CAAC;IAE3D;;;OAGG;IACH,CAAC,eAAe,EAAE,qBAAqB,CAAC;IAGxC;;;OAGG;IACH,CAAC,mBAAmB,EAAE,6BAA6B,CAAC;CAEJ,CAAC;AAElD;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAA0E,CAAC","sourcesContent":["import { _Key, IStaticFilesMapArray } from \"./types\";\n\n/**\n * 預設的靜態檔案複製映射表\n * Default static file copy mapping table\n *\n * 定義需要複製到目標專案的靜態檔案,每個項目為 [目標路徑, 來源路徑, ?來源檔名] 的格式。\n * Defines static files that need to be copied to the target project,\n * each entry follows [targetPath, sourcePath, ?sourceFileName] format.\n */\nconst _defaultCopyStaticFilesTsdx = [\n\n\t/**\n\t * 根目錄的 tsconfig.json 設定檔\n\t * Root tsconfig.json configuration file\n\t */\n\t['tsconfig.json', 'file/tsconfig.tsdx.json.tpl'],\n\n\t/**\n\t * 測試目錄的 tsconfig.json 設定檔\n\t * Test directory tsconfig.json configuration file\n\t */\n\t['test/tsconfig.json', 'file/test/tsconfig.json.tpl'],\n\n\t['src/index.ts.tpl', 'file/tsdx/index.ts', 'src/index.cts'],\n\n\t/**\n\t * src 目錄下的 index.cts 檔案\n\t * index.cts file under src directory\n\t */\n\t['src/index.cts', 'file/tsdx/index.cts'],\n\n\n\t/**\n\t * src 目錄的 tsconfig.json 設定檔\n\t * src directory tsconfig.json configuration file\n\t */\n\t['src/tsconfig.json', 'file/tsdx/tsconfig.json.tpl'],\n\n] as const satisfies IStaticFilesMapArray<string>;\n\n/**\n * 凍結的預設靜態檔案映射表\n * Frozen default static file mapping table\n *\n * 凍結是為了避免執行期意外改動全域預設值,影響其他套件的設定流程\n * Frozen to prevent accidental mutation of the global default, which would affect setup runs in other packages\n */\nexport const defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx) as any as IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesTsdx>>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/static-file",
3
- "version": "3.0.21",
3
+ "version": "3.0.23",
4
4
  "description": "用於將靜態設定檔案 (static configuration files) 複製到 yarn 工作區專案的工具 / A utility for copying static configuration files to yarn workspace projects",
5
5
  "keywords": [
6
6
  "static-file",
@@ -41,18 +41,21 @@
41
41
  "npm:publish": "npm publish",
42
42
  "preversion": "pnpm run test",
43
43
  "prepublishOnly": "node --run fix:ignore",
44
- "fix:ignore": "tsx test/scripts/update-npmignore-static-files.ts",
44
+ "fix:ignore": "node --run fix:ignore:build && node --run fix:ignore:copy && node --run fix:ignore:merge",
45
+ "fix:ignore:build": "tsx test/scripts/compose-split-ignore-files.ts",
46
+ "fix:ignore:copy": "copy test\\fixtures\\out\\gitignore file\\gitignore && copy test\\fixtures\\out\\npmignore file\\npmignore && echo ignore file copyed",
47
+ "fix:ignore:merge": "tsx test/scripts/update-npmignore-static-files.ts",
45
48
  "ncu": "yarn-tool ncu -u",
46
49
  "sort-package-json": "yarn-tool sort",
47
50
  "tsc:showConfig": "ynpx get-current-tsconfig -p"
48
51
  },
49
52
  "dependencies": {
50
- "@yarn-tool/ignore": "^1.0.2",
53
+ "@yarn-tool/ignore": "^1.0.3",
51
54
  "fs-extra": "^11.4.1",
52
55
  "tslib": ">=2.8.1"
53
56
  },
54
57
  "publishConfig": {
55
58
  "access": "public"
56
59
  },
57
- "gitHead": "cf2f309300d7e01680c5b8bd91114fe16dbadb24"
60
+ "gitHead": "298e125907abc4dc8c8187e82636ccd8e9c10aaa"
58
61
  }
@@ -0,0 +1,280 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ node_modules
5
+ /.pnp
6
+ .pnp.js
7
+
8
+ # testing
9
+ /coverage
10
+
11
+ # next.js
12
+ /.next/
13
+ /out/
14
+
15
+ # production
16
+ /build
17
+
18
+ # misc
19
+ .DS_Store
20
+ *.pem
21
+
22
+ # debug
23
+ npm-debug.log*
24
+ yarn-debug.log*
25
+ yarn-error.log*
26
+
27
+ # local env files
28
+ .env.local
29
+ .env.development.local
30
+ .env.test.local
31
+ .env.production.local
32
+
33
+ # vercel
34
+ .vercel
35
+
36
+ /.*/
37
+ .idea
38
+ node_modules
39
+ ~ci.list.txt
40
+ ~ci.log.txt
41
+ ~ci.errors.txt
42
+ *.stackdump
43
+ *.bak
44
+ *.old
45
+ package-lock.json
46
+ test/**/*.js
47
+ test/**/*.d.ts
48
+ test/*.js
49
+ test/*.d.ts
50
+ test/temp*
51
+ test/**/*.map
52
+ tests/**/*.js
53
+ tests/**/*.d.ts
54
+ tests/*.js
55
+ tests/*.d.ts
56
+ tests/temp*
57
+ tests/**/*.map
58
+ bin/*.d.ts
59
+ bin/**/*.d.ts
60
+ /packages/*/bin/*.d.ts
61
+ /packages/*/test/**/*.js
62
+ /packages/*/test/**/*.d.ts
63
+ /packages/*/test/*.js
64
+ /packages/*/test/*.d.ts
65
+ /packages/*/test/temp*
66
+ /packages/*/tests/**/*.js
67
+ /packages/*/tests/**/*.d.ts
68
+ /packages/*/tests/*.js
69
+ /packages/*/tests/*.d.ts
70
+ /packages/*/tests/temp*
71
+
72
+ test/**/*.mjs
73
+ test/**/*.d.mts
74
+ test/*.mjs
75
+ test/*.d.mts
76
+ test/temp*
77
+ test/**/*.map
78
+ tests/**/*.mjs
79
+ tests/**/*.d.mts
80
+ tests/*.mjs
81
+ tests/*.d.mts
82
+ tests/temp*
83
+ tests/**/*.map
84
+ bin/*.d.mts
85
+ bin/**/*.d.mts
86
+ /packages/*/bin/*.d.mts
87
+ /packages/*/test/**/*.mjs
88
+ /packages/*/test/**/*.d.mts
89
+ /packages/*/test/*.mjs
90
+ /packages/*/test/*.d.mts
91
+ /packages/*/test/temp*
92
+ /packages/*/tests/**/*.mjs
93
+ /packages/*/tests/**/*.d.mts
94
+ /packages/*/tests/*.mjs
95
+ /packages/*/tests/*.d.mts
96
+ /packages/*/tests/temp*
97
+
98
+ test/**/*.cjs
99
+ test/**/*.d.cts
100
+ test/*.cjs
101
+ test/*.d.cts
102
+ test/temp*
103
+ test/**/*.map
104
+ tests/**/*.cjs
105
+ tests/**/*.d.cts
106
+ tests/*.cjs
107
+ tests/*.d.cts
108
+ tests/temp*
109
+ tests/**/*.map
110
+ bin/*.d.cts
111
+ bin/**/*.d.cts
112
+ /packages/*/bin/*.d.cts
113
+ /packages/*/test/**/*.cjs
114
+ /packages/*/test/**/*.d.cts
115
+ /packages/*/test/*.cjs
116
+ /packages/*/test/*.d.cts
117
+ /packages/*/test/temp*
118
+ /packages/*/tests/**/*.cjs
119
+ /packages/*/tests/**/*.d.cts
120
+ /packages/*/tests/*.cjs
121
+ /packages/*/tests/*.d.cts
122
+ /packages/*/tests/temp*
123
+
124
+ /src/**/*.d.ts
125
+ /src/**/*.js
126
+ /src/**/*.d.cts
127
+ /src/**/*.d.mts
128
+ /src/**/*.cjs
129
+ /src/**/*.mjs
130
+
131
+ **/node_modules
132
+ *.tgz
133
+ /tsconfig.json.tpl
134
+ /.eslintrc.json.tpl
135
+ !test/tsconfig.json
136
+ !tsconfig.json
137
+ !.eslintrc.json
138
+ yarn-error.log
139
+ *.log
140
+ .git
141
+ yarn.lock
142
+ .env.local
143
+ .env.*.local
144
+ npm-debug.log*
145
+ yarn-debug.log*
146
+ yarn-error.log*
147
+ .vscode
148
+ *.suo
149
+ *.ntvs*
150
+ *.njsproj
151
+ *.sln
152
+ *.sw?
153
+ *.vue.js
154
+ *.vue.d.ts
155
+ *.vue.js.map
156
+ vue.config.d.ts
157
+ vue.config.js.map
158
+ .nyc_output
159
+ coverage
160
+ /*.tpl
161
+ !.forestry
162
+ !.vuepress
163
+ !.github
164
+ !.gitee
165
+ !.gitlab
166
+ .git
167
+
168
+ *.tsbuildinfo
169
+ tsconfig.esm.json.tpl
170
+
171
+ .browserslistrc
172
+
173
+ .nvmrc
174
+ .node-version
175
+ !/.nvmrc
176
+ !/.node-version
177
+
178
+ /.eslintignore
179
+ /package.d.ts
180
+ .nycrc
181
+ .mocharc.yml
182
+ #jest.config.js
183
+ node_modules/.cache
184
+ .yarn-integrity
185
+ jest.config.d.ts
186
+ jest.config.js.map
187
+ /report.*.json
188
+ *.js.map
189
+ *.cjs.map
190
+ *.mjs.map
191
+ *.ts.map
192
+ *.cts.map
193
+ *.mts.map
194
+ /now.json
195
+ .nyc_output
196
+ .coverage-cache
197
+ .reify-cache
198
+ *.spec.d.ts
199
+ *.spec.js
200
+ .nowignore
201
+ */**/.github
202
+ !/.github
203
+ !npm-shrinkwrap.json
204
+ *.stat
205
+ .vercel
206
+ /test/*.tpl
207
+ /*.tpl
208
+ /report.json
209
+
210
+ .opt-in
211
+ .opt-out
212
+ /gradle
213
+ .gradle
214
+ /out
215
+ /build
216
+
217
+ /_*/
218
+ _snowpack
219
+ web_modules
220
+ tsc-multi.json.tpl
221
+
222
+ dist/*.umd.*.*s
223
+
224
+ /__root_ws.d.ts
225
+ /__root_ws.js
226
+
227
+ !/.yarnrc.yml
228
+ .turbo
229
+
230
+ !/.run/
231
+ !/.storybook/
232
+
233
+ test/fixtures/.gitkeep
234
+
235
+ !.clinerules
236
+ !.kilocode
237
+ !.cline
238
+ !.junie
239
+ !.gemini
240
+ !.copilot
241
+ !.claude
242
+ !.agents
243
+ !.aiassistant
244
+
245
+ .nx
246
+
247
+ !/api-extractor*.json
248
+
249
+ !__mocks__
250
+ !__mocks__/
251
+ !__mocks__/*
252
+
253
+ out/
254
+
255
+ .codenomad
256
+ .logs
257
+
258
+ !test/__root-core.cjs
259
+ !test/__root-core.d.ts
260
+ !test/__root-core.mts
261
+
262
+ !test/__root-core.d.cts
263
+ !test/__root-core.d.mts
264
+ !test/__root-core.mjs
265
+
266
+ /certificates
267
+
268
+ .next
269
+
270
+ test/temp*/
271
+
272
+ !__root-core.cjs
273
+ !__root-core.mjs
274
+ !__root-core.d.cts
275
+ !__root-core.d.mts
276
+ !__root-core.d.ts
277
+ !__root-core.ts
278
+
279
+ .agentbridge
280
+ node_modules_
@@ -0,0 +1,211 @@
1
+ /.pnp
2
+ .pnp.js
3
+ .idea
4
+ ~ci.list.txt
5
+ ~ci.log.txt
6
+ ~ci.errors.txt
7
+ *.stackdump
8
+ *.bak
9
+ *.old
10
+ *.log
11
+ tsconfig.json
12
+ package-lock.json
13
+ test
14
+ .github
15
+ .gitkeep
16
+ /.*/
17
+ /.*
18
+ tests
19
+ /~*
20
+ __test__
21
+ __tests__
22
+ node_modules
23
+ /node_modules/
24
+ **/node_modules/
25
+ *.ts
26
+ !*.d.ts
27
+ /bin/**/*.d.ts
28
+ /bin/*.d.ts
29
+
30
+ !*.d.mts
31
+ /bin/**/*.d.mts
32
+ /bin/*.d.mts
33
+
34
+ !*.d.cts
35
+ /bin/**/*.d.cts
36
+ /bin/*.d.cts
37
+
38
+ !/src/**/*.ts
39
+ !/src/**/*.cts
40
+ !/src/**/*.mts
41
+ !/src/**/*.tsx
42
+
43
+ /src/**/*.d.ts
44
+ /src/**/*.js
45
+ /src/**/*.d.cts
46
+ /src/**/*.d.mts
47
+ /src/**/*.cjs
48
+ /src/**/*.mjs
49
+ /src/**/*.jsx
50
+
51
+ *.tgz
52
+ /tsconfig.json.tpl
53
+ yarn-error.log
54
+ .git
55
+ yarn.lock
56
+ .env.local
57
+ .env.*.local
58
+ npm-debug.log*
59
+ yarn-debug.log*
60
+ yarn-error.log*
61
+ .vscode
62
+ *.suo
63
+ *.ntvs*
64
+ *.njsproj
65
+ *.sln
66
+ *.sw?
67
+ *.vue.js
68
+ *.vue.d.ts
69
+ *.vue.js.map
70
+ .nyc_output
71
+ coverage
72
+ /*.tpl
73
+ webpack.config.js
74
+ vue.config.js
75
+ /jestconfig.json
76
+ /tslint.json
77
+ .git
78
+ webpack.*.config.js
79
+ webpack.*.config.d.ts
80
+ webpack.*.config.js.map
81
+ webpack.*.config.ts
82
+ karma.conf.js
83
+ /_config.yml
84
+ intellij-style-guide.xml
85
+ jest.config.js
86
+ *.tsbuildinfo
87
+ tsconfig.*.json
88
+ tsconfig.esm.json.tpl
89
+ /package.d.ts
90
+ .mocharc.yml
91
+ jest.config.js
92
+ jest.config.*
93
+ /jest-preset.*
94
+ /report.*.json
95
+ now.json
96
+ /Makefile
97
+ *.spec.d.ts
98
+ *.spec.js
99
+ *.spec.ts
100
+
101
+ *.spec.d.cts
102
+ *.spec.cjs
103
+ *.spec.cts
104
+
105
+ *.spec.d.mts
106
+ *.spec.mjs
107
+ *.spec.mts
108
+
109
+ *.spec.d.tsx
110
+ *.spec.tsx
111
+
112
+ *.test.d.ts
113
+ *.test.js
114
+ *.test.ts
115
+
116
+ *.test.d.cts
117
+ *.test.cjs
118
+ *.test.cts
119
+
120
+ *.test.d.mts
121
+ *.test.mjs
122
+ *.test.mts
123
+
124
+ *.test.d.tsx
125
+ *.test.tsx
126
+
127
+ *.node-spec.d.ts
128
+ *.node-spec.js
129
+ *.node-spec.ts
130
+
131
+ *.node-spec.d.cts
132
+ *.node-spec.cjs
133
+ *.node-spec.cts
134
+
135
+ *.node-spec.d.mts
136
+ *.node-spec.mjs
137
+ *.node-spec.mts
138
+
139
+ *.node-spec.d.tsx
140
+ *.node-spec.tsx
141
+
142
+ *.node-test.d.ts
143
+ *.node-test.js
144
+ *.node-test.ts
145
+
146
+ *.node-test.d.cts
147
+ *.node-test.cjs
148
+ *.node-test.cts
149
+
150
+ *.node-test.d.mts
151
+ *.node-test.mjs
152
+ *.node-test.mts
153
+
154
+ *.node-test.d.tsx
155
+ *.node-test.tsx
156
+
157
+ __mocks__
158
+ __tests__
159
+ __snapshots__
160
+ *.snap
161
+ *.snapshot
162
+ npm-shrinkwrap.json
163
+ /example/
164
+ *.stat
165
+ .vercel
166
+ tsdx.config.js
167
+ /report.json
168
+
169
+ /_*/
170
+ _snowpack
171
+
172
+ /snowpack.config.js
173
+ web_modules
174
+ cz-adapter
175
+
176
+ tsc-multi.json.tpl
177
+ tsc-multi.json
178
+
179
+ changelog-option.js
180
+
181
+ bin/tsconfig.json
182
+ bin/tsconfig.*.json
183
+
184
+ .yarnrc.yml
185
+ .turbo
186
+ __file_snapshots__
187
+ __fixtures__
188
+ /fixture/
189
+
190
+ /global.tsdx.d.ts
191
+ /next-env.d.ts
192
+
193
+ *.stories.*
194
+ ./stories/
195
+ ./global.tsdx.d.ts
196
+ ./global.d.ts
197
+
198
+ /api-extractor*.json
199
+
200
+ __mocks__
201
+
202
+ .codenomad
203
+ .logs
204
+
205
+ openspec/
206
+ .next
207
+
208
+ /*.md
209
+ !/README.md
210
+ !/CHANGELOG.md
211
+
@@ -187,7 +187,6 @@ coverage
187
187
  .DS_Store
188
188
  .opt-in
189
189
  .opt-out
190
- .agentbridge
191
190
 
192
191
  # 未分類 / unclassified · 兩類共用 / shared
193
192
  ~ci.list.txt
@@ -199,6 +198,7 @@ coverage
199
198
  *.stat
200
199
  .codenomad
201
200
  .logs
201
+ .agentbridge
202
202
 
203
203
  # 白名單例外 / whitelist exceptions · git 專用 / git only
204
204
  !test/tsconfig.json
@@ -214,3 +214,4 @@ openspec/
214
214
  *.stat
215
215
  .codenomad
216
216
  .logs
217
+ .agentbridge
@@ -8,3 +8,4 @@
8
8
  *.stat
9
9
  .codenomad
10
10
  .logs
11
+ .agentbridge
@@ -16,6 +16,7 @@ const path = tslib_1.__importStar(require("path"));
16
16
  const IgnoreFile_1 = require("@yarn-tool/ignore/lib/IgnoreFile");
17
17
  const __root_1 = require("../__root");
18
18
  const const_1 = require("../../lib/const");
19
+ const const_tsdx_1 = require("../../lib/const-tsdx");
19
20
  /**
20
21
  * 生成區段的起始標記,用於識別並替換上一次產生的內容
21
22
  * Start marker of the generated section, used to locate and replace the previous run's output
@@ -47,6 +48,7 @@ function extractStaticFiles() {
47
48
  ...const_1.defaultCopyStaticFiles,
48
49
  ...const_1.defaultCopyStaticFilesRootOnly,
49
50
  ...const_1.defaultCopyStaticFilesWsRootOnly,
51
+ ...const_tsdx_1.defaultCopyStaticFilesTsdx,
50
52
  ];
51
53
  for (const entry of allArrays) {
52
54
  const staticFile = entry[1];
@@ -1 +1 @@
1
- {"version":3,"file":"update-npmignore-static-files.js","sourceRoot":"","sources":["update-npmignore-static-files.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,mDAA6B;AAC7B,iEAA8D;AAC9D,sCAAmC;AACnC,2CAIyB;AAEzB;;;GAGG;AACH,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,GAAG,kCAAkC,CAAC;AAElD;;;;;;;;GAQG;AACH,SAAS,kBAAkB;IAE1B,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC;;;;;OAKG;IACH,MAAM,SAAS,GAAG;QACjB,GAAG,8BAAsB;QACzB,GAAG,sCAA8B;QACjC,GAAG,wCAAgC;KACnC,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,SAAS,EAC7B,CAAC;QACA,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5B;;;WAGG;QACH,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EACrC,CAAC;YACA,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CAAC,QAAgB,EAAE,WAAqB;IAGhE;;;OAGG;IACH,MAAM,UAAU,GAAG,uBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC5C,QAAQ,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,C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const.ts\n * and add them as !<file> entries to .npmignore and .gitignore\n *\n * 腳本從 const.ts 提取 staticFile 值\n * 並將它們作為 !<file> 條目加入 .npmignore 和 .gitignore\n *\n * 讀取與保存皆透過 IgnoreFile(行陣列模型:支援陣列內容,EOF 換行自動還原)\n * Reading and saving both go through IgnoreFile (the line model: array content\n * is supported and the EOF newline is restored automatically)\n */\nimport * as path from 'path';\nimport { IgnoreFile } from '@yarn-tool/ignore/lib/IgnoreFile';\nimport { __ROOT } from '../__root';\nimport {\n\tdefaultCopyStaticFiles,\n\tdefaultCopyStaticFilesRootOnly,\n\tdefaultCopyStaticFilesWsRootOnly,\n} from '../../lib/const';\n\n/**\n * 生成區段的起始標記,用於識別並替換上一次產生的內容\n * Start marker of the generated section, used to locate and replace the previous run's output\n */\nconst HEADER = '# Static files from const.ts';\n\n/**\n * 生成區段的結束標記\n * End marker of the generated section\n */\nconst FOOTER = '# END Static files from const.ts';\n\n/**\n * 收集三份清單中所有不重複的 staticFile 來源路徑\n * Collect every unique staticFile source path across the three lists\n *\n * 以 includes 去重,確保 ignore 檔中同一來源只出現一次\n * Dedupe with includes so each source appears only once in the ignore file\n *\n * @returns 靜態樣板的來源路徑陣列 / Array of static template source paths\n */\nfunction extractStaticFiles(): string[]\n{\n\tconst staticFiles: string[] = [];\n\n\t/**\n\t * 三份清單的內容可能重疊(例如同一樣板被不同情境引用),\n\t * 合併後再統一去重\n\t * The three lists may overlap (e.g. one template referenced by different scenarios),\n\t * so merge first and dedupe afterwards\n\t */\n\tconst allArrays = [\n\t\t...defaultCopyStaticFiles,\n\t\t...defaultCopyStaticFilesRootOnly,\n\t\t...defaultCopyStaticFilesWsRootOnly,\n\t];\n\n\tfor (const entry of allArrays)\n\t{\n\t\tconst staticFile = entry[1];\n\n\t\t/**\n\t\t * 已存在則跳過,避免 ignore 檔重複列出\n\t\t * Skip when already collected to avoid duplicate entries in the ignore file\n\t\t */\n\t\tif (!staticFiles.includes(staticFile))\n\t\t{\n\t\t\tstaticFiles.push(staticFile);\n\t\t}\n\t}\n\n\treturn staticFiles;\n}\n\n/**\n * 重寫 ignore 檔中的生成區段\n * Rewrite the generated section of an ignore file\n *\n * 先移除舊的 `!file/` 條目與標記區段,再重新寫入,\n * 使腳本可重複執行(Idempotent)而不會不斷累加\n * Old `!file/` entries and the marked section are removed before rewriting,\n * so the script stays idempotent instead of appending forever\n *\n * @param filePath - .npmignore 或 .gitignore 的路徑 / Path to .npmignore or .gitignore\n * @param staticFiles - 要排除的靜態樣板路徑 / Static template paths to whitelist\n */\nfunction updateIgnoreFile(filePath: string, staticFiles: string[]): void\n{\n\n\t/**\n\t * 以 IgnoreFile 讀取:內容統一為行陣列,結尾空白行已由建構處理\n\t * Read via IgnoreFile: content is normalized into a line array, with the trailing blanks already handled at construction\n\t */\n\tconst ignoreFile = IgnoreFile.from(filePath, {\n\t\tendCount: true,\n\t});\n\n\tconst lines: string[] = [];\n\n\tlines.push('');\n\tlines.push(HEADER);\n\tlines.push(...staticFiles);\n\tlines.push(FOOTER);\n\tlines.push('');\n\n\tignoreFile.addList(lines, true);\n\n\tignoreFile.outputFile(filePath);\n}\n\n/**\n * 腳本進入點:擷取清單並更新 .npmignore 與 .gitignore\n * Script entry: extract the list and update .npmignore and .gitignore\n */\nfunction main(): void\n{\n\tconsole.log('Extracting static files from imported module...');\n\n\tconst staticFiles = extractStaticFiles();\n\n\tstaticFiles.push('test/fixtures/out/');\n\tstaticFiles.push('test/fixtures/split/');\n\tstaticFiles.push('test/fixtures/out/**');\n\tstaticFiles.push('test/fixtures/split/**');\n\n\tconsole.log(`Found ${staticFiles.length} static files:`);\n\n\tconst entries = staticFiles.sort().map(f => {\n\t\tconst entry = `!${f}`\n\t\tconsole.log(` ${entry}`)\n\t\treturn entry\n\t});\n\n\tconst npmIgnore = path.join(__ROOT, '.npmignore');\n\tconst gitIgnore = path.join(__ROOT, '.gitignore');\n\n\t/**\n\t * 兩個檔案採用同一套生成規則,先 npmignore 再 gitignore\n\t * Both files share the same generated rules, npmignore first then gitignore\n\t */\n\tupdateIgnoreFile(npmIgnore, entries);\n\tconsole.log(`\\nUpdated ${npmIgnore}`);\n\n\tupdateIgnoreFile(gitIgnore, entries);\n\tconsole.log(`Updated ${gitIgnore}`);\n}\n\nmain();\n"]}
1
+ {"version":3,"file":"update-npmignore-static-files.js","sourceRoot":"","sources":["update-npmignore-static-files.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,mDAA6B;AAC7B,iEAA8D;AAC9D,sCAAmC;AACnC,2CAIyB;AACzB,qDAAkE;AAElE;;;GAGG;AACH,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,GAAG,kCAAkC,CAAC;AAElD;;;;;;;;GAQG;AACH,SAAS,kBAAkB;IAE1B,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC;;;;;OAKG;IACH,MAAM,SAAS,GAAG;QACjB,GAAG,8BAAsB;QACzB,GAAG,sCAA8B;QACjC,GAAG,wCAAgC;QACnC,GAAG,uCAA0B;KAC7B,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,SAAS,EAC7B,CAAC;QACA,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5B;;;WAGG;QACH,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EACrC,CAAC;YACA,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CAAC,QAAgB,EAAE,WAAqB;IAGhE;;;OAGG;IACH,MAAM,UAAU,GAAG,uBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC5C,QAAQ,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;I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AAE,CAAC,CAAC;IAEtC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,IAAI,EAAE,CAAC","sourcesContent":["/**\n * Script to extract staticFile values from const.ts\n * and add them as !<file> entries to .npmignore and .gitignore\n *\n * 腳本從 const.ts 提取 staticFile 值\n * 並將它們作為 !<file> 條目加入 .npmignore 和 .gitignore\n *\n * 讀取與保存皆透過 IgnoreFile(行陣列模型:支援陣列內容,EOF 換行自動還原)\n * Reading and saving both go through IgnoreFile (the line model: array content\n * is supported and the EOF newline is restored automatically)\n */\nimport * as path from 'path';\nimport { IgnoreFile } from '@yarn-tool/ignore/lib/IgnoreFile';\nimport { __ROOT } from '../__root';\nimport {\n\tdefaultCopyStaticFiles,\n\tdefaultCopyStaticFilesRootOnly,\n\tdefaultCopyStaticFilesWsRootOnly,\n} from '../../lib/const';\nimport { defaultCopyStaticFilesTsdx } from '../../lib/const-tsdx';\n\n/**\n * 生成區段的起始標記,用於識別並替換上一次產生的內容\n * Start marker of the generated section, used to locate and replace the previous run's output\n */\nconst HEADER = '# Static files from const.ts';\n\n/**\n * 生成區段的結束標記\n * End marker of the generated section\n */\nconst FOOTER = '# END Static files from const.ts';\n\n/**\n * 收集三份清單中所有不重複的 staticFile 來源路徑\n * Collect every unique staticFile source path across the three lists\n *\n * 以 includes 去重,確保 ignore 檔中同一來源只出現一次\n * Dedupe with includes so each source appears only once in the ignore file\n *\n * @returns 靜態樣板的來源路徑陣列 / Array of static template source paths\n */\nfunction extractStaticFiles(): string[]\n{\n\tconst staticFiles: string[] = [];\n\n\t/**\n\t * 三份清單的內容可能重疊(例如同一樣板被不同情境引用),\n\t * 合併後再統一去重\n\t * The three lists may overlap (e.g. one template referenced by different scenarios),\n\t * so merge first and dedupe afterwards\n\t */\n\tconst allArrays = [\n\t\t...defaultCopyStaticFiles,\n\t\t...defaultCopyStaticFilesRootOnly,\n\t\t...defaultCopyStaticFilesWsRootOnly,\n\t\t...defaultCopyStaticFilesTsdx,\n\t];\n\n\tfor (const entry of allArrays)\n\t{\n\t\tconst staticFile = entry[1];\n\n\t\t/**\n\t\t * 已存在則跳過,避免 ignore 檔重複列出\n\t\t * Skip when already collected to avoid duplicate entries in the ignore file\n\t\t */\n\t\tif (!staticFiles.includes(staticFile))\n\t\t{\n\t\t\tstaticFiles.push(staticFile);\n\t\t}\n\t}\n\n\treturn staticFiles;\n}\n\n/**\n * 重寫 ignore 檔中的生成區段\n * Rewrite the generated section of an ignore file\n *\n * 先移除舊的 `!file/` 條目與標記區段,再重新寫入,\n * 使腳本可重複執行(Idempotent)而不會不斷累加\n * Old `!file/` entries and the marked section are removed before rewriting,\n * so the script stays idempotent instead of appending forever\n *\n * @param filePath - .npmignore 或 .gitignore 的路徑 / Path to .npmignore or .gitignore\n * @param staticFiles - 要排除的靜態樣板路徑 / Static template paths to whitelist\n */\nfunction updateIgnoreFile(filePath: string, staticFiles: string[]): void\n{\n\n\t/**\n\t * 以 IgnoreFile 讀取:內容統一為行陣列,結尾空白行已由建構處理\n\t * Read via IgnoreFile: content is normalized into a line array, with the trailing blanks already handled at construction\n\t */\n\tconst ignoreFile = IgnoreFile.from(filePath, {\n\t\tendCount: true,\n\t});\n\n\tconst lines: string[] = [];\n\n\tlines.push('');\n\tlines.push(HEADER);\n\tlines.push(...staticFiles);\n\tlines.push(FOOTER);\n\tlines.push('');\n\n\tignoreFile.addList(lines, true);\n\n\tignoreFile.outputFile(filePath);\n}\n\n/**\n * 腳本進入點:擷取清單並更新 .npmignore 與 .gitignore\n * Script entry: extract the list and update .npmignore and .gitignore\n */\nfunction main(): void\n{\n\tconsole.log('Extracting static files from imported module...');\n\n\tconst staticFiles = extractStaticFiles();\n\n\tstaticFiles.push('test/fixtures/out/');\n\tstaticFiles.push('test/fixtures/split/');\n\tstaticFiles.push('test/fixtures/out/**');\n\tstaticFiles.push('test/fixtures/split/**');\n\n\tconsole.log(`Found ${staticFiles.length} static files:`);\n\n\tconst entries = staticFiles.sort().map(f => {\n\t\tconst entry = `!${f}`\n\t\tconsole.log(` ${entry}`)\n\t\treturn entry\n\t});\n\n\tconst npmIgnore = path.join(__ROOT, '.npmignore');\n\tconst gitIgnore = path.join(__ROOT, '.gitignore');\n\n\t/**\n\t * 兩個檔案採用同一套生成規則,先 npmignore 再 gitignore\n\t * Both files share the same generated rules, npmignore first then gitignore\n\t */\n\tupdateIgnoreFile(npmIgnore, entries);\n\tconsole.log(`\\nUpdated ${npmIgnore}`);\n\n\tupdateIgnoreFile(gitIgnore, entries);\n\tconsole.log(`Updated ${gitIgnore}`);\n}\n\nmain();\n"]}