@bagelink/workspace 1.7.43 → 1.7.45
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/dist/bin/bgl.cjs +34 -0
- package/dist/bin/bgl.mjs +34 -0
- package/package.json +1 -1
- package/src/init.ts +42 -0
- package/templates/tsconfig.app.json +23 -0
package/dist/bin/bgl.cjs
CHANGED
|
@@ -209,6 +209,12 @@ export default defineWorkspace(configs)
|
|
|
209
209
|
message: "Create/update vite.config.ts?",
|
|
210
210
|
initial: true
|
|
211
211
|
},
|
|
212
|
+
{
|
|
213
|
+
type: "confirm",
|
|
214
|
+
name: "createTsConfig",
|
|
215
|
+
message: "Create tsconfig.app.json with path aliases?",
|
|
216
|
+
initial: true
|
|
217
|
+
},
|
|
212
218
|
{
|
|
213
219
|
type: "confirm",
|
|
214
220
|
name: "generateNetlify",
|
|
@@ -222,6 +228,9 @@ export default defineWorkspace(configs)
|
|
|
222
228
|
if (setupResponse.updateViteConfig) {
|
|
223
229
|
updateViteConfig(root);
|
|
224
230
|
}
|
|
231
|
+
if (setupResponse.createTsConfig) {
|
|
232
|
+
createTsConfig(root);
|
|
233
|
+
}
|
|
225
234
|
if (setupResponse.generateNetlify) {
|
|
226
235
|
const prodConfig = {
|
|
227
236
|
host: productionHost,
|
|
@@ -273,6 +282,31 @@ function updatePackageJsonScripts(root) {
|
|
|
273
282
|
console.error("\u274C Failed to update package.json:", error);
|
|
274
283
|
}
|
|
275
284
|
}
|
|
285
|
+
function createTsConfig(root) {
|
|
286
|
+
const tsConfigPath = node_path.resolve(root, "tsconfig.app.json");
|
|
287
|
+
const tsConfigExists = node_fs.existsSync(tsConfigPath);
|
|
288
|
+
if (tsConfigExists) {
|
|
289
|
+
console.log("\u26A0\uFE0F tsconfig.app.json already exists, skipping");
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const tsConfigContent = `{
|
|
293
|
+
"extends": "../tsconfig.json",
|
|
294
|
+
"compilerOptions": {
|
|
295
|
+
"composite": true,
|
|
296
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
297
|
+
"baseUrl": ".",
|
|
298
|
+
"paths": {
|
|
299
|
+
"@/*": ["./src/*"],
|
|
300
|
+
"@shared/*": ["../shared/*"]
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"include": ["src/**/*", "src/**/*.vue"],
|
|
304
|
+
"exclude": ["node_modules"]
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
node_fs.writeFileSync(tsConfigPath, tsConfigContent, "utf-8");
|
|
308
|
+
console.log("\u2705 Created tsconfig.app.json");
|
|
309
|
+
}
|
|
276
310
|
function updateViteConfig(root) {
|
|
277
311
|
const viteConfigPath = node_path.resolve(root, "vite.config.ts");
|
|
278
312
|
const viteConfigExists = node_fs.existsSync(viteConfigPath);
|
package/dist/bin/bgl.mjs
CHANGED
|
@@ -202,6 +202,12 @@ export default defineWorkspace(configs)
|
|
|
202
202
|
message: "Create/update vite.config.ts?",
|
|
203
203
|
initial: true
|
|
204
204
|
},
|
|
205
|
+
{
|
|
206
|
+
type: "confirm",
|
|
207
|
+
name: "createTsConfig",
|
|
208
|
+
message: "Create tsconfig.app.json with path aliases?",
|
|
209
|
+
initial: true
|
|
210
|
+
},
|
|
205
211
|
{
|
|
206
212
|
type: "confirm",
|
|
207
213
|
name: "generateNetlify",
|
|
@@ -215,6 +221,9 @@ export default defineWorkspace(configs)
|
|
|
215
221
|
if (setupResponse.updateViteConfig) {
|
|
216
222
|
updateViteConfig(root);
|
|
217
223
|
}
|
|
224
|
+
if (setupResponse.createTsConfig) {
|
|
225
|
+
createTsConfig(root);
|
|
226
|
+
}
|
|
218
227
|
if (setupResponse.generateNetlify) {
|
|
219
228
|
const prodConfig = {
|
|
220
229
|
host: productionHost,
|
|
@@ -266,6 +275,31 @@ function updatePackageJsonScripts(root) {
|
|
|
266
275
|
console.error("\u274C Failed to update package.json:", error);
|
|
267
276
|
}
|
|
268
277
|
}
|
|
278
|
+
function createTsConfig(root) {
|
|
279
|
+
const tsConfigPath = resolve(root, "tsconfig.app.json");
|
|
280
|
+
const tsConfigExists = existsSync(tsConfigPath);
|
|
281
|
+
if (tsConfigExists) {
|
|
282
|
+
console.log("\u26A0\uFE0F tsconfig.app.json already exists, skipping");
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const tsConfigContent = `{
|
|
286
|
+
"extends": "../tsconfig.json",
|
|
287
|
+
"compilerOptions": {
|
|
288
|
+
"composite": true,
|
|
289
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
290
|
+
"baseUrl": ".",
|
|
291
|
+
"paths": {
|
|
292
|
+
"@/*": ["./src/*"],
|
|
293
|
+
"@shared/*": ["../shared/*"]
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"include": ["src/**/*", "src/**/*.vue"],
|
|
297
|
+
"exclude": ["node_modules"]
|
|
298
|
+
}
|
|
299
|
+
`;
|
|
300
|
+
writeFileSync(tsConfigPath, tsConfigContent, "utf-8");
|
|
301
|
+
console.log("\u2705 Created tsconfig.app.json");
|
|
302
|
+
}
|
|
269
303
|
function updateViteConfig(root) {
|
|
270
304
|
const viteConfigPath = resolve(root, "vite.config.ts");
|
|
271
305
|
const viteConfigExists = existsSync(viteConfigPath);
|
package/package.json
CHANGED
package/src/init.ts
CHANGED
|
@@ -91,6 +91,12 @@ export default defineWorkspace(configs)
|
|
|
91
91
|
message: 'Create/update vite.config.ts?',
|
|
92
92
|
initial: true,
|
|
93
93
|
},
|
|
94
|
+
{
|
|
95
|
+
type: 'confirm',
|
|
96
|
+
name: 'createTsConfig',
|
|
97
|
+
message: 'Create tsconfig.app.json with path aliases?',
|
|
98
|
+
initial: true,
|
|
99
|
+
},
|
|
94
100
|
{
|
|
95
101
|
type: 'confirm',
|
|
96
102
|
name: 'generateNetlify',
|
|
@@ -107,6 +113,10 @@ export default defineWorkspace(configs)
|
|
|
107
113
|
updateViteConfig(root)
|
|
108
114
|
}
|
|
109
115
|
|
|
116
|
+
if (setupResponse.createTsConfig) {
|
|
117
|
+
createTsConfig(root)
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
if (setupResponse.generateNetlify) {
|
|
111
121
|
const prodConfig: WorkspaceConfig = {
|
|
112
122
|
host: productionHost,
|
|
@@ -216,6 +226,38 @@ function updatePackageJsonScripts(root: string): void {
|
|
|
216
226
|
}
|
|
217
227
|
}
|
|
218
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Create tsconfig.app.json with path aliases
|
|
231
|
+
*/
|
|
232
|
+
function createTsConfig(root: string): void {
|
|
233
|
+
const tsConfigPath = resolve(root, 'tsconfig.app.json')
|
|
234
|
+
const tsConfigExists = existsSync(tsConfigPath)
|
|
235
|
+
|
|
236
|
+
if (tsConfigExists) {
|
|
237
|
+
console.log('⚠️ tsconfig.app.json already exists, skipping')
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const tsConfigContent = `{
|
|
242
|
+
"extends": "../tsconfig.json",
|
|
243
|
+
"compilerOptions": {
|
|
244
|
+
"composite": true,
|
|
245
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
246
|
+
"baseUrl": ".",
|
|
247
|
+
"paths": {
|
|
248
|
+
"@/*": ["./src/*"],
|
|
249
|
+
"@shared/*": ["../shared/*"]
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"include": ["src/**/*", "src/**/*.vue"],
|
|
253
|
+
"exclude": ["node_modules"]
|
|
254
|
+
}
|
|
255
|
+
`
|
|
256
|
+
|
|
257
|
+
writeFileSync(tsConfigPath, tsConfigContent, 'utf-8')
|
|
258
|
+
console.log('✅ Created tsconfig.app.json')
|
|
259
|
+
}
|
|
260
|
+
|
|
219
261
|
/**
|
|
220
262
|
* Create or update vite.config.ts
|
|
221
263
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
6
|
+
"baseUrl": ".",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/*": [
|
|
9
|
+
"./src/*"
|
|
10
|
+
],
|
|
11
|
+
"@shared/*": [
|
|
12
|
+
"../shared/*"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"include": [
|
|
17
|
+
"src/**/*",
|
|
18
|
+
"src/**/*.vue"
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"node_modules"
|
|
22
|
+
]
|
|
23
|
+
}
|