Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Dec 14, 2023
1 parent 33dcefd commit 9dcce60
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"author": "",
"license": "MIT",
"dependencies": {
"@zenstackhq/openapi": "workspace:*",
"@zenstackhq/runtime": "workspace:*",
"change-case": "^4.1.2",
"lower-case-first": "^2.0.2",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tests/integration/tests/frameworks/nextjs/generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ describe('SWR Hooks Generation Tests', () => {
process.chdir(origDir);
});

// deps
const ver = require('../../../../../package.json').version;
const depPkgs = [
`${path.join(__dirname, '../../../../../.build/zenstackhq-language-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-sdk-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-runtime-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-swr-' + ver + '.tgz')}`,
];
const deps = depPkgs.join(' ');

it('sqlite', async () => {
const testDir = path.join(__dirname, './test-run/sqlite');
if (fs.existsSync(testDir)) {
Expand All @@ -25,6 +35,7 @@ describe('SWR Hooks Generation Tests', () => {
process.chdir(testDir);
const nodePath = path.join(testDir, 'node_modules');
run('npm install');
run('npm install ' + deps);
run('npx zenstack generate --schema ./sqlite.zmodel', { NODE_PATH: nodePath });
run('npm run build', { NODE_PATH: nodePath });
});
Expand All @@ -40,6 +51,7 @@ describe('SWR Hooks Generation Tests', () => {
process.chdir(testDir);
const nodePath = path.join(testDir, 'node_modules');
run('npm install');
run('npm install ' + deps);
run('npx zenstack generate --schema ./postgres.zmodel', { NODE_PATH: nodePath });
run('npm run build', { NODE_PATH: nodePath });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"@types/node": "18.11.18",
"@types/react": "18.0.27",
"@types/react-dom": "18.0.10",
"@zenstackhq/runtime": "../../../../../../../packages/runtime/dist",
"@zenstackhq/swr": "../../../../../../../packages/plugins/swr/dist",
"next": "13.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/tests/frameworks/trpc/generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ describe('tRPC Routers Generation Tests', () => {
process.chdir(origDir);
});

// deps
const ver = require('../../../../../package.json').version;
const depPkgs = [
`${path.join(__dirname, '../../../../../.build/zenstackhq-language-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-sdk-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-runtime-' + ver + '.tgz')}`,
`${path.join(__dirname, '../../../../../.build/zenstackhq-trpc-' + ver + '.tgz')}`,
];
const deps = depPkgs.join(' ');

it('basic', async () => {
const testDir = path.join(__dirname, './test-run/basic');
if (fs.existsSync(testDir)) {
Expand All @@ -24,6 +34,7 @@ describe('tRPC Routers Generation Tests', () => {

process.chdir(testDir);
run('npm install');
run('npm install ' + deps);
run('npx zenstack generate --no-dependency-check --schema ./todo.zmodel', { NODE_PATH: 'node_modules' });
run('npm run build', { NODE_PATH: 'node_modules' });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
"react-dom": "18.2.0",
"superjson": "^1.12.2",
"typescript": "4.9.4",
"zod": "^3.22.4",
"@zenstackhq/runtime": "../../../../../../../packages/runtime/dist"
"zod": "^3.22.4"
},
"devDependencies": {
"prisma": "^4.8.0",
"zenstack": "../../../../../../../packages/schema/dist",
"@zenstackhq/trpc": "../../../../../../../packages/plugins/trpc/dist"
"prisma": "^4.8.0"
}
}

0 comments on commit 9dcce60

Please sign in to comment.