zenstack 0.6.0-pre.17 → 0.6.0-pre.19
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/cli/cli-util.d.ts +1 -1
- package/cli/cli-util.js +32 -76
- package/cli/cli-util.js.map +1 -1
- package/cli/index.d.ts +4 -0
- package/cli/index.js +17 -18
- package/cli/index.js.map +1 -1
- package/package.json +4 -4
- package/plugins/prisma/prisma-builder.d.ts +12 -5
- package/plugins/prisma/prisma-builder.js +24 -9
- package/plugins/prisma/prisma-builder.js.map +1 -1
- package/plugins/prisma/schema-generator.d.ts +2 -0
- package/plugins/prisma/schema-generator.js +13 -2
- package/plugins/prisma/schema-generator.js.map +1 -1
- package/plugins/react-hooks/react-hooks-generator.js +4 -4
- package/plugins/react-hooks/react-hooks-generator.js.map +1 -1
- package/plugins/zmodel-code/zmodel-code-generator.d.ts +27 -0
- package/plugins/zmodel-code/zmodel-code-generator.js +110 -0
- package/plugins/zmodel-code/zmodel-code-generator.js.map +1 -0
- package/res/starter.zmodel +47 -0
- package/telemetry.js +5 -5
- package/telemetry.js.map +1 -1
- package/utils/exec-utils.d.ts +1 -1
- package/utils/exec-utils.js +7 -2
- package/utils/exec-utils.js.map +1 -1
- package/utils/pkg-utils.d.ts +1 -1
- package/utils/pkg-utils.js +4 -4
- package/utils/pkg-utils.js.map +1 -1
- package/utils/version-utils.d.ts +1 -0
- package/utils/version-utils.js +15 -0
- package/utils/version-utils.js.map +1 -0
package/utils/pkg-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkg-utils.js","names":["getPackageManager","projectPath","fs","existsSync","path","join","installPackage","pkg","dev","pkgManager","undefined","manager","console","log","execSync","ensurePackage","require"],"sources":["../../src/utils/pkg-utils.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { execSync } from './exec-utils';\n\nexport type PackageManagers = 'npm' | 'yarn' | 'pnpm';\n\nfunction getPackageManager(projectPath = '.'): PackageManagers {\n if (fs.existsSync(path.join(projectPath, 'yarn.lock'))) {\n return 'yarn';\n } else if (fs.existsSync(path.join(projectPath, 'pnpm-lock.yaml'))) {\n return 'pnpm';\n } else {\n return 'npm';\n }\n}\n\nexport function installPackage(\n pkg: string,\n dev: boolean,\n pkgManager: PackageManagers | undefined = undefined,\n projectPath = '.'\n) {\n const manager = pkgManager ?? getPackageManager(projectPath);\n console.log(`Installing package \"${pkg}\" with ${manager}`);\n switch (manager) {\n case 'yarn':\n execSync(`yarn --cwd \"${projectPath}\" add ${pkg} ${dev ? ' --dev' : ''} --ignore-engines`);\n break;\n\n case 'pnpm':\n execSync(`pnpm add -C \"${projectPath}\" ${dev ? ' --save-dev' : ''} ${pkg}`);\n break;\n\n default:\n execSync(`npm install --prefix \"${projectPath}\" ${dev ? ' --save-dev' : ''} ${pkg}`);\n break;\n }\n}\n\nexport function ensurePackage(\n pkg: string,\n dev: boolean,\n pkgManager: PackageManagers | undefined = undefined,\n projectPath = '.'\n) {\n try {\n require(pkg);\n } catch {\n installPackage(pkg, dev, pkgManager, projectPath);\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAAwC;AAIxC,SAASA,iBAAiB,CAACC,WAAW,GAAG,GAAG,EAAmB;EAC3D,IAAIC,WAAE,CAACC,UAAU,CAACC,aAAI,CAACC,IAAI,CAACJ,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE;IACpD,OAAO,MAAM;EACjB,CAAC,MAAM,IAAIC,WAAE,CAACC,UAAU,CAACC,aAAI,CAACC,IAAI,CAACJ,WAAW,EAAE,gBAAgB,CAAC,CAAC,EAAE;IAChE,OAAO,MAAM;EACjB,CAAC,MAAM;IACH,OAAO,KAAK;EAChB;AACJ;AAEO,SAASK,cAAc,CAC1BC,GAAW,EACXC,GAAY,EACZC,UAAuC,GAAGC,SAAS,
|
|
1
|
+
{"version":3,"file":"pkg-utils.js","names":["getPackageManager","projectPath","fs","existsSync","path","join","installPackage","pkg","dev","pkgManager","undefined","tag","manager","console","log","execSync","ensurePackage","require"],"sources":["../../src/utils/pkg-utils.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { execSync } from './exec-utils';\n\nexport type PackageManagers = 'npm' | 'yarn' | 'pnpm';\n\nfunction getPackageManager(projectPath = '.'): PackageManagers {\n if (fs.existsSync(path.join(projectPath, 'yarn.lock'))) {\n return 'yarn';\n } else if (fs.existsSync(path.join(projectPath, 'pnpm-lock.yaml'))) {\n return 'pnpm';\n } else {\n return 'npm';\n }\n}\n\nexport function installPackage(\n pkg: string,\n dev: boolean,\n pkgManager: PackageManagers | undefined = undefined,\n tag = 'latest',\n projectPath = '.'\n) {\n const manager = pkgManager ?? getPackageManager(projectPath);\n console.log(`Installing package \"${pkg}\" with ${manager}`);\n switch (manager) {\n case 'yarn':\n execSync(`yarn --cwd \"${projectPath}\" add ${pkg}@${tag} ${dev ? ' --dev' : ''} --ignore-engines`);\n break;\n\n case 'pnpm':\n execSync(`pnpm add -C \"${projectPath}\" ${dev ? ' --save-dev' : ''} ${pkg}@${tag}`);\n break;\n\n default:\n execSync(`npm install --prefix \"${projectPath}\" ${dev ? ' --save-dev' : ''} ${pkg}@${tag}`);\n break;\n }\n}\n\nexport function ensurePackage(\n pkg: string,\n dev: boolean,\n pkgManager: PackageManagers | undefined = undefined,\n projectPath = '.'\n) {\n try {\n require(pkg);\n } catch {\n installPackage(pkg, dev, pkgManager, projectPath);\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAAwC;AAIxC,SAASA,iBAAiB,CAACC,WAAW,GAAG,GAAG,EAAmB;EAC3D,IAAIC,WAAE,CAACC,UAAU,CAACC,aAAI,CAACC,IAAI,CAACJ,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE;IACpD,OAAO,MAAM;EACjB,CAAC,MAAM,IAAIC,WAAE,CAACC,UAAU,CAACC,aAAI,CAACC,IAAI,CAACJ,WAAW,EAAE,gBAAgB,CAAC,CAAC,EAAE;IAChE,OAAO,MAAM;EACjB,CAAC,MAAM;IACH,OAAO,KAAK;EAChB;AACJ;AAEO,SAASK,cAAc,CAC1BC,GAAW,EACXC,GAAY,EACZC,UAAuC,GAAGC,SAAS,EACnDC,GAAG,GAAG,QAAQ,EACdV,WAAW,GAAG,GAAG,EACnB;EACE,MAAMW,OAAO,GAAGH,UAAU,IAAIT,iBAAiB,CAACC,WAAW,CAAC;EAC5DY,OAAO,CAACC,GAAG,CAAE,uBAAsBP,GAAI,UAASK,OAAQ,EAAC,CAAC;EAC1D,QAAQA,OAAO;IACX,KAAK,MAAM;MACP,IAAAG,mBAAQ,EAAE,eAAcd,WAAY,SAAQM,GAAI,IAAGI,GAAI,IAAGH,GAAG,GAAG,QAAQ,GAAG,EAAG,mBAAkB,CAAC;MACjG;IAEJ,KAAK,MAAM;MACP,IAAAO,mBAAQ,EAAE,gBAAed,WAAY,KAAIO,GAAG,GAAG,aAAa,GAAG,EAAG,IAAGD,GAAI,IAAGI,GAAI,EAAC,CAAC;MAClF;IAEJ;MACI,IAAAI,mBAAQ,EAAE,yBAAwBd,WAAY,KAAIO,GAAG,GAAG,aAAa,GAAG,EAAG,IAAGD,GAAI,IAAGI,GAAI,EAAC,CAAC;MAC3F;EAAM;AAElB;AAEO,SAASK,aAAa,CACzBT,GAAW,EACXC,GAAY,EACZC,UAAuC,GAAGC,SAAS,EACnDT,WAAW,GAAG,GAAG,EACnB;EACE,IAAI;IACAgB,OAAO,CAACV,GAAG,CAAC;EAChB,CAAC,CAAC,MAAM;IACJD,cAAc,CAACC,GAAG,EAAEC,GAAG,EAAEC,UAAU,EAAER,WAAW,CAAC;EACrD;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getVersion(): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVersion = getVersion;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
8
|
+
function getVersion() {
|
|
9
|
+
try {
|
|
10
|
+
return require('../package.json').version;
|
|
11
|
+
} catch {
|
|
12
|
+
return require('../../package.json').version;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=version-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-utils.js","names":["getVersion","require","version"],"sources":["../../src/utils/version-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nexport function getVersion() {\n try {\n return require('../package.json').version;\n } catch {\n return require('../../package.json').version;\n }\n}\n"],"mappings":";;;;;;AAAA;AACO,SAASA,UAAU,GAAG;EACzB,IAAI;IACA,OAAOC,OAAO,CAAC,iBAAiB,CAAC,CAACC,OAAO;EAC7C,CAAC,CAAC,MAAM;IACJ,OAAOD,OAAO,CAAC,oBAAoB,CAAC,CAACC,OAAO;EAChD;AACJ"}
|