@palantir/pack.sdkgen.pack-versioned-template 0.0.1
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/LICENSE.txt +13 -0
- package/build/browser/index.js +1176 -0
- package/build/browser/index.js.map +1 -0
- package/build/browser/prompt-6ZJZATIW.js +947 -0
- package/build/browser/prompt-6ZJZATIW.js.map +1 -0
- package/build/cjs/index.cjs +1204 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +39 -0
- package/build/cjs/prompt-BQYHWSYA.cjs +955 -0
- package/build/cjs/prompt-BQYHWSYA.cjs.map +1 -0
- package/build/esm/config.js +54 -0
- package/build/esm/hooks/afterGenerate.js +89 -0
- package/build/esm/index.js +17 -0
- package/build/types/config.d.ts +26 -0
- package/build/types/config.d.ts.map +1 -0
- package/build/types/hooks/afterGenerate.d.ts +13 -0
- package/build/types/hooks/afterGenerate.d.ts.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -0
- package/package.json +72 -0
- package/template/README.md.ejs +76 -0
- package/template/_gitignore +7 -0
- package/template/package.json.ejs +33 -0
- package/template/src/index.ts +2 -0
- package/template/tsconfig.json +22 -0
- package/template.config.js +1 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# <%= projectName %>
|
|
2
|
+
|
|
3
|
+
<%= answers.description || 'Generated versioned SDK from IR' %>
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import {
|
|
9
|
+
DocumentModel,
|
|
10
|
+
asVersioned,
|
|
11
|
+
matchVersion,
|
|
12
|
+
type VersionedDocRef,
|
|
13
|
+
} from "<%= projectName %>";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Generated Source
|
|
17
|
+
|
|
18
|
+
This SDK was generated from a versioned IR JSON file (produced by
|
|
19
|
+
`type-gen schema ir` from a TypeScript schema module that uses
|
|
20
|
+
`@palantir/pack.schema` builders). The output covers every supported schema
|
|
21
|
+
version:
|
|
22
|
+
|
|
23
|
+
- Per-version read types: `types_v1.ts`, `types_v2.ts`, ...
|
|
24
|
+
- Per-version write types: `writeTypes_v1.ts`, `writeTypes_v2.ts`, ...
|
|
25
|
+
- Per-version Zod schemas: `schema_v1.ts`, `schema_v2.ts`, ...
|
|
26
|
+
- Internal upgrade machinery: `_internal/types.ts`, `_internal/upgrades.ts`, `_internal/schema.ts`
|
|
27
|
+
- `versions.ts` — `SupportedVersions`, `LatestVersion`, `MinSupportedVersion`
|
|
28
|
+
- `versionedDocRef.ts` — `VersionedDocRef`, `asVersioned`, `matchVersion`
|
|
29
|
+
- `models.ts` — runtime model constants and `DocumentModel`
|
|
30
|
+
- `types.ts` / `schema.ts` — re-exports under unversioned names
|
|
31
|
+
- `index.ts` — barrel
|
|
32
|
+
|
|
33
|
+
It should be depended on as a package in your project, but not modified
|
|
34
|
+
directly so it can be regenerated cleanly.
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
### Build
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Type Check
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm typecheck
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Regenerating
|
|
51
|
+
|
|
52
|
+
First emit the IR from your schema package:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
type-gen schema ir -i ./path/to/schema.mjs -o build/ir.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then regenerate this SDK from the IR:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm exec sdkgen create "./this-package" \
|
|
62
|
+
--template @palantir/pack.sdkgen.pack-versioned-template \
|
|
63
|
+
--schema ./path/to/build/ir.json \
|
|
64
|
+
--config pack-config.json \
|
|
65
|
+
--overwrite
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
<% if (answers.author) { %>
|
|
69
|
+
## Author
|
|
70
|
+
|
|
71
|
+
<%= answers.author %>
|
|
72
|
+
<% } %>
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
UNLICENSED
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= answers.packageName || projectName %>",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "<%= answers.description || 'Generated versioned SDK from IR' %>",
|
|
6
|
+
<% if (answers.author) { %>"author": "<%= answers.author %>",<% } %>
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./build/types/index.d.ts",
|
|
11
|
+
"default": "./build/esm/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"clean": "rm -rf build dist *.tgz tsconfig.tsbuildinfo",
|
|
17
|
+
"transpileTypes": "tsc --emitDeclarationOnly",
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@palantir/pack.document-schema.model-types": "latest"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"zod": "^4.1.7"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.12.0",
|
|
28
|
+
"typescript": "^5.9.2"
|
|
29
|
+
},
|
|
30
|
+
"main": "./build/esm/index.js",
|
|
31
|
+
"types": "./build/types/index.d.ts",
|
|
32
|
+
"type": "module"
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "nodenext",
|
|
5
|
+
"lib": ["ES2022"],
|
|
6
|
+
"moduleResolution": "nodenext",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"outDir": "./build/esm",
|
|
9
|
+
"declarationDir": "./build/types",
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"allowSyntheticDefaultImports": true
|
|
19
|
+
},
|
|
20
|
+
"include": ["./src/**/*"],
|
|
21
|
+
"exclude": ["node_modules", "build", "dist"]
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { config as default } from "./build/esm/config.js";
|