@memberjunction/cli 4.4.0 → 5.1.0
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/README.md +130 -0
- package/dist/commands/app/check-updates.d.ts +13 -0
- package/dist/commands/app/check-updates.d.ts.map +1 -0
- package/dist/commands/app/check-updates.js +54 -0
- package/dist/commands/app/check-updates.js.map +1 -0
- package/dist/commands/app/disable.d.ts +16 -0
- package/dist/commands/app/disable.d.ts.map +1 -0
- package/dist/commands/app/disable.js +47 -0
- package/dist/commands/app/disable.js.map +1 -0
- package/dist/commands/app/enable.d.ts +16 -0
- package/dist/commands/app/enable.d.ts.map +1 -0
- package/dist/commands/app/enable.js +47 -0
- package/dist/commands/app/enable.js.map +1 -0
- package/dist/commands/app/info.d.ts +16 -0
- package/dist/commands/app/info.d.ts.map +1 -0
- package/dist/commands/app/info.js +64 -0
- package/dist/commands/app/info.js.map +1 -0
- package/dist/commands/app/install.d.ts +21 -0
- package/dist/commands/app/install.d.ts.map +1 -0
- package/dist/commands/app/install.js +54 -0
- package/dist/commands/app/install.js.map +1 -0
- package/dist/commands/app/list.d.ts +16 -0
- package/dist/commands/app/list.d.ts.map +1 -0
- package/dist/commands/app/list.js +60 -0
- package/dist/commands/app/list.js.map +1 -0
- package/dist/commands/app/remove.d.ts +22 -0
- package/dist/commands/app/remove.d.ts.map +1 -0
- package/dist/commands/app/remove.js +66 -0
- package/dist/commands/app/remove.js.map +1 -0
- package/dist/commands/app/upgrade.d.ts +20 -0
- package/dist/commands/app/upgrade.d.ts.map +1 -0
- package/dist/commands/app/upgrade.js +52 -0
- package/dist/commands/app/upgrade.js.map +1 -0
- package/dist/commands/clean/index.d.ts +0 -2
- package/dist/commands/clean/index.d.ts.map +1 -1
- package/dist/commands/clean/index.js +31 -19
- package/dist/commands/clean/index.js.map +1 -1
- package/dist/commands/codegen/5-0-fix-entity-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-entity-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-entity-names.js +104 -0
- package/dist/commands/codegen/5-0-fix-entity-names.js.map +1 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.js +92 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.js.map +1 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.js +93 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.js.map +1 -0
- package/dist/commands/codegen/index.d.ts +4 -1
- package/dist/commands/codegen/index.d.ts.map +1 -1
- package/dist/commands/codegen/index.js +30 -5
- package/dist/commands/codegen/index.js.map +1 -1
- package/dist/commands/codegen/manifest.d.ts +4 -1
- package/dist/commands/codegen/manifest.d.ts.map +1 -1
- package/dist/commands/codegen/manifest.js +34 -11
- package/dist/commands/codegen/manifest.js.map +1 -1
- package/dist/commands/migrate/index.d.ts +5 -1
- package/dist/commands/migrate/index.d.ts.map +1 -1
- package/dist/commands/migrate/index.js +102 -229
- package/dist/commands/migrate/index.js.map +1 -1
- package/dist/commands/sync/init.js +1 -1
- package/dist/commands/sync/init.js.map +1 -1
- package/dist/commands/sync/pull.js +4 -4
- package/dist/commands/sync/pull.js.map +1 -1
- package/dist/config.d.ts +154 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +81 -48
- package/dist/config.js.map +1 -1
- package/dist/light-commands.d.ts +1 -1
- package/dist/light-commands.js +2 -2
- package/dist/light-commands.js.map +1 -1
- package/dist/utils/open-app-context.d.ts +48 -0
- package/dist/utils/open-app-context.d.ts.map +1 -0
- package/dist/utils/open-app-context.js +143 -0
- package/dist/utils/open-app-context.js.map +1 -0
- package/oclif.manifest.json +789 -247
- package/package.json +12 -12
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
export default class V50FixMetadataNames extends Command {
|
|
3
|
+
static { this.description = `[v5.0 Migration] Scan metadata JSON files for entity names that need "MJ: " prefix updates.
|
|
4
|
+
|
|
5
|
+
Targets the metadata/ directory used by "mj sync". Detects entity name references in
|
|
6
|
+
@lookup: directives (both the entity name and lookup value), .mj-sync.json and
|
|
7
|
+
.mj-folder.json config files (entity/entityName fields), relatedEntities object keys,
|
|
8
|
+
and fields.Name values in Entities-managing folders. Runs in dry-run mode by default;
|
|
9
|
+
use --fix to apply.
|
|
10
|
+
|
|
11
|
+
The rename map is built dynamically from entity_subclasses.ts by parsing all
|
|
12
|
+
@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).`; }
|
|
13
|
+
static { this.examples = [
|
|
14
|
+
{
|
|
15
|
+
description: 'Dry-run scan of the metadata directory',
|
|
16
|
+
command: '<%= config.bin %> <%= command.id %> --path metadata/',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: 'Apply fixes to metadata files',
|
|
20
|
+
command: '<%= config.bin %> <%= command.id %> --path metadata/ --fix',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: 'Scan a specific subdirectory',
|
|
24
|
+
command: '<%= config.bin %> <%= command.id %> --path metadata/resource-types',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
description: 'Scan and fix a single metadata file',
|
|
28
|
+
command: '<%= config.bin %> <%= command.id %> --path metadata/entities/.audit-related-entities.json --fix',
|
|
29
|
+
},
|
|
30
|
+
]; }
|
|
31
|
+
static { this.flags = {
|
|
32
|
+
path: Flags.string({
|
|
33
|
+
char: 'p',
|
|
34
|
+
description: 'File or directory to scan. Accepts a single .json file or a directory (scanned recursively, including dotfiles like .mj-sync.json). Defaults to the current working directory.',
|
|
35
|
+
}),
|
|
36
|
+
fix: Flags.boolean({
|
|
37
|
+
description: 'Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.',
|
|
38
|
+
default: false,
|
|
39
|
+
}),
|
|
40
|
+
'entity-subclasses': Flags.string({
|
|
41
|
+
description: 'Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.',
|
|
42
|
+
}),
|
|
43
|
+
quiet: Flags.boolean({
|
|
44
|
+
char: 'q',
|
|
45
|
+
description: 'Suppress detailed per-file output; only show the final summary counts.',
|
|
46
|
+
default: false,
|
|
47
|
+
}),
|
|
48
|
+
verbose: Flags.boolean({
|
|
49
|
+
char: 'v',
|
|
50
|
+
description: 'Show detailed progress including each file being scanned.',
|
|
51
|
+
default: false,
|
|
52
|
+
}),
|
|
53
|
+
}; }
|
|
54
|
+
async run() {
|
|
55
|
+
const { scanMetadataNames } = await import('@memberjunction/codegen-lib');
|
|
56
|
+
const { flags } = await this.parse(V50FixMetadataNames);
|
|
57
|
+
const result = await scanMetadataNames({
|
|
58
|
+
TargetPath: flags.path || process.cwd(),
|
|
59
|
+
Fix: flags.fix,
|
|
60
|
+
EntitySubclassesPath: flags['entity-subclasses'],
|
|
61
|
+
Verbose: flags.verbose,
|
|
62
|
+
});
|
|
63
|
+
if (!result.Success) {
|
|
64
|
+
this.error(`Scan failed:\n${result.Errors.map((e) => ` - ${e}`).join('\n')}`);
|
|
65
|
+
}
|
|
66
|
+
if (!flags.quiet) {
|
|
67
|
+
this.log(`\nScanned ${result.FilesScanned} files, found ${result.Findings.length} entity name(s) needing update`);
|
|
68
|
+
this.log(`Rename map: ${result.RenameMapSize} entity name mappings loaded`);
|
|
69
|
+
if (result.Findings.length > 0) {
|
|
70
|
+
// Group by file for readable output
|
|
71
|
+
const byFile = new Map();
|
|
72
|
+
for (const f of result.Findings) {
|
|
73
|
+
if (!byFile.has(f.FilePath))
|
|
74
|
+
byFile.set(f.FilePath, []);
|
|
75
|
+
byFile.get(f.FilePath).push(f);
|
|
76
|
+
}
|
|
77
|
+
for (const [file, findings] of byFile) {
|
|
78
|
+
this.log(`\n ${file}:`);
|
|
79
|
+
for (const f of findings) {
|
|
80
|
+
this.log(` Line ${f.Line}: '${f.OldName}' -> '${f.NewName}' [${f.PatternKind}]`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (flags.fix) {
|
|
85
|
+
this.log(`\nFixed ${result.FixedFiles.length} file(s)`);
|
|
86
|
+
}
|
|
87
|
+
else if (result.Findings.length > 0) {
|
|
88
|
+
this.log(`\nRun with --fix to apply these changes`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=5-0-fix-metadata-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-metadata-names.js","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-metadata-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;aAC7C,gBAAW,GAAG;;;;;;;;;iEASwC,CAAC;aAEvD,aAAQ,GAAG;QACd;YACI,WAAW,EAAE,wCAAwC;YACrD,OAAO,EAAE,sDAAsD;SAClE;QACD;YACI,WAAW,EAAE,+BAA+B;YAC5C,OAAO,EAAE,4DAA4D;SACxE;QACD;YACI,WAAW,EAAE,8BAA8B;YAC3C,OAAO,EAAE,oEAAoE;SAChF;QACD;YACI,WAAW,EAAE,qCAAqC;YAClD,OAAO,EAAE,iGAAiG;SAC7G;KACJ,CAAC;aAEK,UAAK,GAAG;QACX,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,gLAAgL;SAChM,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;YACf,WAAW,EAAE,sGAAsG;YACnH,OAAO,EAAE,KAAK;SACjB,CAAC;QACF,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC;Y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AAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7B,oCAAoC;gBACpC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;gBACzD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;wBAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBACxD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,EAAE,CAAC;oBACpC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;oBACzB,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;wBACvB,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC;oBACxF,CAAC;gBACL,CAAC;YACL,CAAC;YAED,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;gBACZ,IAAI,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;YACxD,CAAC;QACL,CAAC;IACL,CAAC"}
|
|
@@ -2,7 +2,10 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
import type { ParserOutput } from '@oclif/core/lib/interfaces/parser';
|
|
3
3
|
export default class CodeGen extends Command {
|
|
4
4
|
static description: string;
|
|
5
|
-
static examples:
|
|
5
|
+
static examples: {
|
|
6
|
+
command: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}[];
|
|
6
9
|
static flags: {
|
|
7
10
|
skipdb: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAiBA;IAElB,MAAM,CAAC,QAAQ;;;QASb;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEF,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAEhC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
|
|
@@ -1,13 +1,38 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import { updatedConfig } from '../../config.js';
|
|
3
3
|
export default class CodeGen extends Command {
|
|
4
|
-
static { this.description =
|
|
4
|
+
static { this.description = `Run the full MemberJunction code generation pipeline.
|
|
5
|
+
|
|
6
|
+
Analyzes your SQL Server database schema, updates MemberJunction metadata, and
|
|
7
|
+
generates synchronized code across the entire stack:
|
|
8
|
+
|
|
9
|
+
- SQL views, stored procedures, indexes, and permissions
|
|
10
|
+
- TypeScript entity classes with Zod validation schemas
|
|
11
|
+
- Angular form components with AI-driven layouts
|
|
12
|
+
- GraphQL resolvers and type definitions
|
|
13
|
+
- Action subclasses and DB schema JSON
|
|
14
|
+
|
|
15
|
+
Configuration is loaded from mj.config.cjs in the current directory (or parent
|
|
16
|
+
directories). Database connection can also be set via environment variables:
|
|
17
|
+
DB_HOST, DB_DATABASE, CODEGEN_DB_USERNAME, CODEGEN_DB_PASSWORD.
|
|
18
|
+
|
|
19
|
+
Use --skipdb to skip all database operations (metadata sync, SQL object
|
|
20
|
+
generation) and only regenerate TypeScript, Angular, and GraphQL output from
|
|
21
|
+
existing metadata.`; }
|
|
5
22
|
static { this.examples = [
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
{
|
|
24
|
+
command: '<%= config.bin %> <%= command.id %>',
|
|
25
|
+
description: 'Run the full code generation pipeline',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
command: '<%= config.bin %> <%= command.id %> --skipdb',
|
|
29
|
+
description: 'Regenerate code files without touching the database',
|
|
30
|
+
},
|
|
8
31
|
]; }
|
|
9
32
|
static { this.flags = {
|
|
10
|
-
skipdb: Flags.boolean({
|
|
33
|
+
skipdb: Flags.boolean({
|
|
34
|
+
description: 'Skip database operations (metadata sync, SQL generation). Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.',
|
|
35
|
+
}),
|
|
11
36
|
}; }
|
|
12
37
|
async run() {
|
|
13
38
|
const { runMemberJunctionCodeGeneration, initializeConfig } = await import('@memberjunction/codegen-lib');
|
|
@@ -15,7 +40,7 @@ export default class CodeGen extends Command {
|
|
|
15
40
|
this.flags = parsed.flags;
|
|
16
41
|
const config = updatedConfig();
|
|
17
42
|
if (!config) {
|
|
18
|
-
this.error('No configuration found');
|
|
43
|
+
this.error('No configuration found. Ensure mj.config.cjs exists in the current directory or a parent directory.');
|
|
19
44
|
}
|
|
20
45
|
// Initialize configuration
|
|
21
46
|
initializeConfig(process.cwd());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;aACnC,gBAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;aACnC,gBAAW,GAAG;;;;;;;;;;;;;;;;;mBAiBJ,CAAC;aAEX,aAAQ,GAAG;QAChB;YACE,OAAO,EAAE,qCAAqC;YAC9C,WAAW,EAAE,uCAAuC;SACrD;QACD;YACE,OAAO,EAAE,8CAA8C;YACvD,WAAW,EAAE,qDAAqD;SACnE;KACF,CAAC;aAEK,UAAK,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC;YACpB,WAAW,EAAE,kKAAkK;SAChL,CAAC;KACH,CAAC;IAIF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAE1G,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,qGAAqG,CAAC,CAAC;QACpH,CAAC;QAED,2BAA2B;QAC3B,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhC,iDAAiD;QACjD,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class CodeGenManifest extends Command {
|
|
3
3
|
static description: string;
|
|
4
|
-
static examples:
|
|
4
|
+
static examples: {
|
|
5
|
+
command: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}[];
|
|
5
8
|
static flags: {
|
|
6
9
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
10
|
appDir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAWwD;IAE1E,MAAM,CAAC,QAAQ;;;QAiBb;IAEF,MAAM,CAAC,KAAK;;;;;;;MA8BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B7B"}
|
|
@@ -1,40 +1,63 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
export default class CodeGenManifest extends Command {
|
|
3
|
-
static { this.description =
|
|
3
|
+
static { this.description = `Generate a class registration manifest to prevent tree-shaking.
|
|
4
|
+
|
|
5
|
+
MemberJunction uses @RegisterClass decorators with a dynamic class factory.
|
|
6
|
+
Modern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will
|
|
7
|
+
tree-shake these classes out of production builds. This command scans the
|
|
8
|
+
dependency tree for all @RegisterClass-decorated classes and emits a manifest
|
|
9
|
+
file with static imports that the bundler cannot eliminate.
|
|
10
|
+
|
|
11
|
+
Typically used as a prebuild/prestart script for MJAPI and MJExplorer. For
|
|
12
|
+
MJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap
|
|
13
|
+
and @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to
|
|
14
|
+
generate a supplemental manifest covering only your own application classes.`; }
|
|
4
15
|
static { this.examples = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
{
|
|
17
|
+
command: '<%= config.bin %> <%= command.id %>',
|
|
18
|
+
description: 'Generate manifest with default output path',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: '<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts',
|
|
22
|
+
description: 'Generate manifest for a specific application directory',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
command: '<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction',
|
|
26
|
+
description: 'Exclude MJ packages (use pre-built bootstrap manifests instead)',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
command: '<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose',
|
|
30
|
+
description: 'Only include specific base classes with detailed progress',
|
|
31
|
+
},
|
|
9
32
|
]; }
|
|
10
33
|
static { this.flags = {
|
|
11
34
|
output: Flags.string({
|
|
12
35
|
char: 'o',
|
|
13
|
-
description: 'Output manifest file
|
|
36
|
+
description: 'Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.',
|
|
14
37
|
default: './src/generated/class-registrations-manifest.ts',
|
|
15
38
|
}),
|
|
16
39
|
appDir: Flags.string({
|
|
17
40
|
char: 'a',
|
|
18
|
-
description: '
|
|
41
|
+
description: 'Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.',
|
|
19
42
|
}),
|
|
20
43
|
filter: Flags.string({
|
|
21
44
|
char: 'f',
|
|
22
|
-
description: 'Only include classes
|
|
45
|
+
description: 'Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).',
|
|
23
46
|
multiple: true,
|
|
24
47
|
}),
|
|
25
48
|
'exclude-packages': Flags.string({
|
|
26
49
|
char: 'e',
|
|
27
|
-
description: '
|
|
50
|
+
description: 'Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.',
|
|
28
51
|
multiple: true,
|
|
29
52
|
}),
|
|
30
53
|
quiet: Flags.boolean({
|
|
31
54
|
char: 'q',
|
|
32
|
-
description: 'Suppress all output',
|
|
55
|
+
description: 'Suppress all output except errors.',
|
|
33
56
|
default: false,
|
|
34
57
|
}),
|
|
35
58
|
verbose: Flags.boolean({
|
|
36
59
|
char: 'v',
|
|
37
|
-
description: 'Show detailed progress including
|
|
60
|
+
description: 'Show detailed progress including per-package scanning info and skipped classes.',
|
|
38
61
|
default: false,
|
|
39
62
|
}),
|
|
40
63
|
}; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;aACzC,gBAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AC,MAAM,aAAa,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY,CAAC,CAAC;YAC5H,CAAC;QACL,CAAC;IACL,CAAC"}
|
|
@@ -9,6 +9,10 @@ export default class Migrate extends Command {
|
|
|
9
9
|
dir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Prints error details captured by OnProgress callbacks.
|
|
14
|
+
* Used when Skyway's result.Details is empty (transaction-level errors).
|
|
15
|
+
*/
|
|
16
|
+
private printCallbackErrors;
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAAuD;IAEzE,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAoG1B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAmC5B"}
|