@intlayer/cli 9.0.0-canary.12 → 9.0.0-canary.14
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/cjs/bundle.cjs +32 -1
- package/dist/cjs/bundle.cjs.map +1 -1
- package/dist/cjs/cli.cjs +145 -120
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/init.cjs +36 -0
- package/dist/cjs/init.cjs.map +1 -1
- package/dist/cjs/pull.cjs +1 -1
- package/dist/cjs/watch.cjs +22 -2
- package/dist/cjs/watch.cjs.map +1 -1
- package/dist/esm/bundle.mjs +32 -1
- package/dist/esm/bundle.mjs.map +1 -1
- package/dist/esm/cli.mjs +123 -98
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/init.mjs +36 -0
- package/dist/esm/init.mjs.map +1 -1
- package/dist/esm/pull.mjs +1 -1
- package/dist/esm/watch.mjs +22 -2
- package/dist/esm/watch.mjs.map +1 -1
- package/dist/types/bundle.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/init.d.ts.map +1 -1
- package/dist/types/watch.d.ts.map +1 -1
- package/package.json +13 -13
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
import { extract } from "./extract.mjs";
|
|
2
|
-
import { listProjectsCommand } from "./listProjects.mjs";
|
|
3
|
-
import { liveSync } from "./liveSync.mjs";
|
|
4
|
-
import { listContentDeclaration } from "./listContentDeclaration.mjs";
|
|
5
|
-
import { login } from "./auth/login.mjs";
|
|
6
|
-
import { initBuildOptimization } from "./initBuildOptimization.mjs";
|
|
7
|
-
import { initSkills } from "./initSkills.mjs";
|
|
8
|
-
import { initMCP } from "./initMCP.mjs";
|
|
9
|
-
import { init } from "./init.mjs";
|
|
10
|
-
import { startEditor } from "./editor.mjs";
|
|
11
|
-
import { watchContentDeclaration } from "./watch.mjs";
|
|
12
|
-
import { scan } from "./scan.mjs";
|
|
13
|
-
import { build } from "./build.mjs";
|
|
14
|
-
import { bundle } from "./bundle.mjs";
|
|
15
|
-
import { runCI } from "./ci.mjs";
|
|
16
|
-
import { getConfig } from "./config.mjs";
|
|
17
|
-
import { testMissingTranslations } from "./test/test.mjs";
|
|
18
|
-
import { fill } from "./fill/fill.mjs";
|
|
19
|
-
import { pull } from "./pull.mjs";
|
|
20
|
-
import { push } from "./push/push.mjs";
|
|
21
|
-
import { pushConfig } from "./pushConfig.mjs";
|
|
22
|
-
import { reviewDoc } from "./reviewDoc/reviewDoc.mjs";
|
|
23
|
-
import { searchDoc } from "./searchDoc.mjs";
|
|
24
|
-
import { translateDoc } from "./translateDoc/translateDoc.mjs";
|
|
25
1
|
import { getParentPackageJSON } from "./utils/getParentPackageJSON.mjs";
|
|
26
2
|
import { dirname as dirname$1 } from "node:path";
|
|
27
3
|
import { setPrefix } from "@intlayer/config/logger";
|
|
@@ -154,7 +130,8 @@ const setAPI = () => {
|
|
|
154
130
|
*/
|
|
155
131
|
const loginCmd = program.command("login").description("Login to Intlayer").option("--cms-url [cmsUrl]", "CMS URL");
|
|
156
132
|
applyConfigOptions(loginCmd);
|
|
157
|
-
loginCmd.action((options) => {
|
|
133
|
+
loginCmd.action(async (options) => {
|
|
134
|
+
const { login } = await import("./auth/login.mjs");
|
|
158
135
|
const configOptions = extractConfigOptions(options) ?? { override: { log: {
|
|
159
136
|
prefix: "",
|
|
160
137
|
mode: "verbose"
|
|
@@ -167,15 +144,27 @@ const setAPI = () => {
|
|
|
167
144
|
/**
|
|
168
145
|
* INIT
|
|
169
146
|
*/
|
|
170
|
-
const initCmd = program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").option("--no-gitignore", "Do not add .intlayer to .gitignore").option("--no-github-actions", "Do not scaffold the fill and test GitHub Actions workflows").option("--no-framework-setup", "Do not scaffold framework middleware/proxy and providers in layout/page").option("-i, --interactive", "Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)").action((options) =>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
147
|
+
const initCmd = program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").option("--no-gitignore", "Do not add .intlayer to .gitignore").option("--no-github-actions", "Do not scaffold the fill and test GitHub Actions workflows").option("--no-framework-setup", "Do not scaffold framework middleware/proxy and providers in layout/page").option("-i, --interactive", "Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)").action(async (options) => {
|
|
148
|
+
const { init } = await import("./init.mjs");
|
|
149
|
+
return init(options.projectRoot, {
|
|
150
|
+
noGitignore: options.gitignore === false,
|
|
151
|
+
noGithubActions: options.githubActions === false,
|
|
152
|
+
noFrameworkSetup: options.frameworkSetup === false,
|
|
153
|
+
upgradeToVersion: packageJson.version
|
|
154
|
+
}, options.interactive === true);
|
|
155
|
+
});
|
|
156
|
+
initCmd.command("skills").description("Initialize Intlayer skills in the project").option("--project-root [projectRoot]", "Project root directory").action(async (options) => {
|
|
157
|
+
const { initSkills } = await import("./initSkills.mjs");
|
|
158
|
+
return initSkills(options.projectRoot);
|
|
159
|
+
});
|
|
160
|
+
initCmd.command("mcp").description("Initialize Intlayer MCP server in the project").option("--project-root [projectRoot]", "Project root directory").action(async (options) => {
|
|
161
|
+
const { initMCP } = await import("./initMCP.mjs");
|
|
162
|
+
return initMCP(options.projectRoot);
|
|
163
|
+
});
|
|
164
|
+
initCmd.command("build-optimization").description("Configure build optimization for Next.js (@intlayer/swc or @intlayer/babel)").option("--project-root [projectRoot]", "Project root directory").action(async (options) => {
|
|
165
|
+
const { initBuildOptimization } = await import("./initBuildOptimization.mjs");
|
|
166
|
+
return initBuildOptimization(options.projectRoot);
|
|
167
|
+
});
|
|
179
168
|
/**
|
|
180
169
|
* DICTIONARIES
|
|
181
170
|
*/
|
|
@@ -192,7 +181,8 @@ const setAPI = () => {
|
|
|
192
181
|
const dictionariesBuildCmd = dictionariesProgram.command("build").description(buildOptions.description);
|
|
193
182
|
applyOptions(dictionariesBuildCmd, buildOptions.options);
|
|
194
183
|
applyConfigOptions(dictionariesBuildCmd);
|
|
195
|
-
dictionariesBuildCmd.action((options) => {
|
|
184
|
+
dictionariesBuildCmd.action(async (options) => {
|
|
185
|
+
const { build } = await import("./build.mjs");
|
|
196
186
|
build({
|
|
197
187
|
...options,
|
|
198
188
|
configOptions: extractConfigOptions(options)
|
|
@@ -201,7 +191,8 @@ const setAPI = () => {
|
|
|
201
191
|
const rootBuildCmd = program.command("build").description(buildOptions.description);
|
|
202
192
|
applyOptions(rootBuildCmd, buildOptions.options);
|
|
203
193
|
applyConfigOptions(rootBuildCmd);
|
|
204
|
-
rootBuildCmd.action((options) => {
|
|
194
|
+
rootBuildCmd.action(async (options) => {
|
|
195
|
+
const { build } = await import("./build.mjs");
|
|
205
196
|
build({
|
|
206
197
|
...options,
|
|
207
198
|
configOptions: extractConfigOptions(options)
|
|
@@ -214,7 +205,8 @@ const setAPI = () => {
|
|
|
214
205
|
const dictionariesWatchCmd = dictionariesProgram.command("watch").description(buildOptions.description);
|
|
215
206
|
applyOptions(dictionariesWatchCmd, watchOptions.options);
|
|
216
207
|
applyConfigOptions(dictionariesWatchCmd);
|
|
217
|
-
dictionariesWatchCmd.action((options) => {
|
|
208
|
+
dictionariesWatchCmd.action(async (options) => {
|
|
209
|
+
const { watchContentDeclaration } = await import("./watch.mjs");
|
|
218
210
|
watchContentDeclaration({
|
|
219
211
|
...options,
|
|
220
212
|
configOptions: extractConfigOptions(options)
|
|
@@ -223,7 +215,8 @@ const setAPI = () => {
|
|
|
223
215
|
const rootWatchCmd = program.command("watch").description(buildOptions.description);
|
|
224
216
|
applyOptions(rootWatchCmd, watchOptions.options);
|
|
225
217
|
applyConfigOptions(rootWatchCmd);
|
|
226
|
-
rootWatchCmd.action((options) => {
|
|
218
|
+
rootWatchCmd.action(async (options) => {
|
|
219
|
+
const { watchContentDeclaration } = await import("./watch.mjs");
|
|
227
220
|
watchContentDeclaration({
|
|
228
221
|
...options,
|
|
229
222
|
configOptions: extractConfigOptions(options)
|
|
@@ -241,7 +234,8 @@ const setAPI = () => {
|
|
|
241
234
|
const dictionariesPullCmd = dictionariesProgram.command("pull").description(pullOptions.description);
|
|
242
235
|
applyOptions(dictionariesPullCmd, pullOptions.options);
|
|
243
236
|
applyConfigOptions(dictionariesPullCmd);
|
|
244
|
-
dictionariesPullCmd.action((options) => {
|
|
237
|
+
dictionariesPullCmd.action(async (options) => {
|
|
238
|
+
const { pull } = await import("./pull.mjs");
|
|
245
239
|
const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
|
|
246
240
|
pull({
|
|
247
241
|
...options,
|
|
@@ -252,7 +246,8 @@ const setAPI = () => {
|
|
|
252
246
|
const rootPullCmd = program.command("pull").description(pullOptions.description);
|
|
253
247
|
applyOptions(rootPullCmd, pullOptions.options);
|
|
254
248
|
applyConfigOptions(rootPullCmd);
|
|
255
|
-
rootPullCmd.action((options) => {
|
|
249
|
+
rootPullCmd.action(async (options) => {
|
|
250
|
+
const { pull } = await import("./pull.mjs");
|
|
256
251
|
const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
|
|
257
252
|
pull({
|
|
258
253
|
...options,
|
|
@@ -276,7 +271,8 @@ const setAPI = () => {
|
|
|
276
271
|
applyOptions(dictionariesPushCmd, pushOptions.options);
|
|
277
272
|
applyConfigOptions(dictionariesPushCmd);
|
|
278
273
|
applyGitOptions(dictionariesPushCmd);
|
|
279
|
-
dictionariesPushCmd.action((options) => {
|
|
274
|
+
dictionariesPushCmd.action(async (options) => {
|
|
275
|
+
const { push } = await import("./push/push.mjs");
|
|
280
276
|
const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
|
|
281
277
|
return push({
|
|
282
278
|
...options,
|
|
@@ -289,7 +285,8 @@ const setAPI = () => {
|
|
|
289
285
|
applyOptions(rootPushCmd, pushOptions.options);
|
|
290
286
|
applyConfigOptions(rootPushCmd);
|
|
291
287
|
applyGitOptions(rootPushCmd);
|
|
292
|
-
rootPushCmd.action((options) => {
|
|
288
|
+
rootPushCmd.action(async (options) => {
|
|
289
|
+
const { push } = await import("./push/push.mjs");
|
|
293
290
|
const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
|
|
294
291
|
return push({
|
|
295
292
|
...options,
|
|
@@ -304,7 +301,8 @@ const setAPI = () => {
|
|
|
304
301
|
const configurationProgram = program.command("configuration").alias("config").alias("conf").description("Configuration operations");
|
|
305
302
|
const configGetCmd = configurationProgram.command("get").description("Get the configuration");
|
|
306
303
|
applyConfigOptions(configGetCmd);
|
|
307
|
-
configGetCmd.action((options) => {
|
|
304
|
+
configGetCmd.action(async (options) => {
|
|
305
|
+
const { getConfig } = await import("./config.mjs");
|
|
308
306
|
getConfig({
|
|
309
307
|
...options,
|
|
310
308
|
configOptions: extractConfigOptions(options)
|
|
@@ -312,20 +310,23 @@ const setAPI = () => {
|
|
|
312
310
|
});
|
|
313
311
|
const configPushCmd = configurationProgram.command("push").description("Push the configuration");
|
|
314
312
|
applyConfigOptions(configPushCmd);
|
|
315
|
-
configPushCmd.action((options) => {
|
|
313
|
+
configPushCmd.action(async (options) => {
|
|
314
|
+
const { pushConfig } = await import("./pushConfig.mjs");
|
|
316
315
|
pushConfig({
|
|
317
316
|
...options,
|
|
318
317
|
configOptions: extractConfigOptions(options)
|
|
319
318
|
});
|
|
320
319
|
});
|
|
321
|
-
program.command("projects").alias("project").description("List Intlayer projects").command("list").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--json", "Output the results as JSON").action((options) => {
|
|
320
|
+
program.command("projects").alias("project").description("List Intlayer projects").command("list").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--json", "Output the results as JSON").action(async (options) => {
|
|
321
|
+
const { listProjectsCommand } = await import("./listProjects.mjs");
|
|
322
322
|
listProjectsCommand({
|
|
323
323
|
baseDir: options.baseDir,
|
|
324
324
|
gitRoot: options.gitRoot,
|
|
325
325
|
json: options.json
|
|
326
326
|
});
|
|
327
327
|
});
|
|
328
|
-
program.command("projects-list").alias("pl").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--absolute", "Output the results as absolute paths").option("--json", "Output the results as JSON").action((options) => {
|
|
328
|
+
program.command("projects-list").alias("pl").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--absolute", "Output the results as absolute paths").option("--json", "Output the results as JSON").action(async (options) => {
|
|
329
|
+
const { listProjectsCommand } = await import("./listProjects.mjs");
|
|
329
330
|
listProjectsCommand({
|
|
330
331
|
baseDir: options.baseDir,
|
|
331
332
|
gitRoot: options.gitRoot,
|
|
@@ -337,13 +338,15 @@ const setAPI = () => {
|
|
|
337
338
|
* CONTENT DECLARATION
|
|
338
339
|
*/
|
|
339
340
|
const contentProgram = program.command("content").description("Content declaration operations");
|
|
340
|
-
contentProgram.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
|
|
341
|
+
contentProgram.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action(async (options) => {
|
|
342
|
+
const { listContentDeclaration } = await import("./listContentDeclaration.mjs");
|
|
341
343
|
listContentDeclaration({
|
|
342
344
|
json: options.json,
|
|
343
345
|
absolute: options.absolute
|
|
344
346
|
});
|
|
345
347
|
});
|
|
346
|
-
program.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
|
|
348
|
+
program.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action(async (options) => {
|
|
349
|
+
const { listContentDeclaration } = await import("./listContentDeclaration.mjs");
|
|
347
350
|
listContentDeclaration({
|
|
348
351
|
json: options.json,
|
|
349
352
|
absolute: options.absolute
|
|
@@ -351,7 +354,8 @@ const setAPI = () => {
|
|
|
351
354
|
});
|
|
352
355
|
const testProgram = contentProgram.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
|
|
353
356
|
applyConfigOptions(testProgram);
|
|
354
|
-
testProgram.action((options) => {
|
|
357
|
+
testProgram.action(async (options) => {
|
|
358
|
+
const { testMissingTranslations } = await import("./test/index.mjs");
|
|
355
359
|
testMissingTranslations({
|
|
356
360
|
...options,
|
|
357
361
|
configOptions: extractConfigOptions(options)
|
|
@@ -359,7 +363,8 @@ const setAPI = () => {
|
|
|
359
363
|
});
|
|
360
364
|
const rootTestCmd = program.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
|
|
361
365
|
applyConfigOptions(rootTestCmd);
|
|
362
|
-
rootTestCmd.action((options) => {
|
|
366
|
+
rootTestCmd.action(async (options) => {
|
|
367
|
+
const { testMissingTranslations } = await import("./test/index.mjs");
|
|
363
368
|
testMissingTranslations({
|
|
364
369
|
...options,
|
|
365
370
|
configOptions: extractConfigOptions(options)
|
|
@@ -369,7 +374,8 @@ const setAPI = () => {
|
|
|
369
374
|
applyConfigOptions(fillProgram);
|
|
370
375
|
applyAIOptions(fillProgram);
|
|
371
376
|
applyGitOptions(fillProgram);
|
|
372
|
-
fillProgram.action((options) => {
|
|
377
|
+
fillProgram.action(async (options) => {
|
|
378
|
+
const { fill } = await import("./fill/fill.mjs");
|
|
373
379
|
const keys = [...options.keys ?? [], ...options.key ?? []];
|
|
374
380
|
const excludedKeys = [...options.excludedKeys ?? [], ...options.excludedKey ?? []];
|
|
375
381
|
const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
|
|
@@ -403,47 +409,56 @@ const setAPI = () => {
|
|
|
403
409
|
applyAIOptions(translateProgram);
|
|
404
410
|
applyGitOptions(translateProgram);
|
|
405
411
|
applyOptions(translateProgram, docParams);
|
|
406
|
-
translateProgram.action((options) =>
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
412
|
+
translateProgram.action(async (options) => {
|
|
413
|
+
const { translateDoc } = await import("./translateDoc/translateDoc.mjs");
|
|
414
|
+
return translateDoc({
|
|
415
|
+
docPattern: options.docPattern,
|
|
416
|
+
excludedGlobPattern: options.excludedGlobPattern,
|
|
417
|
+
locales: options.locales,
|
|
418
|
+
baseLocale: options.baseLocale,
|
|
419
|
+
aiOptions: extractAiOptions(options),
|
|
420
|
+
gitOptions: extractGitOptions(options),
|
|
421
|
+
nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
|
|
422
|
+
configOptions: extractConfigOptions(options),
|
|
423
|
+
customInstructions: options.customInstructions,
|
|
424
|
+
skipIfModifiedBefore: options.skipIfModifiedBefore,
|
|
425
|
+
skipIfModifiedAfter: options.skipIfModifiedAfter,
|
|
426
|
+
skipIfExists: options.skipIfExists
|
|
427
|
+
});
|
|
428
|
+
});
|
|
420
429
|
const reviewProgram = docProgram.command("review").description("Review the documentation").option("--log", "Log-only mode. Do not translate with AI; instead log the blocks that need attention (with line numbers and content) for the base and target locales, to help another agent generate the translations.");
|
|
421
430
|
applyConfigOptions(reviewProgram);
|
|
422
431
|
applyAIOptions(reviewProgram);
|
|
423
432
|
applyGitOptions(reviewProgram);
|
|
424
433
|
applyOptions(reviewProgram, docParams);
|
|
425
|
-
reviewProgram.action((options) =>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
434
|
+
reviewProgram.action(async (options) => {
|
|
435
|
+
const { reviewDoc } = await import("./reviewDoc/reviewDoc.mjs");
|
|
436
|
+
return reviewDoc({
|
|
437
|
+
docPattern: options.docPattern,
|
|
438
|
+
excludedGlobPattern: options.excludedGlobPattern,
|
|
439
|
+
locales: options.locales,
|
|
440
|
+
baseLocale: options.baseLocale,
|
|
441
|
+
aiOptions: extractAiOptions(options),
|
|
442
|
+
gitOptions: extractGitOptions(options),
|
|
443
|
+
nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
|
|
444
|
+
configOptions: extractConfigOptions(options),
|
|
445
|
+
customInstructions: options.customInstructions,
|
|
446
|
+
skipIfModifiedBefore: options.skipIfModifiedBefore,
|
|
447
|
+
skipIfModifiedAfter: options.skipIfModifiedAfter,
|
|
448
|
+
skipIfExists: options.skipIfExists,
|
|
449
|
+
log: options.log
|
|
450
|
+
});
|
|
451
|
+
});
|
|
440
452
|
const searchProgram = docProgram.command("search").description("Search the documentation").argument("<query>", "Search query").option("--limit [limit]", "Limit the number of results", "10");
|
|
441
453
|
applyConfigOptions(searchProgram);
|
|
442
|
-
searchProgram.action((query, options) =>
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
454
|
+
searchProgram.action(async (query, options) => {
|
|
455
|
+
const { searchDoc } = await import("./searchDoc.mjs");
|
|
456
|
+
return searchDoc({
|
|
457
|
+
query,
|
|
458
|
+
limit: options.limit ? parseInt(options.limit, 10) : 10,
|
|
459
|
+
configOptions: extractConfigOptions(options)
|
|
460
|
+
});
|
|
461
|
+
});
|
|
447
462
|
/**
|
|
448
463
|
* LIVE SYNC
|
|
449
464
|
*/
|
|
@@ -451,13 +466,17 @@ const setAPI = () => {
|
|
|
451
466
|
const liveCmd = program.command("live").description("Live sync - Watch for changes made on the CMS and update the application content accordingly");
|
|
452
467
|
applyOptions(liveCmd, liveOptions);
|
|
453
468
|
applyConfigOptions(liveCmd);
|
|
454
|
-
liveCmd.action((options) =>
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
469
|
+
liveCmd.action(async (options) => {
|
|
470
|
+
const { liveSync } = await import("./liveSync.mjs");
|
|
471
|
+
return liveSync({
|
|
472
|
+
...options,
|
|
473
|
+
configOptions: extractConfigOptions(options)
|
|
474
|
+
});
|
|
475
|
+
});
|
|
458
476
|
const editorStartCmd = program.command("editor").description("Visual editor operations").command("start").description("Start the Intlayer visual editor");
|
|
459
477
|
applyConfigOptions(editorStartCmd);
|
|
460
|
-
editorStartCmd.action((options) => {
|
|
478
|
+
editorStartCmd.action(async (options) => {
|
|
479
|
+
const { startEditor } = await import("./editor.mjs");
|
|
461
480
|
startEditor({
|
|
462
481
|
env: options.env,
|
|
463
482
|
envFile: options.envFile
|
|
@@ -468,7 +487,8 @@ const setAPI = () => {
|
|
|
468
487
|
*/
|
|
469
488
|
const extractProgram = program.command("extract").alias("ext").description("Extract strings from components to be placed in a .content file close to the component");
|
|
470
489
|
applyConfigOptions(extractProgram);
|
|
471
|
-
extractProgram.option("-f, --file [files...]", "List of files to extract").option("--code-only", "Only extract the component code", false).option("--declaration-only", "Only generate content declaration", false).action((options) => {
|
|
490
|
+
extractProgram.option("-f, --file [files...]", "List of files to extract").option("--code-only", "Only extract the component code", false).option("--declaration-only", "Only generate content declaration", false).action(async (options) => {
|
|
491
|
+
const { extract } = await import("./extract.mjs");
|
|
472
492
|
extract({
|
|
473
493
|
files: options.file,
|
|
474
494
|
configOptions: extractConfigOptions(options),
|
|
@@ -476,7 +496,8 @@ const setAPI = () => {
|
|
|
476
496
|
declarationOnly: options.declarationOnly
|
|
477
497
|
});
|
|
478
498
|
});
|
|
479
|
-
applyConfigOptions(program.command("standalone").description("Create a standalone bundle of the application content").option("-o, --outfile [outfile]", "Output file for the bundle", "intlayer-bundle.js").option("--packages [packages...]", "List of packages to bundle").option("--version [version]", "Version of the packages to bundle").option("--minify", "Minify the output").option("--platform [platform]", "Target platform", "browser").option("--format [format]", "Output format", "esm").action((options) => {
|
|
499
|
+
applyConfigOptions(program.command("standalone").description("Create a standalone bundle of the application content").option("-o, --outfile [outfile]", "Output file for the bundle", "intlayer-bundle.js").option("--packages [packages...]", "List of packages to bundle").option("--version [version]", "Version of the packages to bundle").option("--minify", "Minify the output").option("--platform [platform]", "Target platform", "browser").option("--format [format]", "Output format", "esm").action(async (options) => {
|
|
500
|
+
const { bundle } = await import("./bundle.mjs");
|
|
480
501
|
bundle({
|
|
481
502
|
outfile: options.outfile,
|
|
482
503
|
bundlePackages: options.packages,
|
|
@@ -492,18 +513,22 @@ const setAPI = () => {
|
|
|
492
513
|
*/
|
|
493
514
|
const scanCmd = program.command("scan").description("Scan a website to measure its page size and audit its i18n / SEO health").argument("<url>", "URL of the website to scan").option("--no-deep", "Disable the deeper puppeteer-based render scan").option("--json", "Output the results as JSON");
|
|
494
515
|
applyConfigOptions(scanCmd);
|
|
495
|
-
scanCmd.action((url, options) =>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
516
|
+
scanCmd.action(async (url, options) => {
|
|
517
|
+
const { scan } = await import("./scan.mjs");
|
|
518
|
+
return scan(url, {
|
|
519
|
+
deep: options.deep,
|
|
520
|
+
json: options.json,
|
|
521
|
+
configOptions: extractConfigOptions(options)
|
|
522
|
+
});
|
|
523
|
+
});
|
|
500
524
|
program.parse(process.argv);
|
|
501
525
|
/**
|
|
502
526
|
* CI / AUTOMATION
|
|
503
527
|
*
|
|
504
528
|
* Used to iterate over all projects in a monorepo, and help to parse secrets
|
|
505
529
|
*/
|
|
506
|
-
program.command("ci").description("Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.").argument("<command...>", "The intlayer command to execute (e.g., \"fill\", \"push\")").allowUnknownOption().action((args) => {
|
|
530
|
+
program.command("ci").description("Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.").argument("<command...>", "The intlayer command to execute (e.g., \"fill\", \"push\")").allowUnknownOption().action(async (args) => {
|
|
531
|
+
const { runCI } = await import("./ci.mjs");
|
|
507
532
|
runCI(args);
|
|
508
533
|
});
|
|
509
534
|
return program;
|