@memberjunction/cli 1.8.0 → 2.0.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 CHANGED
@@ -12,7 +12,7 @@ $ npm install -g @memberjunction/cli
12
12
  $ mj COMMAND
13
13
  running command...
14
14
  $ mj (--version)
15
- @memberjunction/cli/1.8.0 linux-x64 node-v20.14.0
15
+ @memberjunction/cli/2.0.0 darwin-arm64 node-v20.15.1
16
16
  $ mj --help [COMMAND]
17
17
  USAGE
18
18
  $ mj COMMAND
@@ -21,10 +21,54 @@ USAGE
21
21
  <!-- usagestop -->
22
22
  # Commands
23
23
  <!-- commands -->
24
+ * [`mj clean`](#mj-clean)
25
+ * [`mj codegen`](#mj-codegen)
24
26
  * [`mj help [COMMAND]`](#mj-help-command)
25
27
  * [`mj install`](#mj-install)
28
+ * [`mj migrate`](#mj-migrate)
29
+ * [`mj test`](#mj-test)
26
30
  * [`mj version`](#mj-version)
27
31
 
32
+ ## `mj clean`
33
+
34
+ Resets the MemberJunction database to a pre-installation state
35
+
36
+ ```
37
+ USAGE
38
+ $ mj clean [-v]
39
+
40
+ FLAGS
41
+ -v, --verbose Enable additional logging
42
+
43
+ DESCRIPTION
44
+ Resets the MemberJunction database to a pre-installation state
45
+
46
+ EXAMPLES
47
+ $ mj clean
48
+ ```
49
+
50
+ _See code: [src/commands/clean/index.ts](https://github.com/MemberJunction/MJ/blob/v2.0.0/src/commands/clean/index.ts)_
51
+
52
+ ## `mj codegen`
53
+
54
+ Runs the MemberJunction code generation
55
+
56
+ ```
57
+ USAGE
58
+ $ mj codegen [--skipdb]
59
+
60
+ FLAGS
61
+ --skipdb Enable additional logging
62
+
63
+ DESCRIPTION
64
+ Runs the MemberJunction code generation
65
+
66
+ EXAMPLES
67
+ $ mj codegen
68
+ ```
69
+
70
+ _See code: [src/commands/codegen/index.ts](https://github.com/MemberJunction/MJ/blob/v2.0.0/src/commands/codegen/index.ts)_
71
+
28
72
  ## `mj help [COMMAND]`
29
73
 
30
74
  Display help for mj.
@@ -43,7 +87,7 @@ DESCRIPTION
43
87
  Display help for mj.
44
88
  ```
45
89
 
46
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.0/src/commands/help.ts)_
90
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.3/src/commands/help.ts)_
47
91
 
48
92
  ## `mj install`
49
93
 
@@ -63,7 +107,47 @@ EXAMPLES
63
107
  $ mj install
64
108
  ```
65
109
 
66
- _See code: [src/commands/install/index.ts](https://github.com/MemberJunction/MJ/blob/v1.8.0/src/commands/install/index.ts)_
110
+ _See code: [src/commands/install/index.ts](https://github.com/MemberJunction/MJ/blob/v2.0.0/src/commands/install/index.ts)_
111
+
112
+ ## `mj migrate`
113
+
114
+ Migrate MemberJunction database to latest version
115
+
116
+ ```
117
+ USAGE
118
+ $ mj migrate [-v]
119
+
120
+ FLAGS
121
+ -v, --verbose Enable additional logging
122
+
123
+ DESCRIPTION
124
+ Migrate MemberJunction database to latest version
125
+
126
+ EXAMPLES
127
+ $ mj migrate
128
+ ```
129
+
130
+ _See code: [src/commands/migrate/index.ts](https://github.com/MemberJunction/MJ/blob/v2.0.0/src/commands/migrate/index.ts)_
131
+
132
+ ## `mj test`
133
+
134
+ An empty commad to test CLI debugging
135
+
136
+ ```
137
+ USAGE
138
+ $ mj test [-v]
139
+
140
+ FLAGS
141
+ -v, --verbose Enable additional logging
142
+
143
+ DESCRIPTION
144
+ An empty commad to test CLI debugging
145
+
146
+ EXAMPLES
147
+ $ mj test
148
+ ```
149
+
150
+ _See code: [src/commands/test/index.ts](https://github.com/MemberJunction/MJ/blob/v2.0.0/src/commands/test/index.ts)_
67
151
 
68
152
  ## `mj version`
69
153
 
@@ -83,5 +167,5 @@ FLAG DESCRIPTIONS
83
167
  Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
84
168
  ```
85
169
 
86
- _See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.2.2/src/commands/version.ts)_
170
+ _See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.2.4/src/commands/version.ts)_
87
171
  <!-- commandsstop -->
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ParserOutput } from '@oclif/core/lib/interfaces/parser';
3
+ export default class Clean extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ verbose: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
8
+ };
9
+ flags: ParserOutput<Clean>['flags'];
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const node_flyway_1 = require("node-flyway");
8
+ const config_1 = require("../../config");
9
+ const ora_classic_1 = __importDefault(require("ora-classic"));
10
+ class Clean extends core_1.Command {
11
+ static description = 'Resets the MemberJunction database to a pre-installation state';
12
+ static examples = [
13
+ `<%= config.bin %> <%= command.id %>
14
+ `,
15
+ ];
16
+ static flags = {
17
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'Enable additional logging' }),
18
+ };
19
+ flags;
20
+ async run() {
21
+ const parsed = await this.parse(Clean);
22
+ this.flags = parsed.flags;
23
+ if (!config_1.config) {
24
+ this.error('No configuration found');
25
+ }
26
+ const flywayConfig = (0, config_1.getFlywayConfig)(config_1.config);
27
+ const flyway = new node_flyway_1.Flyway(flywayConfig);
28
+ this.log('Resetting MJ database to pre-installation state');
29
+ this.log('Note that users and roles have not been dropped');
30
+ const spinner = (0, ora_classic_1.default)('Cleaning up...');
31
+ spinner.start();
32
+ const result = await flyway.clean();
33
+ if (result.success) {
34
+ spinner.succeed();
35
+ this.log(`The database has been reset. Schemas dropped:\n\t- ${result.flywayResponse?.schemasDropped.join('\n\t- ')}`);
36
+ }
37
+ else {
38
+ spinner.fail();
39
+ if (result.error) {
40
+ this.logToStderr(result.error.message);
41
+ if (this.flags.verbose) {
42
+ this.logToStderr(`ERROR CODE: ${result.error.errorCode}`);
43
+ this.logToStderr(result.error.stackTrace);
44
+ }
45
+ }
46
+ this.error('Command failed');
47
+ }
48
+ }
49
+ }
50
+ exports.default = Clean;
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ParserOutput } from '@oclif/core/lib/interfaces/parser';
3
+ export default class Codegen extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ skipdb: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
8
+ };
9
+ flags: ParserOutput<Codegen>['flags'];
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const dotenv_1 = __importDefault(require("dotenv"));
7
+ dotenv_1.default.config();
8
+ const codegen_lib_1 = require("@memberjunction/codegen-lib");
9
+ const core_1 = require("@oclif/core");
10
+ class Codegen extends core_1.Command {
11
+ static description = 'Runs the MemberJunction code generation';
12
+ static examples = [
13
+ `<%= config.bin %> <%= command.id %>
14
+ `,
15
+ ];
16
+ static flags = {
17
+ skipdb: core_1.Flags.boolean({ name: 'skipdb', description: 'Enable additional logging' }),
18
+ };
19
+ flags;
20
+ async run() {
21
+ const parsed = await this.parse(Codegen);
22
+ this.flags = parsed.flags;
23
+ // Initialize configuration
24
+ (0, codegen_lib_1.initializeConfig)(process.cwd());
25
+ // Call the function with the determined argument
26
+ (0, codegen_lib_1.runMemberJunctionCodeGeneration)(this.flags.skipdb);
27
+ }
28
+ }
29
+ exports.default = Codegen;
@@ -28,12 +28,12 @@ declare const configSchema: z.ZodObject<{
28
28
  anthropicAPIKey: z.ZodOptional<z.ZodString>;
29
29
  mistralAPIKey: z.ZodOptional<z.ZodString>;
30
30
  }, "strip", z.ZodTypeAny, {
31
- dbUrl: string;
32
- dbInstance: string;
33
- dbTrustServerCertificate: "N" | "Y";
34
31
  dbDatabase: string;
35
32
  dbPort: number;
36
33
  codeGenLogin: string;
34
+ dbTrustServerCertificate: "Y" | "N";
35
+ dbUrl: string;
36
+ dbInstance: string;
37
37
  codeGenPwD: string;
38
38
  mjAPILogin: string;
39
39
  mjAPIPwD: string;
@@ -45,7 +45,7 @@ declare const configSchema: z.ZodObject<{
45
45
  auth0ClientId?: string | undefined;
46
46
  auth0ClientSecret?: string | undefined;
47
47
  auth0Domain?: string | undefined;
48
- createNewUser?: "N" | "Y" | undefined;
48
+ createNewUser?: "Y" | "N" | undefined;
49
49
  userFirstName?: string | undefined;
50
50
  userLastName?: string | undefined;
51
51
  userName?: string | undefined;
@@ -53,12 +53,12 @@ declare const configSchema: z.ZodObject<{
53
53
  anthropicAPIKey?: string | undefined;
54
54
  mistralAPIKey?: string | undefined;
55
55
  }, {
56
- dbUrl: string;
57
- dbInstance: string;
58
- dbTrustServerCertificate: "N" | "Y";
59
56
  dbDatabase: string;
60
57
  dbPort: number;
61
58
  codeGenLogin: string;
59
+ dbTrustServerCertificate: "Y" | "N";
60
+ dbUrl: string;
61
+ dbInstance: string;
62
62
  codeGenPwD: string;
63
63
  mjAPILogin: string;
64
64
  mjAPIPwD: string;
@@ -69,7 +69,7 @@ declare const configSchema: z.ZodObject<{
69
69
  auth0ClientId?: string | undefined;
70
70
  auth0ClientSecret?: string | undefined;
71
71
  auth0Domain?: string | undefined;
72
- createNewUser?: "N" | "Y" | undefined;
72
+ createNewUser?: "Y" | "N" | undefined;
73
73
  userEmail?: string | undefined;
74
74
  userFirstName?: string | undefined;
75
75
  userLastName?: string | undefined;
@@ -88,12 +88,12 @@ export default class Install extends Command {
88
88
  userConfig: Config;
89
89
  run(): Promise<void>;
90
90
  getUserConfiguration(): Promise<{
91
- dbUrl: string;
92
- dbInstance: string;
93
- dbTrustServerCertificate: "N" | "Y";
94
91
  dbDatabase: string;
95
92
  dbPort: number;
96
93
  codeGenLogin: string;
94
+ dbTrustServerCertificate: "Y" | "N";
95
+ dbUrl: string;
96
+ dbInstance: string;
97
97
  codeGenPwD: string;
98
98
  mjAPILogin: string;
99
99
  mjAPIPwD: string;
@@ -105,7 +105,7 @@ export default class Install extends Command {
105
105
  auth0ClientId?: string | undefined;
106
106
  auth0ClientSecret?: string | undefined;
107
107
  auth0Domain?: string | undefined;
108
- createNewUser?: "N" | "Y" | undefined;
108
+ createNewUser?: "Y" | "N" | undefined;
109
109
  userFirstName?: string | undefined;
110
110
  userLastName?: string | undefined;
111
111
  userName?: string | undefined;
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ParserOutput } from '@oclif/core/lib/interfaces/parser';
3
+ export default class Migrate extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ verbose: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
8
+ };
9
+ flags: ParserOutput<Migrate>['flags'];
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const node_flyway_1 = require("node-flyway");
8
+ const config_1 = require("../../config");
9
+ const ora_classic_1 = __importDefault(require("ora-classic"));
10
+ class Migrate extends core_1.Command {
11
+ static description = 'Migrate MemberJunction database to latest version';
12
+ static examples = [
13
+ `<%= config.bin %> <%= command.id %>
14
+ `,
15
+ ];
16
+ static flags = {
17
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'Enable additional logging' }),
18
+ };
19
+ flags;
20
+ async run() {
21
+ const parsed = await this.parse(Migrate);
22
+ this.flags = parsed.flags;
23
+ if (!config_1.config) {
24
+ this.error('No configuration found');
25
+ }
26
+ const flywayConfig = (0, config_1.getFlywayConfig)(config_1.config);
27
+ const flyway = new node_flyway_1.Flyway(flywayConfig);
28
+ if (this.flags.verbose) {
29
+ this.log(`Connecting to ${flywayConfig.url}`);
30
+ this.log(`Migrating ${config_1.config.coreSchema} schema using migrations from:\n\t- ${flywayConfig.migrationLocations.join('\n\t- ')}\n`);
31
+ }
32
+ const spinner = (0, ora_classic_1.default)('Running migrations...');
33
+ spinner.start();
34
+ const result = await flyway.migrate();
35
+ if (result.success) {
36
+ spinner.succeed();
37
+ this.log(`Migrations complete in ${result.additionalDetails.executionTime / 1000}s`);
38
+ if (result.flywayResponse?.success && this.flags.verbose) {
39
+ this.log(`\tUpdated to ${result.flywayResponse?.targetSchemaVersion}`);
40
+ }
41
+ }
42
+ else {
43
+ spinner.fail();
44
+ if (result.error) {
45
+ this.logToStderr(result.error.message);
46
+ if (this.flags.verbose) {
47
+ this.logToStderr(`ERROR CODE: ${result.error.errorCode}`);
48
+ this.logToStderr(result.error.stackTrace);
49
+ }
50
+ }
51
+ this.error('Migrations failed');
52
+ }
53
+ }
54
+ }
55
+ exports.default = Migrate;
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ParserOutput } from '@oclif/core/lib/interfaces/parser';
3
+ export default class Test extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ verbose: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
8
+ };
9
+ flags: ParserOutput<Test>['flags'];
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const codegen_lib_1 = require("@memberjunction/codegen-lib");
4
+ const core_1 = require("@oclif/core");
5
+ class Test extends core_1.Command {
6
+ static description = 'An empty commad to test CLI debugging';
7
+ static examples = [
8
+ `<%= config.bin %> <%= command.id %>
9
+ `,
10
+ ];
11
+ static flags = {
12
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'Enable additional logging' }),
13
+ };
14
+ flags;
15
+ async run() {
16
+ const parsed = await this.parse(Test);
17
+ this.flags = parsed.flags;
18
+ (0, codegen_lib_1.logStatus)('It works!');
19
+ this.log('Test complete!');
20
+ }
21
+ }
22
+ exports.default = Test;
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import { FlywayConfig } from 'node-flyway/dist/types/types';
3
+ export type MJConfig = z.infer<typeof mjConfigSchema>;
4
+ declare const mjConfigSchema: z.ZodObject<{
5
+ dbHost: z.ZodDefault<z.ZodString>;
6
+ dbDatabase: z.ZodString;
7
+ dbPort: z.ZodDefault<z.ZodNumber>;
8
+ codeGenLogin: z.ZodString;
9
+ codeGenPassword: z.ZodString;
10
+ migrationsLocation: z.ZodDefault<z.ZodOptional<z.ZodString>>;
11
+ dbTrustServerCertificate: z.ZodDefault<z.ZodEnum<["Y", "N"]>>;
12
+ coreSchema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
13
+ cleanDisabled: z.ZodDefault<z.ZodBoolean>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ cleanDisabled: boolean;
16
+ dbHost: string;
17
+ dbDatabase: string;
18
+ dbPort: number;
19
+ codeGenLogin: string;
20
+ codeGenPassword: string;
21
+ migrationsLocation: string;
22
+ dbTrustServerCertificate: "Y" | "N";
23
+ coreSchema: string;
24
+ }, {
25
+ dbDatabase: string;
26
+ codeGenLogin: string;
27
+ codeGenPassword: string;
28
+ cleanDisabled?: boolean | undefined;
29
+ dbHost?: string | undefined;
30
+ dbPort?: number | undefined;
31
+ migrationsLocation?: string | undefined;
32
+ dbTrustServerCertificate?: "Y" | "N" | undefined;
33
+ coreSchema?: string | undefined;
34
+ }>;
35
+ export declare const config: {
36
+ cleanDisabled: boolean;
37
+ dbHost: string;
38
+ dbDatabase: string;
39
+ dbPort: number;
40
+ codeGenLogin: string;
41
+ codeGenPassword: string;
42
+ migrationsLocation: string;
43
+ dbTrustServerCertificate: "Y" | "N";
44
+ coreSchema: string;
45
+ } | undefined;
46
+ export declare const createFlywayUrl: (mjConfig: MJConfig) => string;
47
+ export declare const getFlywayConfig: (mjConfig: MJConfig) => FlywayConfig;
48
+ export {};
package/dist/config.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFlywayConfig = exports.createFlywayUrl = exports.config = void 0;
4
+ const zod_1 = require("zod");
5
+ const cosmiconfig_1 = require("cosmiconfig");
6
+ const explorer = (0, cosmiconfig_1.cosmiconfigSync)('mj');
7
+ const result = explorer.search(process.cwd());
8
+ const mjConfigSchema = zod_1.z.object({
9
+ dbHost: zod_1.z.string().default('localhost'),
10
+ dbDatabase: zod_1.z.string(),
11
+ dbPort: zod_1.z.number({ coerce: true }).default(1433),
12
+ codeGenLogin: zod_1.z.string(),
13
+ codeGenPassword: zod_1.z.string(),
14
+ migrationsLocation: zod_1.z.string().optional().default('filesystem:./migrations'),
15
+ dbTrustServerCertificate: zod_1.z.enum(['Y', 'N']).default('Y'),
16
+ coreSchema: zod_1.z.string().optional().default('__mj'),
17
+ cleanDisabled: zod_1.z.boolean().default(true),
18
+ });
19
+ const parsedConfig = mjConfigSchema.safeParse(result?.config);
20
+ exports.config = parsedConfig.success ? parsedConfig.data : undefined;
21
+ const createFlywayUrl = (mjConfig) => {
22
+ return `jdbc:sqlserver://${mjConfig.dbHost}:${mjConfig.dbPort}; databaseName=${mjConfig.dbDatabase}${mjConfig.dbTrustServerCertificate === 'Y' ? '; trustServerCertificate=true' : ''}`;
23
+ };
24
+ exports.createFlywayUrl = createFlywayUrl;
25
+ const getFlywayConfig = (mjConfig) => ({
26
+ url: (0, exports.createFlywayUrl)(mjConfig),
27
+ user: mjConfig.codeGenLogin,
28
+ password: mjConfig.codeGenPassword,
29
+ migrationLocations: [mjConfig.migrationsLocation],
30
+ advanced: { schemas: [mjConfig.coreSchema], cleanDisabled: mjConfig.cleanDisabled === false ? false : undefined },
31
+ });
32
+ exports.getFlywayConfig = getFlywayConfig;
@@ -0,0 +1,3 @@
1
+ import { Hook } from '@oclif/core';
2
+ declare const hook: Hook<'init'>;
3
+ export default hook;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const figlet_1 = __importDefault(require("figlet"));
7
+ const hook = async function (options) {
8
+ console.log(figlet_1.default.textSync('MemberJunction', {
9
+ font: 'Standard',
10
+ horizontalLayout: 'default',
11
+ verticalLayout: 'default',
12
+ width: 100,
13
+ whitespaceBreak: true,
14
+ }));
15
+ };
16
+ exports.default = hook;
@@ -1,5 +1,68 @@
1
1
  {
2
2
  "commands": {
3
+ "clean": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Resets the MemberJunction database to a pre-installation state",
7
+ "examples": [
8
+ "<%= config.bin %> <%= command.id %>\n"
9
+ ],
10
+ "flags": {
11
+ "verbose": {
12
+ "char": "v",
13
+ "description": "Enable additional logging",
14
+ "name": "verbose",
15
+ "allowNo": false,
16
+ "type": "boolean"
17
+ }
18
+ },
19
+ "hasDynamicHelp": false,
20
+ "hiddenAliases": [],
21
+ "id": "clean",
22
+ "pluginAlias": "@memberjunction/cli",
23
+ "pluginName": "@memberjunction/cli",
24
+ "pluginType": "core",
25
+ "strict": true,
26
+ "enableJsonFlag": false,
27
+ "isESM": false,
28
+ "relativePath": [
29
+ "dist",
30
+ "commands",
31
+ "clean",
32
+ "index.js"
33
+ ]
34
+ },
35
+ "codegen": {
36
+ "aliases": [],
37
+ "args": {},
38
+ "description": "Runs the MemberJunction code generation",
39
+ "examples": [
40
+ "<%= config.bin %> <%= command.id %>\n"
41
+ ],
42
+ "flags": {
43
+ "skipdb": {
44
+ "description": "Enable additional logging",
45
+ "name": "skipdb",
46
+ "allowNo": false,
47
+ "type": "boolean"
48
+ }
49
+ },
50
+ "hasDynamicHelp": false,
51
+ "hiddenAliases": [],
52
+ "id": "codegen",
53
+ "pluginAlias": "@memberjunction/cli",
54
+ "pluginName": "@memberjunction/cli",
55
+ "pluginType": "core",
56
+ "strict": true,
57
+ "enableJsonFlag": false,
58
+ "isESM": false,
59
+ "relativePath": [
60
+ "dist",
61
+ "commands",
62
+ "codegen",
63
+ "index.js"
64
+ ]
65
+ },
3
66
  "install": {
4
67
  "aliases": [],
5
68
  "args": {},
@@ -31,7 +94,71 @@
31
94
  "install",
32
95
  "index.js"
33
96
  ]
97
+ },
98
+ "migrate": {
99
+ "aliases": [],
100
+ "args": {},
101
+ "description": "Migrate MemberJunction database to latest version",
102
+ "examples": [
103
+ "<%= config.bin %> <%= command.id %>\n"
104
+ ],
105
+ "flags": {
106
+ "verbose": {
107
+ "char": "v",
108
+ "description": "Enable additional logging",
109
+ "name": "verbose",
110
+ "allowNo": false,
111
+ "type": "boolean"
112
+ }
113
+ },
114
+ "hasDynamicHelp": false,
115
+ "hiddenAliases": [],
116
+ "id": "migrate",
117
+ "pluginAlias": "@memberjunction/cli",
118
+ "pluginName": "@memberjunction/cli",
119
+ "pluginType": "core",
120
+ "strict": true,
121
+ "enableJsonFlag": false,
122
+ "isESM": false,
123
+ "relativePath": [
124
+ "dist",
125
+ "commands",
126
+ "migrate",
127
+ "index.js"
128
+ ]
129
+ },
130
+ "test": {
131
+ "aliases": [],
132
+ "args": {},
133
+ "description": "An empty commad to test CLI debugging",
134
+ "examples": [
135
+ "<%= config.bin %> <%= command.id %>\n"
136
+ ],
137
+ "flags": {
138
+ "verbose": {
139
+ "char": "v",
140
+ "description": "Enable additional logging",
141
+ "name": "verbose",
142
+ "allowNo": false,
143
+ "type": "boolean"
144
+ }
145
+ },
146
+ "hasDynamicHelp": false,
147
+ "hiddenAliases": [],
148
+ "id": "test",
149
+ "pluginAlias": "@memberjunction/cli",
150
+ "pluginName": "@memberjunction/cli",
151
+ "pluginType": "core",
152
+ "strict": true,
153
+ "enableJsonFlag": false,
154
+ "isESM": false,
155
+ "relativePath": [
156
+ "dist",
157
+ "commands",
158
+ "test",
159
+ "index.js"
160
+ ]
34
161
  }
35
162
  },
36
- "version": "1.8.0"
163
+ "version": "2.0.0"
37
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/cli",
3
- "version": "1.8.0",
3
+ "version": "2.0.0",
4
4
  "description": "MemberJunction command line tools",
5
5
  "keywords": [
6
6
  "oclif"
@@ -26,7 +26,7 @@
26
26
  "/oclif.manifest.json"
27
27
  ],
28
28
  "scripts": {
29
- "build": "rimraf dist && tsc -b",
29
+ "build": "tsc -b",
30
30
  "prepack": "npm run build && oclif manifest && oclif readme",
31
31
  "postpack": "rimraf oclif.manifest.json",
32
32
  "version": "oclif readme && git add README.md"
@@ -34,6 +34,9 @@
34
34
  "oclif": {
35
35
  "bin": "mj",
36
36
  "commands": "./dist/commands",
37
+ "hooks": {
38
+ "init": "./dist/hooks/init"
39
+ },
37
40
  "dirname": "mj",
38
41
  "plugins": [
39
42
  "@oclif/plugin-help",
@@ -46,15 +49,22 @@
46
49
  },
47
50
  "dependencies": {
48
51
  "@inquirer/prompts": "^5.0.1",
52
+ "@memberjunction/codegen-lib": "2.0.0",
49
53
  "@oclif/core": "^3",
50
54
  "@oclif/plugin-help": "^6",
51
55
  "@oclif/plugin-version": "^2.0.17",
52
56
  "@oclif/plugin-warn-if-update-available": "^3.0.16",
57
+ "cosmiconfig": "9.0.0",
58
+ "dotenv": "16.4.5",
59
+ "figlet": "^1.7.0",
53
60
  "fs-extra": "^11.2.0",
61
+ "node-flyway": "0.0.10",
62
+ "ora-classic": "^5.4.2",
54
63
  "zod": "^3.23.4"
55
64
  },
56
65
  "devDependencies": {
57
66
  "@oclif/prettier-config": "^0.2.1",
67
+ "@types/figlet": "^1.5.8",
58
68
  "@types/fs-extra": "^11.0.4",
59
69
  "oclif": "^4",
60
70
  "rimraf": "5.0.7",