@corpdk/create-ds 2026.10.0-alpha.4 → 2026.10.0-alpha.5
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/args.d.ts +8 -0
- package/dist/chunk-QT2CKMO4.js +71 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -65
- package/dist/init.d.ts +7 -0
- package/dist/package-merge.d.ts +19 -0
- package/dist/template.d.ts +16 -0
- package/dist/types-entry.d.ts +2 -0
- package/dist/types-entry.js +9 -0
- package/dist/upgrade.d.ts +5 -0
- package/dist/utils.d.ts +11 -0
- package/package.json +9 -2
package/dist/args.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/args.ts
|
|
4
|
+
function printHelp() {
|
|
5
|
+
console.log(`@corpdk/create-ds \u2014 scaffold and upgrade DAL-automated DS packages
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
create-ds init [directory] [options]
|
|
9
|
+
create-ds upgrade [directory] [options]
|
|
10
|
+
|
|
11
|
+
Commands:
|
|
12
|
+
init Scaffold a minimal DS package (Drizzle schema + dal.config + scripts)
|
|
13
|
+
upgrade Merge canonical template deltas; never overwrites src/db/schema/**
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--name <pkg> npm package name (default: @corpdk/ds)
|
|
17
|
+
--demo-schema Copy full demo commerce schema + seed from templates/ds
|
|
18
|
+
-h, --help Show this help
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
create-ds init ./packages/my-ds --name @myorg/my-ds
|
|
22
|
+
create-ds upgrade ./packages/my-ds
|
|
23
|
+
create-ds upgrade # upgrades current working directory
|
|
24
|
+
`);
|
|
25
|
+
}
|
|
26
|
+
function parseArgs(argv) {
|
|
27
|
+
const args = argv.slice(2);
|
|
28
|
+
const result = {
|
|
29
|
+
command: null,
|
|
30
|
+
targetDir: process.cwd(),
|
|
31
|
+
packageName: "@corpdk/ds",
|
|
32
|
+
withDemoSchema: false
|
|
33
|
+
};
|
|
34
|
+
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
35
|
+
result.command = "help";
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
const cmd = args[0];
|
|
39
|
+
if (cmd === "init" || cmd === "upgrade") {
|
|
40
|
+
result.command = cmd;
|
|
41
|
+
} else {
|
|
42
|
+
result.command = "help";
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
let i = 1;
|
|
46
|
+
while (i < args.length) {
|
|
47
|
+
const arg = args[i];
|
|
48
|
+
if (arg === "--name" && args[i + 1]) {
|
|
49
|
+
result.packageName = args[++i];
|
|
50
|
+
i++;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (arg === "--demo-schema") {
|
|
54
|
+
result.withDemoSchema = true;
|
|
55
|
+
i++;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (!arg.startsWith("-")) {
|
|
59
|
+
result.targetDir = arg;
|
|
60
|
+
i++;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
i++;
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
printHelp,
|
|
70
|
+
parseArgs
|
|
71
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
parseArgs,
|
|
4
|
+
printHelp
|
|
5
|
+
} from "./chunk-QT2CKMO4.js";
|
|
2
6
|
import {
|
|
3
7
|
copyDir,
|
|
4
8
|
execAsync,
|
|
@@ -10,71 +14,6 @@ import {
|
|
|
10
14
|
// src/index.ts
|
|
11
15
|
import { outro } from "@clack/prompts";
|
|
12
16
|
|
|
13
|
-
// src/args.ts
|
|
14
|
-
function printHelp() {
|
|
15
|
-
console.log(`@corpdk/create-ds \u2014 scaffold and upgrade DAL-automated DS packages
|
|
16
|
-
|
|
17
|
-
Usage:
|
|
18
|
-
create-ds init [directory] [options]
|
|
19
|
-
create-ds upgrade [directory] [options]
|
|
20
|
-
|
|
21
|
-
Commands:
|
|
22
|
-
init Scaffold a minimal DS package (Drizzle schema + dal.config + scripts)
|
|
23
|
-
upgrade Merge canonical template deltas; never overwrites src/db/schema/**
|
|
24
|
-
|
|
25
|
-
Options:
|
|
26
|
-
--name <pkg> npm package name (default: @corpdk/ds)
|
|
27
|
-
--demo-schema Copy full demo commerce schema + seed from templates/ds
|
|
28
|
-
-h, --help Show this help
|
|
29
|
-
|
|
30
|
-
Examples:
|
|
31
|
-
create-ds init ./packages/my-ds --name @myorg/my-ds
|
|
32
|
-
create-ds upgrade ./packages/my-ds
|
|
33
|
-
create-ds upgrade # upgrades current working directory
|
|
34
|
-
`);
|
|
35
|
-
}
|
|
36
|
-
function parseArgs(argv) {
|
|
37
|
-
const args = argv.slice(2);
|
|
38
|
-
const result = {
|
|
39
|
-
command: null,
|
|
40
|
-
targetDir: process.cwd(),
|
|
41
|
-
packageName: "@corpdk/ds",
|
|
42
|
-
withDemoSchema: false
|
|
43
|
-
};
|
|
44
|
-
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
45
|
-
result.command = "help";
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
const cmd = args[0];
|
|
49
|
-
if (cmd === "init" || cmd === "upgrade") {
|
|
50
|
-
result.command = cmd;
|
|
51
|
-
} else {
|
|
52
|
-
result.command = "help";
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
let i = 1;
|
|
56
|
-
while (i < args.length) {
|
|
57
|
-
const arg = args[i];
|
|
58
|
-
if (arg === "--name" && args[i + 1]) {
|
|
59
|
-
result.packageName = args[++i];
|
|
60
|
-
i++;
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (arg === "--demo-schema") {
|
|
64
|
-
result.withDemoSchema = true;
|
|
65
|
-
i++;
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
if (!arg.startsWith("-")) {
|
|
69
|
-
result.targetDir = arg;
|
|
70
|
-
i++;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
i++;
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
17
|
// src/init.ts
|
|
79
18
|
import fs2 from "fs/promises";
|
|
80
19
|
import path2 from "path";
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type PkgJson = {
|
|
2
|
+
name?: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
publishConfig?: Record<string, string>;
|
|
6
|
+
scripts?: Record<string, string>;
|
|
7
|
+
dependencies?: Record<string, string>;
|
|
8
|
+
devDependencies?: Record<string, string>;
|
|
9
|
+
type?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
/** Invoke dal-codegen via installed package (works before pnpm .bin links exist). */
|
|
13
|
+
export declare function normalizeDalScripts(scripts: Record<string, string>): Record<string, string>;
|
|
14
|
+
export type MergePackageJsonOptions = {
|
|
15
|
+
/** When set, `workspace:*` @corpdk/* deps use `^${publishedCorpdkVersions}` (published CLI init). */
|
|
16
|
+
publishedCorpdkVersions?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function mergePackageJson(consumer: PkgJson, template: PkgJson, options?: MergePackageJsonOptions): PkgJson;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Monorepo root (engines/create-ds/dist → engines/create-ds → engines → root). */
|
|
2
|
+
export declare function repoRootFromEngine(): string;
|
|
3
|
+
export declare function resolveCanonicalDsTemplateDir(repoRoot: string): Promise<string>;
|
|
4
|
+
export declare function engineStarterDir(): string;
|
|
5
|
+
export declare function isBundledCanonicalTemplate(templateDir: string): boolean;
|
|
6
|
+
export declare function readCreateDsReleaseVersion(): Promise<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Initial CalVer for a newly scaffolded deployable DS package (`YYYY.MM.MICRO`, UTC).
|
|
9
|
+
* Uses MICRO `0` for the first version in the scaffold month (Limitless CalVer policy).
|
|
10
|
+
*/
|
|
11
|
+
export declare function initialScaffoldCalVer(asOf?: Date): string;
|
|
12
|
+
/** Health, observability, and validation modules referenced by bootstrap entry files. */
|
|
13
|
+
export declare const BOOTSTRAP_STATIC_SRC_RELATIVE: readonly ["src/health.ts", "src/validation/parse-input.ts", "src/observability/otel-config.ts", "src/observability/otel-smoke-extensions.ts", "src/observability/preload-otel.ts", "src/observability/yoga-tracing-plugin.ts"];
|
|
14
|
+
export declare function copyBootstrapStaticSrc(templateDir: string, packageDir: string): Promise<void>;
|
|
15
|
+
/** Relative paths under templates/ds merged on upgrade (never touches src/db/schema/**). */
|
|
16
|
+
export declare const UPGRADE_RELATIVE_FILES: readonly ["LICENSE", "package.json", "dal/dal.config.yaml", "codegen.ts", "drizzle.config.ts", "tsconfig.json", "Dockerfile", "docker-compose.yml", "docker/otel-collector-config.yaml", "docker-entrypoint.sh", ".gitignore", ".env.example", "src/schema.ts", "src/index.ts", "src/db/index.ts", "src/health.ts", "src/validation/parse-input.ts", "src/observability/otel-config.ts", "src/observability/otel-smoke-extensions.ts", "src/observability/preload-otel.ts", "src/observability/yoga-tracing-plugin.ts"];
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
|
+
declare const execAsync: typeof exec.__promisify__;
|
|
3
|
+
export { execAsync };
|
|
4
|
+
export declare function pathExists(p: string): Promise<boolean>;
|
|
5
|
+
export declare function readJson<T>(filePath: string): Promise<T>;
|
|
6
|
+
export declare function writeJson(filePath: string, data: unknown): Promise<void>;
|
|
7
|
+
export declare function copyDir(src: string, dest: string, options?: {
|
|
8
|
+
extraExclude?: string[];
|
|
9
|
+
transform?: (content: string, relPath: string) => string;
|
|
10
|
+
skipIfExists?: boolean;
|
|
11
|
+
}): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corpdk/create-ds",
|
|
3
|
-
"version": "2026.10.0-alpha.
|
|
3
|
+
"version": "2026.10.0-alpha.5",
|
|
4
4
|
"description": "Scaffold and upgrade DAL-automated GraphQL data services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
"canonical",
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
|
+
"types": "./dist/types-entry.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/types-entry.d.ts",
|
|
25
|
+
"import": "./dist/types-entry.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
21
28
|
"bin": {
|
|
22
29
|
"create-ds": "./dist/index.js"
|
|
23
30
|
},
|
|
@@ -35,7 +42,7 @@
|
|
|
35
42
|
"node": ">=24.0.0"
|
|
36
43
|
},
|
|
37
44
|
"scripts": {
|
|
38
|
-
"build": "tsup",
|
|
45
|
+
"build": "tsup && pnpm exec tsc -p tsconfig.json --emitDeclarationOnly",
|
|
39
46
|
"dev": "tsup --watch",
|
|
40
47
|
"clean": "rm -rf dist node_modules .turbo"
|
|
41
48
|
}
|