@dokebi/cli 0.4.52 → 0.4.54
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/AI.md +11 -8
- package/catalog.json +7 -7
- package/dist/bin.js +16 -2
- package/dist/capability-guide.js +2 -2
- package/dist/check/browser-sources.d.ts +9 -3
- package/dist/check/browser-sources.js +27 -9
- package/dist/check/formatter-rules.js +17 -14
- package/dist/check/index.js +9 -6
- package/dist/check/problems.d.ts +7 -1
- package/dist/check/problems.js +22 -1
- package/dist/check/project-rules.js +8 -0
- package/dist/check/shared-folder-rules.d.ts +3 -0
- package/dist/check/shared-folder-rules.js +50 -0
- package/dist/check/vite-rules.js +1 -1
- package/dist/commands.js +9 -0
- package/dist/filesystem.js +3 -1
- package/dist/formatter-ignore.d.ts +4 -0
- package/dist/formatter-ignore.js +14 -4
- package/dist/generator.d.ts +18 -1
- package/dist/generator.js +38 -1
- package/dist/layout.d.ts +9 -0
- package/dist/layout.js +19 -0
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/dist/project-guide.js +3 -3
- package/dist/project-inspector.js +34 -1
- package/dist/project.d.ts +6 -0
- package/dist/project.js +29 -3
- package/package.json +1 -1
package/dist/project.js
CHANGED
|
@@ -27,8 +27,8 @@ import { CliError } from './errors.js';
|
|
|
27
27
|
import { markExampleRemoved, syncExample } from './example-config.js';
|
|
28
28
|
import { exists, fingerprint, hash, json, object, parseObject, securePath, templateTarget, } from './filesystem.js';
|
|
29
29
|
import { adminSections } from './first-admin.js';
|
|
30
|
-
import { biomeConfigText, biomeMajor, formatterFix, formatterUses, GENERATED_FILE, migrationsFolder, PRETTIER_IGNORE, prettierIgnoreText, } from './formatter-ignore.js';
|
|
31
|
-
import { generateRegistration, LEGACY_MAIN_SOURCE, MAIN_SOURCE, MAIN_SOURCE_V1, MAIN_SOURCE_V2, MAIN_SOURCE_V3, MAIN_SOURCE_V4, MAIN_SOURCE_V5, PROJECT_DEV_DEPENDENCIES, TEST_SCRIPT, TSCONFIG_SOURCE, TYPECHECK_SCRIPT, } from './generator.js';
|
|
30
|
+
import { biomeConfigText, biomeMajor, formatterFix, formatterUses, GENERATED_FILE, GENERATED_FILES, migrationsFolder, PRETTIER_IGNORE, prettierIgnoreText, } from './formatter-ignore.js';
|
|
31
|
+
import { generateModuleList, generateRegistration, LEGACY_MAIN_SOURCE, MAIN_SOURCE, MAIN_SOURCE_V1, MAIN_SOURCE_V2, MAIN_SOURCE_V3, MAIN_SOURCE_V4, MAIN_SOURCE_V5, MODULE_LIST_FILE, PROJECT_DEV_DEPENDENCIES, TEST_SCRIPT, TSCONFIG_SOURCE, TYPECHECK_SCRIPT, } from './generator.js';
|
|
32
32
|
import { findHost, HOST_ROLES, missingDependency, optionsKey, orderPlugins, PACKAGE_NAME, readManifest, } from './manifest.js';
|
|
33
33
|
import { mergeInstallDefaults } from './merge-install-defaults.js';
|
|
34
34
|
import { dependencyMap, NpmClient, packageSpec, projectTarball, stageNpmConfig, validateProjectPackage, } from './npm-client.js';
|
|
@@ -2378,6 +2378,9 @@ export class Project {
|
|
|
2378
2378
|
// R1 measurement: the registration the CLI writes, too (a reformatted copy is
|
|
2379
2379
|
// MODIFIED_REGISTRATION); the migrations folder only in a project with migrations.
|
|
2380
2380
|
const targets = [GENERATED_FILE];
|
|
2381
|
+
// D-0227: the module list beside it, written while a plugin hosts modules.
|
|
2382
|
+
if (findHost(plugins, 'modules'))
|
|
2383
|
+
targets.push(MODULE_LIST_FILE);
|
|
2381
2384
|
if (plugins.some((plugin) => plugin.id === 'dokebi-migrate') ||
|
|
2382
2385
|
(await exists(await securePath(root, migrations))))
|
|
2383
2386
|
targets.push(migrations);
|
|
@@ -2408,7 +2411,7 @@ export class Project {
|
|
|
2408
2411
|
}
|
|
2409
2412
|
}
|
|
2410
2413
|
warnings.push({
|
|
2411
|
-
code: folder
|
|
2414
|
+
code: GENERATED_FILES.includes(folder)
|
|
2412
2415
|
? 'FORMATTER_FORMATS_GENERATED'
|
|
2413
2416
|
: 'FORMATTER_FORMATS_MIGRATIONS',
|
|
2414
2417
|
path: use.config,
|
|
@@ -4129,6 +4132,23 @@ export class Project {
|
|
|
4129
4132
|
await tx.close();
|
|
4130
4133
|
}
|
|
4131
4134
|
}
|
|
4135
|
+
/**
|
|
4136
|
+
* `dokebi module sync` (D-0227): writes src/dokebi.modules.generated.ts (and the registration)
|
|
4137
|
+
* from the registered modules, unchanged otherwise. A project made before cli 0.4.54 gets its
|
|
4138
|
+
* module list this way; any later module add or remove keeps it current.
|
|
4139
|
+
*/
|
|
4140
|
+
async moduleSync(root, dryRun = false) {
|
|
4141
|
+
const session = await this.#begin(root);
|
|
4142
|
+
const { tx, state } = session;
|
|
4143
|
+
try {
|
|
4144
|
+
await this.#requireHost(state, 'modules');
|
|
4145
|
+
await this.writeConfiguration(tx, state, session.configSource, session.configFile);
|
|
4146
|
+
return await this.#finish(session, { changed: tx.paths, preserved: [] }, dryRun);
|
|
4147
|
+
}
|
|
4148
|
+
finally {
|
|
4149
|
+
await tx.close();
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4132
4152
|
/** `dokebi module list`: the registered modules in registration order. */
|
|
4133
4153
|
async moduleList(root) {
|
|
4134
4154
|
const state = readState(parseObject(await projectStateText(root), 'state'));
|
|
@@ -4655,6 +4675,12 @@ export class Project {
|
|
|
4655
4675
|
const generated = generateRegistration(state.plugins, state.installations, state.apps ?? [], state.modules ?? [], state.settings ?? []);
|
|
4656
4676
|
state.generatedHash = hash(generated);
|
|
4657
4677
|
await tx.write(GENERATED, generated);
|
|
4678
|
+
// D-0227: the registered modules as code apps import, while a plugin hosts modules; a list
|
|
4679
|
+
// left by a removed module host goes with it (its modules are no longer registered).
|
|
4680
|
+
if (findHost(state.plugins, 'modules'))
|
|
4681
|
+
await tx.write(MODULE_LIST_FILE, generateModuleList(state.modules ?? []));
|
|
4682
|
+
else if (await exists(await securePath(tx.root, MODULE_LIST_FILE)))
|
|
4683
|
+
await tx.replace(MODULE_LIST_FILE);
|
|
4658
4684
|
await tx.write(configFile, configSource);
|
|
4659
4685
|
await tx.write('.dokebi/state.json', json(state));
|
|
4660
4686
|
}
|