@workerstack/clients 1.0.0-rc.23 → 1.0.0-rc.25
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 +67 -11
- package/assets/installers/examples/github.config.ts +21 -0
- package/assets/installers/examples/goreleaser.config.ts +21 -0
- package/assets/installers/examples/raw.config.ts +17 -0
- package/assets/installers/templates/install.ps1 +426 -0
- package/assets/installers/templates/install.sh +412 -0
- package/bin/installgen.js +19 -0
- package/dist/cli.js +4 -0
- package/dist/emit/cli/install.d.ts +8 -5
- package/dist/emit/cli/install.js +14 -7
- package/dist/emit/cli/release.js +8 -7
- package/dist/emit/shared/status-keys.d.ts +2 -2
- package/dist/emit/shared/status-keys.js +2 -2
- package/dist/gen/args.js +4 -0
- package/dist/gen/formatters.d.ts +1 -1
- package/dist/gen/formatters.js +1 -1
- package/dist/gen/targets.d.ts +1 -1
- package/dist/gen/targets.js +1 -1
- package/dist/installers/cli.d.ts +21 -0
- package/dist/installers/cli.js +170 -0
- package/dist/installers/commands/build.d.ts +15 -0
- package/dist/installers/commands/build.js +34 -0
- package/dist/installers/commands/check.d.ts +10 -0
- package/dist/installers/commands/check.js +161 -0
- package/dist/installers/commands/init.d.ts +9 -0
- package/dist/installers/commands/init.js +32 -0
- package/dist/installers/config/define-config.d.ts +100 -0
- package/dist/installers/config/define-config.js +10 -0
- package/dist/installers/config/hooks/bun.d.ts +21 -0
- package/dist/installers/config/hooks/bun.js +21 -0
- package/dist/installers/config/hooks/node.d.ts +9 -0
- package/dist/installers/config/hooks/node.js +16 -0
- package/dist/installers/config/load.d.ts +35 -0
- package/dist/installers/config/load.js +97 -0
- package/dist/installers/config/resolve.d.ts +4 -0
- package/dist/installers/config/resolve.js +281 -0
- package/dist/installers/config/types.d.ts +45 -0
- package/dist/installers/config/types.js +1 -0
- package/dist/installers/errors.d.ts +5 -0
- package/dist/installers/errors.js +5 -0
- package/dist/installers/index.d.ts +11 -0
- package/dist/installers/index.js +11 -0
- package/dist/installers/render/quote.d.ts +7 -0
- package/dist/installers/render/quote.js +34 -0
- package/dist/installers/render/render.d.ts +24 -0
- package/dist/installers/render/render.js +133 -0
- package/dist/installers/ui.d.ts +15 -0
- package/dist/installers/ui.js +14 -0
- package/dist/release/bootstrap.d.ts +61 -0
- package/dist/release/bootstrap.js +191 -0
- package/dist/release/bump-args.d.ts +17 -0
- package/dist/release/bump-args.js +35 -0
- package/dist/release/bump-command.d.ts +18 -0
- package/dist/release/bump-command.js +186 -0
- package/dist/release/bump.d.ts +33 -0
- package/dist/release/bump.js +72 -0
- package/dist/release/cli.d.ts +23 -0
- package/dist/release/cli.js +85 -0
- package/dist/release/codegen.d.ts +6 -0
- package/dist/release/codegen.js +25 -0
- package/dist/release/constants.d.ts +39 -0
- package/dist/release/constants.js +35 -0
- package/dist/release/context.d.ts +33 -0
- package/dist/release/context.js +31 -0
- package/dist/release/digest.d.ts +11 -0
- package/dist/release/digest.js +59 -0
- package/dist/release/git.d.ts +10 -0
- package/dist/release/git.js +64 -0
- package/dist/release/index.d.ts +7 -0
- package/dist/release/index.js +6 -0
- package/dist/release/load.d.ts +30 -0
- package/dist/release/load.js +78 -0
- package/dist/release/manifest.d.ts +15 -0
- package/dist/release/manifest.js +164 -0
- package/dist/release/oasdiff.d.ts +20 -0
- package/dist/release/oasdiff.js +36 -0
- package/dist/release/registries.d.ts +46 -0
- package/dist/release/registries.js +243 -0
- package/dist/release/release-state.d.ts +15 -0
- package/dist/release/release-state.js +21 -0
- package/dist/release/release-workflow.d.ts +5 -0
- package/dist/release/release-workflow.js +72 -0
- package/dist/release/repo-settings.d.ts +22 -0
- package/dist/release/repo-settings.js +53 -0
- package/dist/release/spec-gate.d.ts +28 -0
- package/dist/release/spec-gate.js +107 -0
- package/dist/release/sync-command.d.ts +31 -0
- package/dist/release/sync-command.js +122 -0
- package/dist/release/sync-tree.d.ts +30 -0
- package/dist/release/sync-tree.js +123 -0
- package/dist/release/sync.d.ts +46 -0
- package/dist/release/sync.js +172 -0
- package/dist/release/types.d.ts +149 -0
- package/dist/release/types.js +1 -0
- package/dist/release/version-files.d.ts +16 -0
- package/dist/release/version-files.js +74 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.js +8 -0
- package/package.json +72 -11
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/** The one match of `pattern` (whose group 1 always participates) in `text`, or a throw naming `what`. */
|
|
4
|
+
function only(text, pattern, what) {
|
|
5
|
+
const matches = [...text.matchAll(new RegExp(pattern.source, `${pattern.flags.replace("g", "")}g`))];
|
|
6
|
+
if (matches.length !== 1) {
|
|
7
|
+
throw new Error(`expected one ${what}, found ${matches.length}`);
|
|
8
|
+
}
|
|
9
|
+
return matches[0];
|
|
10
|
+
}
|
|
11
|
+
function replaceAt(text, match, replacement) {
|
|
12
|
+
return text.slice(0, match.index) + replacement + text.slice(match.index + match[0].length);
|
|
13
|
+
}
|
|
14
|
+
/* The top-level `"version"` of a tab-indented JSON manifest. */
|
|
15
|
+
const JSON_VERSION = /^\t"version": "([^"]+)"/m;
|
|
16
|
+
const json = {
|
|
17
|
+
read: (text) => only(text, JSON_VERSION, 'top-level "version"')[1],
|
|
18
|
+
write: (text, version) => replaceAt(text, only(text, JSON_VERSION, 'top-level "version"'), `\t"version": "${version}"`),
|
|
19
|
+
};
|
|
20
|
+
/* The `version = "…"` line of the `[project]` table, which ends at the next table header. */
|
|
21
|
+
const PROJECT_TABLE = /^\[project\]\n((?:(?!\[).*\n?)*)/m;
|
|
22
|
+
const TOML_VERSION = /^version = "([^"]+)"$/m;
|
|
23
|
+
const pyproject = {
|
|
24
|
+
read: (text) => {
|
|
25
|
+
const table = only(text, PROJECT_TABLE, "[project] table");
|
|
26
|
+
return only(table[1], TOML_VERSION, "[project] version")[1];
|
|
27
|
+
},
|
|
28
|
+
write: (text, version) => {
|
|
29
|
+
const table = only(text, PROJECT_TABLE, "[project] table");
|
|
30
|
+
const body = table[1];
|
|
31
|
+
const line = only(body, TOML_VERSION, "[project] version");
|
|
32
|
+
const newBody = replaceAt(body, line, `version = "${version}"`);
|
|
33
|
+
return text.slice(0, table.index) + table[0].replace(body, newBody) + text.slice(table.index + table[0].length);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
/** The version files bump keeps in step with `.release-state.json`, by file name. */
|
|
37
|
+
export const VERSION_FILES = {
|
|
38
|
+
"jsr.json": json,
|
|
39
|
+
"package.json": json,
|
|
40
|
+
"pyproject.toml": pyproject,
|
|
41
|
+
};
|
|
42
|
+
const NAMES = ["jsr.json", "package.json", "pyproject.toml"];
|
|
43
|
+
/** Each version file present in `dir` with the version it holds; throws naming the file whose version line is missing or doubled. */
|
|
44
|
+
export function readVersions(dir) {
|
|
45
|
+
const versions = {};
|
|
46
|
+
for (const name of NAMES) {
|
|
47
|
+
const file = join(dir, name);
|
|
48
|
+
if (!existsSync(file))
|
|
49
|
+
continue;
|
|
50
|
+
try {
|
|
51
|
+
versions[name] = VERSION_FILES[name].read(readFileSync(file, "utf8"));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
/* each read throws only `only`'s Error */
|
|
55
|
+
throw new Error(`${file}: ${error.message}`, {
|
|
56
|
+
cause: error,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return versions;
|
|
61
|
+
}
|
|
62
|
+
/** Writes `version` into every version file present in `dir`; returns the paths written. */
|
|
63
|
+
export function writeVersions(dir, version) {
|
|
64
|
+
readVersions(dir);
|
|
65
|
+
const written = [];
|
|
66
|
+
for (const name of NAMES) {
|
|
67
|
+
const file = join(dir, name);
|
|
68
|
+
if (!existsSync(file))
|
|
69
|
+
continue;
|
|
70
|
+
writeFileSync(file, VERSION_FILES[name].write(readFileSync(file, "utf8"), version));
|
|
71
|
+
written.push(file);
|
|
72
|
+
}
|
|
73
|
+
return written;
|
|
74
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package's own version, read from its manifest (`../package.json` from `src/` in a checkout and from the
|
|
3
|
+
* compiled output in an install). Generated files pin it, so the tools they run come from the release that wrote them.
|
|
4
|
+
*/
|
|
5
|
+
export declare function clientsVersion(): string;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
/**
|
|
3
|
+
* This package's own version, read from its manifest (`../package.json` from `src/` in a checkout and from the
|
|
4
|
+
* compiled output in an install). Generated files pin it, so the tools they run come from the release that wrote them.
|
|
5
|
+
*/
|
|
6
|
+
export function clientsVersion() {
|
|
7
|
+
return JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workerstack/clients",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.25",
|
|
4
4
|
"description": "Generates SDKs (TypeScript, Go, Rust, Python, C#, Java), a CLI and an MCP server from any OpenAPI 3.x document.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codegen",
|
|
@@ -9,21 +9,22 @@
|
|
|
9
9
|
"sdk",
|
|
10
10
|
"workerstack"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://github.com/workerstack/
|
|
12
|
+
"homepage": "https://github.com/workerstack/clients#readme",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/workerstack/
|
|
14
|
+
"url": "https://github.com/workerstack/clients/issues"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"author": "lovrozagar",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/workerstack/
|
|
21
|
-
"directory": "packages/gen"
|
|
20
|
+
"url": "git+https://github.com/workerstack/clients.git"
|
|
22
21
|
},
|
|
23
22
|
"bin": {
|
|
24
|
-
"honey-clients": "bin/honey-clients.js"
|
|
23
|
+
"honey-clients": "bin/honey-clients.js",
|
|
24
|
+
"installgen": "bin/installgen.js"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
+
"assets",
|
|
27
28
|
"bin",
|
|
28
29
|
"dist"
|
|
29
30
|
],
|
|
@@ -37,6 +38,14 @@
|
|
|
37
38
|
"types": "./dist/cli.d.ts",
|
|
38
39
|
"default": "./dist/cli.js"
|
|
39
40
|
},
|
|
41
|
+
"./installers": {
|
|
42
|
+
"types": "./dist/installers/index.d.ts",
|
|
43
|
+
"default": "./dist/installers/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./release": {
|
|
46
|
+
"types": "./dist/release/index.d.ts",
|
|
47
|
+
"default": "./dist/release/index.js"
|
|
48
|
+
},
|
|
40
49
|
"./package.json": "./package.json"
|
|
41
50
|
},
|
|
42
51
|
"publishConfig": {
|
|
@@ -44,28 +53,66 @@
|
|
|
44
53
|
"provenance": true
|
|
45
54
|
},
|
|
46
55
|
"scripts": {
|
|
56
|
+
"fmt": "oxfmt",
|
|
57
|
+
"fmt:check": "oxfmt --check",
|
|
58
|
+
"grunt:antigravity": "antigravity --dangerously-skip-permissions",
|
|
59
|
+
"grunt:claude": "claude --dangerously-skip-permissions",
|
|
60
|
+
"grunt:clean": "node ./.rulesync/scripts/clean.mjs",
|
|
61
|
+
"grunt:codex": "codex --dangerously-bypass-approvals-and-sandbox",
|
|
62
|
+
"grunt:doctor": "node ./.rulesync/scripts/doctor.mjs",
|
|
63
|
+
"grunt:gemini": "gemini --yolo",
|
|
64
|
+
"grunt:grok": "grok --yolo",
|
|
65
|
+
"grunt:hooks:check": "node .rulesync/scripts/hooks-union.mjs --check",
|
|
66
|
+
"grunt:hooks:union": "node .rulesync/scripts/hooks-union.mjs",
|
|
67
|
+
"grunt:purge:global-mcps": "node .rulesync/scripts/purge-global-mcps.mjs",
|
|
68
|
+
"grunt:purge:global-mcps:apply": "node .rulesync/scripts/purge-global-mcps.mjs --apply",
|
|
69
|
+
"grunt:rulesync:check": "node ./.rulesync/scripts/guarded-roots.mjs check",
|
|
70
|
+
"grunt:rulesync:doctor": "rulesync doctor",
|
|
71
|
+
"grunt:rulesync:generate": "node ./.rulesync/scripts/guarded-roots.mjs generate",
|
|
72
|
+
"grunt:rulesync:watch": "node ./.rulesync/scripts/guarded-roots.mjs watch",
|
|
73
|
+
"grunt:setup": "node ./.rulesync/scripts/setup.mjs",
|
|
74
|
+
"grunt:sync:globals": "node .rulesync/scripts/sync-global-settings.mjs",
|
|
75
|
+
"grunt:sync:globals:apply": "node .rulesync/scripts/sync-global-settings.mjs --apply",
|
|
76
|
+
"grunt:sync:globals:check": "node .rulesync/scripts/check-globals.mjs",
|
|
77
|
+
"lint": "oxlint",
|
|
78
|
+
"lint:fix": "oxlint --fix",
|
|
47
79
|
"prepack": "bun scripts/build.ts",
|
|
80
|
+
"prepare": "lefthook install --reset-hooks-path",
|
|
48
81
|
"test": "vitest run --coverage",
|
|
49
82
|
"test:harness": "vitest run --mode harness",
|
|
50
|
-
"
|
|
83
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
51
84
|
},
|
|
52
85
|
"dependencies": {
|
|
53
|
-
"@lovrozagar/installgen": "0.3.0",
|
|
54
86
|
"jiti": "2.7.0",
|
|
55
|
-
"oxc-transform": "0.155.0"
|
|
87
|
+
"oxc-transform": "0.155.0",
|
|
88
|
+
"zod": "4.3.6"
|
|
56
89
|
},
|
|
57
90
|
"devDependencies": {
|
|
91
|
+
"@clack/prompts": "^0.11.0",
|
|
92
|
+
"@commitlint/cli": "21.2.4",
|
|
93
|
+
"@commitlint/config-conventional": "21.2.4",
|
|
94
|
+
"@lovrozagar/grunt": "0.16.1",
|
|
58
95
|
"@tanstack/query-core": "5.104.5",
|
|
59
96
|
"@total-typescript/ts-reset": "0.6.1",
|
|
60
97
|
"@types/node": "26.1.1",
|
|
61
98
|
"@vitest/coverage-v8": "4.1.10",
|
|
99
|
+
"@workerstack/backend": "1.0.0-rc.24",
|
|
100
|
+
"@workerstack/system": "0.3.0",
|
|
62
101
|
"ajv": "8.20.0",
|
|
63
102
|
"ajv-formats": "3.0.1",
|
|
64
|
-
"
|
|
103
|
+
"js-yaml": "5.3.0",
|
|
104
|
+
"lefthook": "2.2.2",
|
|
105
|
+
"oxc-parser": "0.152.0",
|
|
106
|
+
"oxfmt": "0.78.0",
|
|
107
|
+
"oxlint": "1.93.0",
|
|
108
|
+
"rulesync": "16.17.0",
|
|
109
|
+
"smol-toml": "^1.8.0",
|
|
65
110
|
"standardwebhooks": "1.1.1",
|
|
66
111
|
"ts-morph": "28.0.0",
|
|
67
112
|
"typescript": "7.0.2",
|
|
68
|
-
"
|
|
113
|
+
"vite": "8.1.4",
|
|
114
|
+
"vitest": "4.1.10",
|
|
115
|
+
"ws": "8.21.0"
|
|
69
116
|
},
|
|
70
117
|
"peerDependencies": {
|
|
71
118
|
"oxfmt": ">=0.63.0",
|
|
@@ -81,5 +128,19 @@
|
|
|
81
128
|
},
|
|
82
129
|
"engines": {
|
|
83
130
|
"node": ">=22.12.0"
|
|
131
|
+
},
|
|
132
|
+
"packageManager": "bun@1.4.4",
|
|
133
|
+
"standards": {
|
|
134
|
+
"repo": "clients",
|
|
135
|
+
"gates": [
|
|
136
|
+
"test:harness"
|
|
137
|
+
],
|
|
138
|
+
"ci": [
|
|
139
|
+
"fmt:check",
|
|
140
|
+
"lint",
|
|
141
|
+
"typecheck",
|
|
142
|
+
"test",
|
|
143
|
+
"test:harness"
|
|
144
|
+
]
|
|
84
145
|
}
|
|
85
146
|
}
|