@zenstackhq/testtools 3.0.0-alpha.3 → 3.0.0-alpha.6
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.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -62,7 +62,7 @@ datasource db {
|
|
|
62
62
|
}).exhaustive();
|
|
63
63
|
}
|
|
64
64
|
__name(makePrelude, "makePrelude");
|
|
65
|
-
async function generateTsSchema(schemaText, provider = "sqlite", dbName) {
|
|
65
|
+
async function generateTsSchema(schemaText, provider = "sqlite", dbName, extraSourceFiles) {
|
|
66
66
|
const { name: workDir } = import_tmp.default.dirSync({
|
|
67
67
|
unsafeCleanup: true
|
|
68
68
|
});
|
|
@@ -104,9 +104,22 @@ ${schemaText}`);
|
|
|
104
104
|
target: "ESNext",
|
|
105
105
|
moduleResolution: "Bundler",
|
|
106
106
|
esModuleInterop: true,
|
|
107
|
-
skipLibCheck: true
|
|
108
|
-
|
|
107
|
+
skipLibCheck: true,
|
|
108
|
+
strict: true
|
|
109
|
+
},
|
|
110
|
+
include: [
|
|
111
|
+
"**/*.ts"
|
|
112
|
+
]
|
|
109
113
|
}));
|
|
114
|
+
if (extraSourceFiles) {
|
|
115
|
+
for (const [fileName, content] of Object.entries(extraSourceFiles)) {
|
|
116
|
+
const filePath = import_node_path.default.resolve(workDir, `${fileName}.ts`);
|
|
117
|
+
import_node_fs.default.mkdirSync(import_node_path.default.dirname(filePath), {
|
|
118
|
+
recursive: true
|
|
119
|
+
});
|
|
120
|
+
import_node_fs.default.writeFileSync(filePath, content);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
110
123
|
(0, import_node_child_process.execSync)("npx tsc", {
|
|
111
124
|
cwd: workDir,
|
|
112
125
|
stdio: "inherit"
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/schema.ts"],"sourcesContent":["export * from './schema';\n","import { TsSchemaGenerator } from '@zenstackhq/sdk';\nimport type { SchemaDef } from '@zenstackhq/sdk/schema';\nimport { glob } from 'glob';\nimport { execSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport tmp from 'tmp';\nimport { match } from 'ts-pattern';\n\nfunction makePrelude(provider: 'sqlite' | 'postgresql', dbName?: string) {\n return match(provider)\n .with('sqlite', () => {\n return `\ndatasource db {\n provider = 'sqlite'\n url = '${dbName ?? ':memory:'}'\n}\n`;\n })\n .with('postgresql', () => {\n return `\ndatasource db {\n provider = 'postgresql'\n url = 'postgres://postgres:postgres@localhost:5432/${dbName}'\n}\n`;\n })\n .exhaustive();\n}\n\nexport async function generateTsSchema(\n schemaText: string,\n provider: 'sqlite' | 'postgresql' = 'sqlite',\n dbName?: string
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/schema.ts"],"sourcesContent":["export * from './schema';\n","import { TsSchemaGenerator } from '@zenstackhq/sdk';\nimport type { SchemaDef } from '@zenstackhq/sdk/schema';\nimport { glob } from 'glob';\nimport { execSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport tmp from 'tmp';\nimport { match } from 'ts-pattern';\n\nfunction makePrelude(provider: 'sqlite' | 'postgresql', dbName?: string) {\n return match(provider)\n .with('sqlite', () => {\n return `\ndatasource db {\n provider = 'sqlite'\n url = '${dbName ?? ':memory:'}'\n}\n`;\n })\n .with('postgresql', () => {\n return `\ndatasource db {\n provider = 'postgresql'\n url = 'postgres://postgres:postgres@localhost:5432/${dbName}'\n}\n`;\n })\n .exhaustive();\n}\n\nexport async function generateTsSchema(\n schemaText: string,\n provider: 'sqlite' | 'postgresql' = 'sqlite',\n dbName?: string,\n extraSourceFiles?: Record<string, string>,\n) {\n const { name: workDir } = tmp.dirSync({ unsafeCleanup: true });\n console.log(`Working directory: ${workDir}`);\n\n const zmodelPath = path.join(workDir, 'schema.zmodel');\n const noPrelude = schemaText.includes('datasource ');\n fs.writeFileSync(zmodelPath, `${noPrelude ? '' : makePrelude(provider, dbName)}\\n\\n${schemaText}`);\n\n const pluginModelFiles = glob.sync(path.resolve(__dirname, '../../runtime/src/plugins/**/plugin.zmodel'));\n\n const generator = new TsSchemaGenerator();\n const tsPath = path.join(workDir, 'schema.ts');\n await generator.generate(zmodelPath, pluginModelFiles, tsPath);\n\n fs.mkdirSync(path.join(workDir, 'node_modules'));\n\n // symlink all entries from \"node_modules\"\n const nodeModules = fs.readdirSync(path.join(__dirname, '../node_modules'));\n for (const entry of nodeModules) {\n if (entry.startsWith('@zenstackhq')) {\n continue;\n }\n fs.symlinkSync(\n path.join(__dirname, '../node_modules', entry),\n path.join(workDir, 'node_modules', entry),\n 'dir',\n );\n }\n\n // in addition, symlink zenstack packages\n const zenstackPackages = ['language', 'sdk', 'runtime'];\n fs.mkdirSync(path.join(workDir, 'node_modules/@zenstackhq'));\n for (const pkg of zenstackPackages) {\n fs.symlinkSync(\n path.join(__dirname, `../../${pkg}/dist`),\n path.join(workDir, `node_modules/@zenstackhq/${pkg}`),\n 'dir',\n );\n }\n\n fs.writeFileSync(\n path.join(workDir, 'package.json'),\n JSON.stringify({\n name: 'test',\n version: '1.0.0',\n type: 'module',\n }),\n );\n\n fs.writeFileSync(\n path.join(workDir, 'tsconfig.json'),\n JSON.stringify({\n compilerOptions: {\n module: 'ESNext',\n target: 'ESNext',\n moduleResolution: 'Bundler',\n esModuleInterop: true,\n skipLibCheck: true,\n strict: true,\n },\n include: ['**/*.ts'],\n }),\n );\n\n if (extraSourceFiles) {\n for (const [fileName, content] of Object.entries(extraSourceFiles)) {\n const filePath = path.resolve(workDir, `${fileName}.ts`);\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, content);\n }\n }\n\n // compile the generated TS schema\n execSync('npx tsc', {\n cwd: workDir,\n stdio: 'inherit',\n });\n\n // load the schema module\n const module = await import(path.join(workDir, 'schema.js'));\n return { workDir, schema: module.schema as SchemaDef };\n}\n\nexport function generateTsSchemaFromFile(filePath: string) {\n const schemaText = fs.readFileSync(filePath, 'utf8');\n return generateTsSchema(schemaText);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;ACAA,iBAAkC;AAElC,kBAAqB;AACrB,gCAAyB;AACzB,qBAAe;AACf,uBAAiB;AACjB,iBAAgB;AAChB,wBAAsB;AAEtB,SAASA,YAAYC,UAAmCC,QAAe;AACnE,aAAOC,yBAAMF,QAAAA,EACRG,KAAK,UAAU,MAAA;AACZ,WAAO;;;aAGNF,UAAU,UAAA;;;EAGf,CAAA,EACCE,KAAK,cAAc,MAAA;AAChB,WAAO;;;yDAGsCF,MAAAA;;;EAGjD,CAAA,EACCG,WAAU;AACnB;AAnBSL;AAqBT,eAAsBM,iBAClBC,YACAN,WAAoC,UACpCC,QACAM,kBAAyC;AAEzC,QAAM,EAAEC,MAAMC,QAAO,IAAKC,WAAAA,QAAIC,QAAQ;IAAEC,eAAe;EAAK,CAAA;AAC5DC,UAAQC,IAAI,sBAAsBL,OAAAA,EAAS;AAE3C,QAAMM,aAAaC,iBAAAA,QAAKC,KAAKR,SAAS,eAAA;AACtC,QAAMS,YAAYZ,WAAWa,SAAS,aAAA;AACtCC,iBAAAA,QAAGC,cAAcN,YAAY,GAAGG,YAAY,KAAKnB,YAAYC,UAAUC,MAAAA,CAAAA;;EAAcK,UAAAA,EAAY;AAEjG,QAAMgB,mBAAmBC,iBAAKC,KAAKR,iBAAAA,QAAKS,QAAQC,WAAW,4CAAA,CAAA;AAE3D,QAAMC,YAAY,IAAIC,6BAAAA;AACtB,QAAMC,SAASb,iBAAAA,QAAKC,KAAKR,SAAS,WAAA;AAClC,QAAMkB,UAAUG,SAASf,YAAYO,kBAAkBO,MAAAA;AAEvDT,iBAAAA,QAAGW,UAAUf,iB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BAAAA,QAAKwC,QAAQD,QAAAA,GAAW;QAAEE,WAAW;MAAK,CAAA;AACvDrC,qBAAAA,QAAGC,cAAckC,UAAUH,OAAAA;IAC/B;EACJ;AAGAM,0CAAS,WAAW;IAChBC,KAAKlD;IACLmD,OAAO;EACX,CAAA;AAGA,QAAMhB,UAAS,MAAM,OAAO5B,iBAAAA,QAAKC,KAAKR,SAAS,WAAA;AAC/C,SAAO;IAAEA;IAASoD,QAAQjB,QAAOiB;EAAoB;AACzD;AAtFsBxD;AAwFf,SAASyD,yBAAyBP,UAAgB;AACrD,QAAMjD,aAAac,eAAAA,QAAG2C,aAAaR,UAAU,MAAA;AAC7C,SAAOlD,iBAAiBC,UAAAA;AAC5B;AAHgBwD;","names":["makePrelude","provider","dbName","match","with","exhaustive","generateTsSchema","schemaText","extraSourceFiles","name","workDir","tmp","dirSync","unsafeCleanup","console","log","zmodelPath","path","join","noPrelude","includes","fs","writeFileSync","pluginModelFiles","glob","sync","resolve","__dirname","generator","TsSchemaGenerator","tsPath","generate","mkdirSync","nodeModules","readdirSync","entry","startsWith","symlinkSync","zenstackPackages","pkg","JSON","stringify","version","type","compilerOptions","module","target","moduleResolution","esModuleInterop","skipLibCheck","strict","include","fileName","content","Object","entries","filePath","dirname","recursive","execSync","cwd","stdio","schema","generateTsSchemaFromFile","readFileSync"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaDef } from '@zenstackhq/sdk/schema';
|
|
2
2
|
|
|
3
|
-
declare function generateTsSchema(schemaText: string, provider?: 'sqlite' | 'postgresql', dbName?: string): Promise<{
|
|
3
|
+
declare function generateTsSchema(schemaText: string, provider?: 'sqlite' | 'postgresql', dbName?: string, extraSourceFiles?: Record<string, string>): Promise<{
|
|
4
4
|
workDir: string;
|
|
5
5
|
schema: SchemaDef;
|
|
6
6
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaDef } from '@zenstackhq/sdk/schema';
|
|
2
2
|
|
|
3
|
-
declare function generateTsSchema(schemaText: string, provider?: 'sqlite' | 'postgresql', dbName?: string): Promise<{
|
|
3
|
+
declare function generateTsSchema(schemaText: string, provider?: 'sqlite' | 'postgresql', dbName?: string, extraSourceFiles?: Record<string, string>): Promise<{
|
|
4
4
|
workDir: string;
|
|
5
5
|
schema: SchemaDef;
|
|
6
6
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
// src/schema.ts
|
|
5
5
|
import { TsSchemaGenerator } from "@zenstackhq/sdk";
|
|
6
6
|
import { glob } from "glob";
|
|
7
|
-
import { execSync } from "
|
|
8
|
-
import fs from "
|
|
9
|
-
import path from "
|
|
7
|
+
import { execSync } from "child_process";
|
|
8
|
+
import fs from "fs";
|
|
9
|
+
import path from "path";
|
|
10
10
|
import tmp from "tmp";
|
|
11
11
|
import { match } from "ts-pattern";
|
|
12
12
|
function makePrelude(provider, dbName) {
|
|
@@ -27,7 +27,7 @@ datasource db {
|
|
|
27
27
|
}).exhaustive();
|
|
28
28
|
}
|
|
29
29
|
__name(makePrelude, "makePrelude");
|
|
30
|
-
async function generateTsSchema(schemaText, provider = "sqlite", dbName) {
|
|
30
|
+
async function generateTsSchema(schemaText, provider = "sqlite", dbName, extraSourceFiles) {
|
|
31
31
|
const { name: workDir } = tmp.dirSync({
|
|
32
32
|
unsafeCleanup: true
|
|
33
33
|
});
|
|
@@ -69,9 +69,22 @@ ${schemaText}`);
|
|
|
69
69
|
target: "ESNext",
|
|
70
70
|
moduleResolution: "Bundler",
|
|
71
71
|
esModuleInterop: true,
|
|
72
|
-
skipLibCheck: true
|
|
73
|
-
|
|
72
|
+
skipLibCheck: true,
|
|
73
|
+
strict: true
|
|
74
|
+
},
|
|
75
|
+
include: [
|
|
76
|
+
"**/*.ts"
|
|
77
|
+
]
|
|
74
78
|
}));
|
|
79
|
+
if (extraSourceFiles) {
|
|
80
|
+
for (const [fileName, content] of Object.entries(extraSourceFiles)) {
|
|
81
|
+
const filePath = path.resolve(workDir, `${fileName}.ts`);
|
|
82
|
+
fs.mkdirSync(path.dirname(filePath), {
|
|
83
|
+
recursive: true
|
|
84
|
+
});
|
|
85
|
+
fs.writeFileSync(filePath, content);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
75
88
|
execSync("npx tsc", {
|
|
76
89
|
cwd: workDir,
|
|
77
90
|
stdio: "inherit"
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema.ts"],"sourcesContent":["import { TsSchemaGenerator } from '@zenstackhq/sdk';\nimport type { SchemaDef } from '@zenstackhq/sdk/schema';\nimport { glob } from 'glob';\nimport { execSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport tmp from 'tmp';\nimport { match } from 'ts-pattern';\n\nfunction makePrelude(provider: 'sqlite' | 'postgresql', dbName?: string) {\n return match(provider)\n .with('sqlite', () => {\n return `\ndatasource db {\n provider = 'sqlite'\n url = '${dbName ?? ':memory:'}'\n}\n`;\n })\n .with('postgresql', () => {\n return `\ndatasource db {\n provider = 'postgresql'\n url = 'postgres://postgres:postgres@localhost:5432/${dbName}'\n}\n`;\n })\n .exhaustive();\n}\n\nexport async function generateTsSchema(\n schemaText: string,\n provider: 'sqlite' | 'postgresql' = 'sqlite',\n dbName?: string
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts"],"sourcesContent":["import { TsSchemaGenerator } from '@zenstackhq/sdk';\nimport type { SchemaDef } from '@zenstackhq/sdk/schema';\nimport { glob } from 'glob';\nimport { execSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport tmp from 'tmp';\nimport { match } from 'ts-pattern';\n\nfunction makePrelude(provider: 'sqlite' | 'postgresql', dbName?: string) {\n return match(provider)\n .with('sqlite', () => {\n return `\ndatasource db {\n provider = 'sqlite'\n url = '${dbName ?? ':memory:'}'\n}\n`;\n })\n .with('postgresql', () => {\n return `\ndatasource db {\n provider = 'postgresql'\n url = 'postgres://postgres:postgres@localhost:5432/${dbName}'\n}\n`;\n })\n .exhaustive();\n}\n\nexport async function generateTsSchema(\n schemaText: string,\n provider: 'sqlite' | 'postgresql' = 'sqlite',\n dbName?: string,\n extraSourceFiles?: Record<string, string>,\n) {\n const { name: workDir } = tmp.dirSync({ unsafeCleanup: true });\n console.log(`Working directory: ${workDir}`);\n\n const zmodelPath = path.join(workDir, 'schema.zmodel');\n const noPrelude = schemaText.includes('datasource ');\n fs.writeFileSync(zmodelPath, `${noPrelude ? '' : makePrelude(provider, dbName)}\\n\\n${schemaText}`);\n\n const pluginModelFiles = glob.sync(path.resolve(__dirname, '../../runtime/src/plugins/**/plugin.zmodel'));\n\n const generator = new TsSchemaGenerator();\n const tsPath = path.join(workDir, 'schema.ts');\n await generator.generate(zmodelPath, pluginModelFiles, tsPath);\n\n fs.mkdirSync(path.join(workDir, 'node_modules'));\n\n // symlink all entries from \"node_modules\"\n const nodeModules = fs.readdirSync(path.join(__dirname, '../node_modules'));\n for (const entry of nodeModules) {\n if (entry.startsWith('@zenstackhq')) {\n continue;\n }\n fs.symlinkSync(\n path.join(__dirname, '../node_modules', entry),\n path.join(workDir, 'node_modules', entry),\n 'dir',\n );\n }\n\n // in addition, symlink zenstack packages\n const zenstackPackages = ['language', 'sdk', 'runtime'];\n fs.mkdirSync(path.join(workDir, 'node_modules/@zenstackhq'));\n for (const pkg of zenstackPackages) {\n fs.symlinkSync(\n path.join(__dirname, `../../${pkg}/dist`),\n path.join(workDir, `node_modules/@zenstackhq/${pkg}`),\n 'dir',\n );\n }\n\n fs.writeFileSync(\n path.join(workDir, 'package.json'),\n JSON.stringify({\n name: 'test',\n version: '1.0.0',\n type: 'module',\n }),\n );\n\n fs.writeFileSync(\n path.join(workDir, 'tsconfig.json'),\n JSON.stringify({\n compilerOptions: {\n module: 'ESNext',\n target: 'ESNext',\n moduleResolution: 'Bundler',\n esModuleInterop: true,\n skipLibCheck: true,\n strict: true,\n },\n include: ['**/*.ts'],\n }),\n );\n\n if (extraSourceFiles) {\n for (const [fileName, content] of Object.entries(extraSourceFiles)) {\n const filePath = path.resolve(workDir, `${fileName}.ts`);\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, content);\n }\n }\n\n // compile the generated TS schema\n execSync('npx tsc', {\n cwd: workDir,\n stdio: 'inherit',\n });\n\n // load the schema module\n const module = await import(path.join(workDir, 'schema.js'));\n return { workDir, schema: module.schema as SchemaDef };\n}\n\nexport function generateTsSchemaFromFile(filePath: string) {\n const schemaText = fs.readFileSync(filePath, 'utf8');\n return generateTsSchema(schemaText);\n}\n"],"mappings":";;;;AAAA,SAASA,yBAAyB;AAElC,SAASC,YAAY;AACrB,SAASC,gBAAgB;AACzB,OAAOC,QAAQ;AACf,OAAOC,UAAU;AACjB,OAAOC,SAAS;AAChB,SAASC,aAAa;AAEtB,SAASC,YAAYC,UAAmCC,QAAe;AACnE,SAAOC,MAAMF,QAAAA,EACRG,KAAK,UAAU,MAAA;AACZ,WAAO;;;aAGNF,UAAU,UAAA;;;EAGf,CAAA,EACCE,KAAK,cAAc,MAAA;AAChB,WAAO;;;yDAGsCF,MAAAA;;;EAGjD,CAAA,EACCG,WAAU;AACnB;AAnBSL;AAqBT,eAAsBM,iBAClBC,YACAN,WAAoC,UACpCC,QACAM,kBAAyC;AAEzC,QAAM,EAAEC,MAAMC,QAAO,IAAKC,IAAIC,QAAQ;IAAEC,eAAe;EAAK,CAAA;AAC5DC,UAAQC,IAAI,sBAAsBL,OAAAA,EAAS;AAE3C,QAAMM,aAAaC,KAAKC,KAAKR,SAAS,eAAA;AACtC,QAAMS,YAAYZ,WAAWa,SAAS,aAAA;AACtCC,KAAGC,cAAcN,YAAY,GAAGG,YAAY,KAAKnB,YAAYC,UAAUC,MAAAA,CAAAA;;EAAcK,UAAAA,EAAY;AAEjG,QAAMgB,mBAAmB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KAAKS,QAAQhB,SAAS,GAAG0C,QAAAA,KAAa;AACvD/B,SAAGW,UAAUf,KAAKwC,QAAQD,QAAAA,GAAW;QAAEE,WAAW;MAAK,CAAA;AACvDrC,SAAGC,cAAckC,UAAUH,OAAAA;IAC/B;EACJ;AAGAM,WAAS,WAAW;IAChBC,KAAKlD;IACLmD,OAAO;EACX,CAAA;AAGA,QAAMhB,SAAS,MAAM,OAAO5B,KAAKC,KAAKR,SAAS,WAAA;AAC/C,SAAO;IAAEA;IAASoD,QAAQjB,OAAOiB;EAAoB;AACzD;AAtFsBxD;AAwFf,SAASyD,yBAAyBP,UAAgB;AACrD,QAAMjD,aAAac,GAAG2C,aAAaR,UAAU,MAAA;AAC7C,SAAOlD,iBAAiBC,UAAAA;AAC5B;AAHgBwD;","names":["TsSchemaGenerator","glob","execSync","fs","path","tmp","match","makePrelude","provider","dbName","match","with","exhaustive","generateTsSchema","schemaText","extraSourceFiles","name","workDir","tmp","dirSync","unsafeCleanup","console","log","zmodelPath","path","join","noPrelude","includes","fs","writeFileSync","pluginModelFiles","glob","sync","resolve","__dirname","generator","TsSchemaGenerator","tsPath","generate","mkdirSync","nodeModules","readdirSync","entry","startsWith","symlinkSync","zenstackPackages","pkg","JSON","stringify","version","type","compilerOptions","module","target","moduleResolution","esModuleInterop","skipLibCheck","strict","include","fileName","content","Object","entries","filePath","dirname","recursive","execSync","cwd","stdio","schema","generateTsSchemaFromFile","readFileSync"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/testtools",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
4
|
"description": "ZenStack Test Tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@types/node": "^20.0.0",
|
|
26
25
|
"glob": "^11.0.2",
|
|
27
26
|
"tmp": "^0.2.3",
|
|
28
27
|
"ts-pattern": "^5.7.1",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"@zenstackhq/language": "3.0.0-alpha.
|
|
32
|
-
"@zenstackhq/sdk": "3.0.0-alpha.
|
|
28
|
+
"prisma": "^6.0.0",
|
|
29
|
+
"typescript": "^5.0.0",
|
|
30
|
+
"@zenstackhq/language": "3.0.0-alpha.6",
|
|
31
|
+
"@zenstackhq/sdk": "3.0.0-alpha.6"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
34
|
"better-sqlite3": "^11.8.1",
|
|
36
35
|
"pg": "^8.13.1"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@types/tmp": "^0.2.6"
|
|
38
|
+
"@types/tmp": "^0.2.6",
|
|
39
|
+
"@zenstackhq/eslint-config": "3.0.0-alpha.6",
|
|
40
|
+
"@zenstackhq/typescript-config": "3.0.0-alpha.6"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "tsup-node",
|
|
43
44
|
"watch": "tsup-node --watch",
|
|
44
45
|
"lint": "eslint src --ext ts",
|
|
45
|
-
"test": "vitest",
|
|
46
46
|
"pack": "pnpm pack"
|
|
47
47
|
}
|
|
48
48
|
}
|