@powerhousedao/ph-cli 3.3.0-dev.1 → 3.3.0-dev.11
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/package.json +1 -1
- package/dist/src/commands/generate.d.ts.map +1 -1
- package/dist/src/commands/generate.js +3 -1
- package/dist/src/commands/generate.js.map +1 -1
- package/dist/src/help.d.ts +1 -1
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +5 -0
- package/dist/src/help.js.map +1 -1
- package/dist/src/services/generate.d.ts +2 -0
- package/dist/src/services/generate.d.ts.map +1 -1
- package/dist/src/services/generate.js +11 -1
- package/dist/src/services/generate.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +9 -9
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAYrD,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CACtC;IAAC,MAAM,GAAG,SAAS;IAAE,eAAe;CAAC,CAGtC,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAYrD,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CACtC;IAAC,MAAM,GAAG,SAAS;IAAE,eAAe;CAAC,CAGtC,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,QAgC/C"}
|
|
@@ -26,7 +26,9 @@ export function generateCommand(program) {
|
|
|
26
26
|
.option("-is, --import-script <type>", "Import Script Name")
|
|
27
27
|
.option("-sf, --skip-format", "Skip formatting the generated code")
|
|
28
28
|
.option("-w, --watch", "Watch the generated code")
|
|
29
|
-
.option("-d, --drive-editor <name>", "Generate a drive editor with the specified name")
|
|
29
|
+
.option("-d, --drive-editor <name>", "Generate a drive editor with the specified name")
|
|
30
|
+
.option("--migration-file <path>", "Path to the migration file")
|
|
31
|
+
.option("--schema-file <path>", "Path to the output file. Defaults to './schema.ts'");
|
|
30
32
|
// Use the setCustomHelp utility to apply custom help formatting
|
|
31
33
|
setCustomHelp(cmd, generateHelp);
|
|
32
34
|
cmd.action(generate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,aAAa,CAC1B,QAA4B,EAC5B,OAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACzD,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IACnC,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAEjB,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAC9B,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,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,gEAAgE;IAChE,aAAa,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAEjC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/src/help.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const connectPreviewHelp = "\nCommand Overview:\n The Connect pr
|
|
|
13
13
|
/**
|
|
14
14
|
* Help text for the generate command
|
|
15
15
|
*/
|
|
16
|
-
export declare const generateHelp = "\nCommand Overview:\n The generate command creates code from document models. It helps you build editors, \n processors, and other components based on your document model files.\n\n This command:\n 1. Reads document model definitions\n 2. Generates code for specified components (editors, processors, etc.)\n 3. Supports customization of output and generation options\n 4. Can watch files for changes and regenerate code automatically\n\nArguments:\n [document-model-file] Optional. Path to the document model file to generate code from.\n If not provided, the command will look for document models in\n the default location.\n\nOptions:\n -i, --interactive Run the command in interactive mode, which will guide you\n through the generation process with prompts and options.\n \n --editors <path> Path to the directory where editors should be generated or found.\n \n -e, --editor <name> Name of the editor to generate or use.\n \n --file <path> Specific file path to the document model.\n \n --processors <path> Path to the directory where processors should be generated or found.\n \n -p, --processor <name> Name of the processor to generate.\n \n --processor-type <type> Type of processor to generate.\n \n -s, --subgraph <name> Name of the subgraph to use or create.\n \n --document-models <path> Path to the document models directory.\n \n --document-types <types> Document types supported by the editor, in the format\n 'namespace/type' (e.g., 'powerhouse/todo').\n \n -is, --import-script <name> Name of the import script to generate.\n \n -sf, --skip-format Skip formatting the generated code.\n \n -w, --watch Watch for changes in the document model and regenerate code\n when changes are detected.\n \n -d, --drive-editor <name> Generate a drive editor with the specified name.\n\nExamples:\n $ ph generate # Generate code using defaults\n $ ph generate my-document-model.zip # Generate from a specific model zip file\n $ ph generate -i # Run in interactive mode\n $ ph generate --editor ToDoList --document-types powerhouse/todo # Generate a ToDoList editor for todo documents\n $ ph generate -p MyProcessor # Generate a specific processor\n $ ph generate --watch # Generate and watch for changes\n $ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor\n $ ph generate -s MySubgraph # Generate with a specific subgraph\n $ ph generate --skip-format # Generate without formatting\n";
|
|
16
|
+
export declare const generateHelp = "\nCommand Overview:\n The generate command creates code from document models. It helps you build editors, \n processors, and other components based on your document model files.\n\n This command:\n 1. Reads document model definitions\n 2. Generates code for specified components (editors, processors, etc.)\n 3. Supports customization of output and generation options\n 4. Can watch files for changes and regenerate code automatically\n\nArguments:\n [document-model-file] Optional. Path to the document model file to generate code from.\n If not provided, the command will look for document models in\n the default location.\n\nOptions:\n -i, --interactive Run the command in interactive mode, which will guide you\n through the generation process with prompts and options.\n \n --editors <path> Path to the directory where editors should be generated or found.\n \n -e, --editor <name> Name of the editor to generate or use.\n \n --file <path> Specific file path to the document model.\n \n --processors <path> Path to the directory where processors should be generated or found.\n \n -p, --processor <name> Name of the processor to generate.\n \n --processor-type <type> Type of processor to generate.\n \n -s, --subgraph <name> Name of the subgraph to use or create.\n \n --document-models <path> Path to the document models directory.\n \n --document-types <types> Document types supported by the editor, in the format\n 'namespace/type' (e.g., 'powerhouse/todo').\n \n -is, --import-script <name> Name of the import script to generate.\n \n -sf, --skip-format Skip formatting the generated code.\n \n -w, --watch Watch for changes in the document model and regenerate code\n when changes are detected.\n \n -d, --drive-editor <name> Generate a drive editor with the specified name.\n\n --migration-file <path> Path to the migration file when running 'ph generate\n \n --schema-file <path> Path to the output file. Defaults to 'schema.ts' at the same directory of the migration file.\n\nExamples:\n $ ph generate # Generate code using defaults\n $ ph generate my-document-model.zip # Generate from a specific model zip file\n $ ph generate -i # Run in interactive mode\n $ ph generate --editor ToDoList --document-types powerhouse/todo # Generate a ToDoList editor for todo documents\n $ ph generate -p MyProcessor # Generate a specific processor\n $ ph generate --watch # Generate and watch for changes\n $ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor\n $ ph generate -s MySubgraph # Generate with a specific subgraph\n $ ph generate --skip-format # Generate without formatting\n $ ph generate --migration-file ./migrations.ts # Generate types for an Operational Processor\n";
|
|
17
17
|
/**
|
|
18
18
|
* Help text for the install command
|
|
19
19
|
*/
|
package/dist/src/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,itDAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,yrBAW5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,gcAU9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,itDAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,yrBAW5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,gcAU9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,m9GA+DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+zDAqCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,ixDAoC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,s6DAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2kCA0BvB,CAAC"}
|
package/dist/src/help.js
CHANGED
|
@@ -117,6 +117,10 @@ Options:
|
|
|
117
117
|
|
|
118
118
|
-d, --drive-editor <name> Generate a drive editor with the specified name.
|
|
119
119
|
|
|
120
|
+
--migration-file <path> Path to the migration file when running 'ph generate
|
|
121
|
+
|
|
122
|
+
--schema-file <path> Path to the output file. Defaults to 'schema.ts' at the same directory of the migration file.
|
|
123
|
+
|
|
120
124
|
Examples:
|
|
121
125
|
$ ph generate # Generate code using defaults
|
|
122
126
|
$ ph generate my-document-model.zip # Generate from a specific model zip file
|
|
@@ -127,6 +131,7 @@ Examples:
|
|
|
127
131
|
$ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor
|
|
128
132
|
$ ph generate -s MySubgraph # Generate with a specific subgraph
|
|
129
133
|
$ ph generate --skip-format # Generate without formatting
|
|
134
|
+
$ ph generate --migration-file ./migrations.ts # Generate types for an Operational Processor
|
|
130
135
|
`;
|
|
131
136
|
/**
|
|
132
137
|
* Help text for the install command
|
package/dist/src/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mCAAmC,EACnC,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;2EAO2C,uBAAuB;6FACL,mCAAmC;uEACzD,wBAAwB;;CAE9F,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;CAUjC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mCAAmC,EACnC,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB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F;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC"}
|
|
@@ -13,6 +13,8 @@ export type GenerateOptions = {
|
|
|
13
13
|
importScript?: string;
|
|
14
14
|
file?: string;
|
|
15
15
|
driveEditor?: string;
|
|
16
|
+
migrationFile?: string;
|
|
17
|
+
schemaFile?: string;
|
|
16
18
|
};
|
|
17
19
|
export declare function startGenerate(filePath: string | undefined, options: GenerateOptions): Promise<void>;
|
|
18
20
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/services/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/services/generate.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,eAAe,iBAyEzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { generate as generateCode, generateDriveEditor, generateEditor, generateFromFile, generateImportScript, generateProcessor, generateSubgraph, } from "@powerhousedao/codegen";
|
|
1
|
+
import { generate as generateCode, generateDBSchema, generateDriveEditor, generateEditor, generateFromFile, generateImportScript, generateProcessor, generateSubgraph, } from "@powerhousedao/codegen";
|
|
2
2
|
import { getConfig } from "@powerhousedao/config/utils";
|
|
3
|
+
import path from "path";
|
|
3
4
|
export async function startGenerate(filePath, options) {
|
|
4
5
|
const baseConfig = getConfig();
|
|
5
6
|
const config = {
|
|
@@ -28,6 +29,8 @@ export async function startGenerate(filePath, options) {
|
|
|
28
29
|
importScriptName: options.importScript,
|
|
29
30
|
driveEditor: !!options.driveEditor,
|
|
30
31
|
driveEditorName: options.driveEditor,
|
|
32
|
+
migrationFile: options.migrationFile,
|
|
33
|
+
schemaFile: options.schemaFile,
|
|
31
34
|
};
|
|
32
35
|
if (command.driveEditor) {
|
|
33
36
|
if (!command.driveEditorName) {
|
|
@@ -51,6 +54,13 @@ export async function startGenerate(filePath, options) {
|
|
|
51
54
|
else if (command.importScript && command.importScriptName) {
|
|
52
55
|
await generateImportScript(command.importScriptName, config);
|
|
53
56
|
}
|
|
57
|
+
else if (command.migrationFile) {
|
|
58
|
+
const { migrationFile, schemaFile } = command;
|
|
59
|
+
await generateDBSchema({
|
|
60
|
+
migrationFile: path.join(process.cwd(), migrationFile),
|
|
61
|
+
schemaFile: schemaFile ? path.join(process.cwd(), schemaFile) : undefined,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
54
64
|
else if (filePath) {
|
|
55
65
|
await generateFromFile(filePath, config);
|
|
56
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/services/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,mBAAmB,EACnB,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# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
|
package/dist/src/version.js
CHANGED
package/dist/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC"}
|