@executor-js/cli 0.2.7 → 0.2.9
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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -26,9 +26,9 @@ var schemaGenerateAction = async (opts) => {
|
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
28
|
const [{ fumadb }, { drizzleAdapter }, { schema: fumaSchema }] = await Promise.all([
|
|
29
|
-
import("fumadb"),
|
|
30
|
-
import("fumadb/adapters/drizzle"),
|
|
31
|
-
import("fumadb/schema")
|
|
29
|
+
import("@executor-js/fumadb"),
|
|
30
|
+
import("@executor-js/fumadb/adapters/drizzle"),
|
|
31
|
+
import("@executor-js/fumadb/schema")
|
|
32
32
|
]);
|
|
33
33
|
const schema2 = fumaSchema({
|
|
34
34
|
version: opts.version,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/commands/schema.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport { schema } from \"./commands/schema.js\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nconst program = new Command(\"executor-sdk\")\n .version(\"0.0.1\")\n .description(\"Executor SDK CLI\")\n .addCommand(schema)\n .action(() => program.help());\n\nawait program.parseAsync();\n","import { existsSync } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Command } from \"commander\";\nimport { collectTables } from \"@executor-js/sdk/core\";\n\n// The executor's table set is fixed and plugin-independent (`collectTables()`),\n// so schema generation needs no `executor.config.ts` — only the target ORM\n// namespace/adapter/provider. The same tables render per database via flags.\n\ntype SchemaGenerateOptions = {\n readonly cwd: string;\n readonly output?: string;\n readonly namespace: string;\n readonly adapter: string;\n readonly provider: string;\n readonly version: string;\n};\n\nconst schemaGenerateAction = async (opts: SchemaGenerateOptions) => {\n const cwd = path.resolve(opts.cwd);\n if (!existsSync(cwd)) {\n console.error(`The directory \"${cwd}\" does not exist.`);\n process.exit(1);\n }\n\n if (opts.adapter !== \"drizzle\") {\n console.error(`Unsupported schema adapter \"${opts.adapter}\". Supported adapters: drizzle.`);\n process.exit(1);\n }\n if (opts.provider !== \"mysql\" && opts.provider !== \"postgresql\" && opts.provider !== \"sqlite\") {\n console.error(\n `Unsupported drizzle provider \"${opts.provider}\". Supported providers: mysql, postgresql, sqlite.`,\n );\n process.exit(1);\n }\n\n const [{ fumadb }, { drizzleAdapter }, { schema: fumaSchema }] = await Promise.all([\n import(\"fumadb\"),\n import(\"fumadb/adapters/drizzle\"),\n import(\"fumadb/schema\"),\n ]);\n\n const schema = fumaSchema({\n version: opts.version,\n tables: collectTables(),\n });\n const factory = fumadb({\n namespace: opts.namespace,\n schemas: [schema],\n });\n const generated = factory\n .client(\n drizzleAdapter({\n db: {},\n provider: opts.provider,\n }),\n )\n .generateSchema(\"latest\", opts.namespace);\n\n const output = opts.output ?? generated.path;\n const outPath = path.resolve(cwd, output);\n await fs.mkdir(path.dirname(outPath), { recursive: true });\n await fs.writeFile(outPath, generated.code);\n console.log(`Schema generated: ${path.relative(cwd, outPath)}`);\n};\n\nexport const schema = new Command(\"schema\")\n .description(\"Database schema utilities\")\n .addCommand(\n new Command(\"generate\")\n .description(\"Generate the ORM schema file for the executor's fixed table set\")\n .option(\"-c, --cwd <cwd>\", \"the working directory\", process.cwd())\n .option(\"--output <output>\", \"output file path for the generated schema\")\n .option(\"--namespace <namespace>\", \"FumaDB namespace\", \"executor\")\n .option(\"--adapter <adapter>\", \"FumaDB adapter\", \"drizzle\")\n .option(\"--provider <provider>\", \"database provider\", \"postgresql\")\n .option(\"--version <version>\", \"FumaDB schema version\", \"1.0.0\")\n .action(schemaGenerateAction),\n );\n"],"mappings":";;;AAEA,SAAS,WAAAA,gBAAe;;;ACFxB,SAAS,kBAAkB;AAC3B,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAe9B,IAAM,uBAAuB,OAAO,SAAgC;AAClE,QAAM,MAAM,KAAK,QAAQ,KAAK,GAAG;AACjC,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,YAAQ,MAAM,kBAAkB,GAAG,mBAAmB;AACtD,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,KAAK,YAAY,WAAW;AAC9B,YAAQ,MAAM,+BAA+B,KAAK,OAAO,iCAAiC;AAC1F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,MAAI,KAAK,aAAa,WAAW,KAAK,aAAa,gBAAgB,KAAK,aAAa,UAAU;AAC7F,YAAQ;AAAA,MACN,iCAAiC,KAAK,QAAQ;AAAA,IAChD;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,CAAC,EAAE,OAAO,GAAG,EAAE,eAAe,GAAG,EAAE,QAAQ,WAAW,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACjF,OAAO,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/schema.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport { schema } from \"./commands/schema.js\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nconst program = new Command(\"executor-sdk\")\n .version(\"0.0.1\")\n .description(\"Executor SDK CLI\")\n .addCommand(schema)\n .action(() => program.help());\n\nawait program.parseAsync();\n","import { existsSync } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Command } from \"commander\";\nimport { collectTables } from \"@executor-js/sdk/core\";\n\n// The executor's table set is fixed and plugin-independent (`collectTables()`),\n// so schema generation needs no `executor.config.ts` — only the target ORM\n// namespace/adapter/provider. The same tables render per database via flags.\n\ntype SchemaGenerateOptions = {\n readonly cwd: string;\n readonly output?: string;\n readonly namespace: string;\n readonly adapter: string;\n readonly provider: string;\n readonly version: string;\n};\n\nconst schemaGenerateAction = async (opts: SchemaGenerateOptions) => {\n const cwd = path.resolve(opts.cwd);\n if (!existsSync(cwd)) {\n console.error(`The directory \"${cwd}\" does not exist.`);\n process.exit(1);\n }\n\n if (opts.adapter !== \"drizzle\") {\n console.error(`Unsupported schema adapter \"${opts.adapter}\". Supported adapters: drizzle.`);\n process.exit(1);\n }\n if (opts.provider !== \"mysql\" && opts.provider !== \"postgresql\" && opts.provider !== \"sqlite\") {\n console.error(\n `Unsupported drizzle provider \"${opts.provider}\". Supported providers: mysql, postgresql, sqlite.`,\n );\n process.exit(1);\n }\n\n const [{ fumadb }, { drizzleAdapter }, { schema: fumaSchema }] = await Promise.all([\n import(\"@executor-js/fumadb\"),\n import(\"@executor-js/fumadb/adapters/drizzle\"),\n import(\"@executor-js/fumadb/schema\"),\n ]);\n\n const schema = fumaSchema({\n version: opts.version,\n tables: collectTables(),\n });\n const factory = fumadb({\n namespace: opts.namespace,\n schemas: [schema],\n });\n const generated = factory\n .client(\n drizzleAdapter({\n db: {},\n provider: opts.provider,\n }),\n )\n .generateSchema(\"latest\", opts.namespace);\n\n const output = opts.output ?? generated.path;\n const outPath = path.resolve(cwd, output);\n await fs.mkdir(path.dirname(outPath), { recursive: true });\n await fs.writeFile(outPath, generated.code);\n console.log(`Schema generated: ${path.relative(cwd, outPath)}`);\n};\n\nexport const schema = new Command(\"schema\")\n .description(\"Database schema utilities\")\n .addCommand(\n new Command(\"generate\")\n .description(\"Generate the ORM schema file for the executor's fixed table set\")\n .option(\"-c, --cwd <cwd>\", \"the working directory\", process.cwd())\n .option(\"--output <output>\", \"output file path for the generated schema\")\n .option(\"--namespace <namespace>\", \"FumaDB namespace\", \"executor\")\n .option(\"--adapter <adapter>\", \"FumaDB adapter\", \"drizzle\")\n .option(\"--provider <provider>\", \"database provider\", \"postgresql\")\n .option(\"--version <version>\", \"FumaDB schema version\", \"1.0.0\")\n .action(sch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AK,MAAM;AACxC,QAAM,GAAG,MAAM,KAAK,QAAQ,OAAO,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,QAAM,GAAG,UAAU,SAAS,UAAU,IAAI;AAC1C,UAAQ,IAAI,qBAAqB,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE;AAChE;AAEO,IAAM,SAAS,IAAI,QAAQ,QAAQ,EACvC,YAAY,2BAA2B,EACvC;AAAA,EACC,IAAI,QAAQ,UAAU,EACnB,YAAY,iEAAiE,EAC7E,OAAO,mBAAmB,yBAAyB,QAAQ,IAAI,CAAC,EAChE,OAAO,qBAAqB,2CAA2C,EACvE,OAAO,2BAA2B,oBAAoB,UAAU,EAChE,OAAO,uBAAuB,kBAAkB,SAAS,EACzD,OAAO,yBAAyB,qBAAqB,YAAY,EACjE,OAAO,uBAAuB,yBAAyB,OAAO,EAC9D,OAAO,oBAAoB;AAChC;;;AD1EF,QAAQ,GAAG,UAAU,MAAM,QAAQ,KAAK,CAAC,CAAC;AAC1C,QAAQ,GAAG,WAAW,MAAM,QAAQ,KAAK,CAAC,CAAC;AAE3C,IAAM,UAAU,IAAIC,SAAQ,cAAc,EACvC,QAAQ,OAAO,EACf,YAAY,kBAAkB,EAC9B,WAAW,MAAM,EACjB,OAAO,MAAM,QAAQ,KAAK,CAAC;AAE9B,MAAM,QAAQ,WAAW;","names":["Command","schema","Command"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@executor-js/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "CLI for the executor SDK — schema generation, migrations",
|
|
5
5
|
"homepage": "https://github.com/RhysSullivan/executor/tree/main/packages/core/cli",
|
|
6
6
|
"bugs": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@executor-js/sdk": "1.5.
|
|
40
|
+
"@executor-js/sdk": "1.5.3",
|
|
41
41
|
"commander": "^12.1.0",
|
|
42
42
|
"effect": "4.0.0-beta.59",
|
|
43
|
-
"fumadb": "
|
|
43
|
+
"@executor-js/fumadb": "1.5.3",
|
|
44
44
|
"jiti": "^2.6.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|