Skip to content

Commit

Permalink
Merge pull request #4 from zenstack-hq/feat/code-gen
Browse files Browse the repository at this point in the history
feat: implement runtime code generation and refine zmodel schema
  • Loading branch information
ymc9 authored Oct 13, 2022
2 parents e697066 + 0233926 commit b8dbed4
Show file tree
Hide file tree
Showing 141 changed files with 15,294 additions and 2,388 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
auto-install-peers=true
git-checks=false
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Generate for Todo Sample",
"program": "${workspaceFolder}/packages/schema/bin/cli",
"cwd": "${workspaceFolder}/samples/todo/",
"args": [
"generate",
"${workspaceFolder}/samples/todo/schema.zmodel",
"--destination",
"${workspaceFolder}/samples/todo/.zenstack"
],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "node"
},
{
"name": "Attach",
"port": 9229,
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC"
Expand Down
2 changes: 2 additions & 0 deletions packages/internal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/lib
/tests/coverage/
32 changes: 32 additions & 0 deletions packages/internal/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

import tsconfig from './tsconfig.json';
const moduleNameMapper = require('tsconfig-paths-jest')(tsconfig);

export default {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,

// The directory where Jest should output its coverage files
coverageDirectory: 'tests/coverage',

// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: ['/node_modules/', '/tests/'],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ['json', 'text', 'lcov', 'clover'],

// A map from regular expressions to paths to transformers
transform: { '^.+\\.tsx?$': 'ts-jest' },

moduleNameMapper,
};
40 changes: 40 additions & 0 deletions packages/internal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@zenstackhq/internal",
"version": "0.1.6",
"description": "ZenStack internal runtime library",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"watch": "tsc --watch",
"test": "jest",
"prepublishOnly": "pnpm build"
},
"keywords": [],
"author": "",
"license": "ISC",
"files": [
"lib/**/*"
],
"dependencies": {
"bcryptjs": "^2.4.3",
"deepcopy": "^2.1.0",
"swr": "^1.3.0"
},
"peerDependencies": {
"next": "12.3.1",
"react": "^17.0.2 || ^18",
"react-dom": "^17.0.2 || ^18"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/jest": "^29.0.3",
"@types/node": "^14.18.29",
"jest": "^29.0.3",
"ts-jest": "^29.0.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.7.0",
"tsconfig-paths-jest": "^0.0.1",
"typescript": "^4.6.2"
}
}
Loading

0 comments on commit b8dbed4

Please sign in to comment.