Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1f25f05
feat: initial structure for zmodel schema
ymc9 Sep 23, 2022
a6b415d
Merge pull request #1 from zenstack-hq/feat/init_schema
ymc9 Sep 23, 2022
8e6dd16
feat: progress on the sample todo app
ymc9 Sep 26, 2022
70f518f
Merge pull request #2 from zenstack-hq/feat/sample-todo-wip
ymc9 Sep 26, 2022
a313014
feat: schema progress
ymc9 Sep 27, 2022
0d02709
WIP
ymc9 Sep 28, 2022
4f33c4a
WIP: member resolution
ymc9 Sep 28, 2022
206a7fa
WIP: type-checker is working now
ymc9 Sep 29, 2022
cb7ac25
add logo, improve sample
ymc9 Sep 29, 2022
e697066
Merge pull request #3 from zenstack-hq/feat/zmodel-schema-progress
ymc9 Sep 29, 2022
8921b94
WIP: dev
ymc9 Oct 3, 2022
f6fb3b0
WIP: prisma generator tests
ymc9 Oct 4, 2022
ac7364b
update
ymc9 Oct 5, 2022
42bfa5b
structure for data/function generator
ymc9 Oct 5, 2022
83ed319
WIP
ymc9 Oct 8, 2022
b52e9d4
test cases
ymc9 Oct 8, 2022
3d0a85f
WIP
ymc9 Oct 8, 2022
acb3896
Progress
ymc9 Oct 10, 2022
a14d53d
WIP
ymc9 Oct 11, 2022
cc306b4
WIP
ymc9 Oct 12, 2022
6a9ee1e
WIP
ymc9 Oct 12, 2022
b026e14
update
ymc9 Oct 12, 2022
42970ea
WIP
ymc9 Oct 12, 2022
b0a394b
WIP
ymc9 Oct 13, 2022
0233926
update
ymc9 Oct 13, 2022
b8dbed4
Merge pull request #4 from zenstack-hq/feat/code-gen
ymc9 Oct 13, 2022
15cee92
feat: make good progress on the Todo demo (#5)
ymc9 Oct 14, 2022
17ac4af
fix: put generated prisma schema into zenstack folder (#6)
ymc9 Oct 14, 2022
267bacd
feat: vercel deploy (#7)
ymc9 Oct 14, 2022
8de821e
fix: fix utility code location (#8)
ymc9 Oct 14, 2022
a1f2eba
demo: small UI refinements (#9)
ymc9 Oct 14, 2022
3524c91
chore: add .env into git (#10)
ymc9 Oct 14, 2022
4c757c7
demo: support deleting todo (#11)
ymc9 Oct 14, 2022
39f383c
demo: signin logic fixes and various UI fixes (#12)
ymc9 Oct 14, 2022
53be59c
chore: add integration test for Todo model (#13)
ymc9 Oct 17, 2022
46f1c27
feat: more complete condition injection and post-update checking, mor…
ymc9 Oct 20, 2022
2c551fb
chore: prettify CLI, make sure exit code is correct and errors are du…
ymc9 Oct 20, 2022
357852b
feat: wrap Prisma's migrate and db commands (#16)
ymc9 Oct 21, 2022
b09b9cf
feat: implement schema type-checking (#17)
ymc9 Oct 23, 2022
d83a641
chore: update todo sample to latest zenstack (#18)
ymc9 Oct 23, 2022
cf2e63b
feat: make vscode extension work (with known issues with goto-definit…
ymc9 Oct 24, 2022
907490c
chore: documentation and lint cleanup for "internal" package (#20)
ymc9 Oct 25, 2022
8014fec
chore: code cleanup for schema package (#21)
ymc9 Oct 25, 2022
b2fd336
chore: clean up code for runtime package (#22)
ymc9 Oct 25, 2022
06ac296
Add logic to store service instance to global for dev environment as …
ymc9 Oct 26, 2022
dd33f92
feat: adaptive code generation for next-auth
ymc9 Oct 26, 2022
a6782bd
fix: typing error in generated hooks (#26)
ymc9 Oct 26, 2022
2707967
chore: update readme (#28)
ymc9 Oct 26, 2022
8d560e0
chore: completing first batch of documentation (#29)
ymc9 Oct 28, 2022
941b424
update docs (#31)
ymc9 Oct 28, 2022
6943d0d
fix: make sure path in Prisma schema is escaped (for windows) (#32)
ymc9 Oct 28, 2022
031c394
release: v0.2.1 (#33)
ymc9 Oct 29, 2022
7764751
Merge remote-tracking branch 'origin/main' into dev
ymc9 Oct 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 ZenStack Full-stack Development Toolkit
Copyright (c) 2022 ZenStack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
<img src="https://user-images.githubusercontent.com/104139426/197796006-52d8d334-413b-4eda-8094-4024c0eaf9b3.png" height="128">
</picture>
<h1>ZenStack</h1>
<a href="https://www.npmjs.com/package/zenstack"><img src="https://img.shields.io/npm/v/zenstack"></a>
<a href="https://github.com/zenstackhq/zenstack/blob/dev/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green"></a>
<a href="https://www.npmjs.com/package/zenstack">
<img src="https://img.shields.io/npm/v/zenstack">
</a>
<a href="https://twitter.com/intent/tweet?text=Wow%20%40zenstackhq">
<img src="https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fzenstackhq%2Fzenstack">
</a>
<a href="https://discord.gg/6HhebQynfz">
<img src="https://img.shields.io/discord/1035538056146595961">
</a>
<a href="https://github.com/zenstackhq/zenstack/blob/dev/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green">
</a>
</div>

## What is ZenStack?
Expand Down Expand Up @@ -267,4 +277,5 @@ export const getServerSideProps: GetServerSideProps = async () => {

## Reach out to us for issues, feedback and ideas!

[Discussions](../discussions) [Issues](../issues) [Discord]() [Twitter]()
[Discord](https://discord.gg/dbuC9ZWc) [Twitter](https://twitter.com/zenstackhq)
[Discussions](../discussions) [Issues](../issues)
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "zenstack-monorepo",
"version": "1.0.0",
"version": "0.2.1",
"description": "",
"scripts": {
"build": "pnpm -r build",
"test": "pnpm -r test",
"lint": "pnpm -r lint"
"lint": "pnpm -r lint",
"publish-all": "pnpm --filter \"./packages/**\" -r publish"
},
"keywords": [],
"author": "",
Expand Down
21 changes: 21 additions & 0 deletions packages/internal/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 ZenStack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions packages/internal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ZenStack Internal Library

This package is an internal library supporting web apps built using ZenStack.

Visit [Homepage](https://github.com/zenstackhq/zenstack#readme) for more details.
2 changes: 1 addition & 1 deletion packages/internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/internal",
"version": "0.1.57",
"version": "0.2.1",
"displayName": "ZenStack Internal Library",
"description": "ZenStack internal runtime library. This package is for supporting runtime functionality of ZenStack and not supposed to be used directly.",
"repository": {
Expand Down
21 changes: 21 additions & 0 deletions packages/runtime/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 ZenStack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions packages/runtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ZenStack Runtime Library

This package is the runtime library supporting web apps built using ZenStack.

Visit [Homepage](https://github.com/zenstackhq/zenstack#readme) for more details.
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/runtime",
"displayName": "ZenStack Runtime Library",
"version": "0.1.57",
"version": "0.2.1",
"description": "This package contains runtime library for consuming client and server side code generated by ZenStack.",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions packages/schema/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/tests/coverage/
/bundle
*.vsix
/README.md
2 changes: 1 addition & 1 deletion packages/schema/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 ZenStack Language Tools
Copyright (c) 2022 ZenStack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "zenstack",
"displayName": "ZenStack Language Tools",
"description": "ZenStack is a toolkit that simplifies full-stack development",
"version": "0.1.57",
"version": "0.2.1",
"author": {
"name": "ZenStack Team"
},
Expand Down Expand Up @@ -77,7 +77,7 @@
"langium:watch": "langium generate --watch",
"watch": "concurrently --kill-others \"npm:langium:watch\" \"npm:bundle-watch\"",
"test": "jest",
"prepublishOnly": "pnpm build && pnpm bundle"
"prepublishOnly": "cp ../../README.md ./ && pnpm build && pnpm bundle"
},
"dependencies": {
"@zenstackhq/internal": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/generator/prisma/prisma-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class Generator {
return (
`generator ${this.name} {\n` +
indentString(`provider = "${this.provider}"\n`) +
indentString(`output = "${this.output}"\n`) +
indentString(`output = ${JSON.stringify(this.output)}\n`) +
(this.previewFeatures
? indentString(
`previewFeatures = [${this.previewFeatures
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/generator/prisma/schema-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default class PrismaSchemaGenerator {
prisma.addGenerator(
'client',
'prisma-client-js',
path.join('../', this.context.generatedCodeDir, '.prisma'),
path.join('..', this.context.generatedCodeDir, '.prisma'),
[
'fieldReference',
'interactiveTransactions',
Expand Down
37 changes: 7 additions & 30 deletions samples/todo/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# A Collaborative Todo Sample

## Getting Started
This project is a collaborative todo app built with [Next.js](https://nextjs.org), [Next-Auth](nextauth.org), and [ZenStack](https://github.com/zenstackhq/zenstack).

First, run the development server:
See a live deployment at: https://zenstack-todo.vercel.app/.

```bash
npm run dev
# or
yarn dev
```
Features:

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
- User signup/signin
- Creating workspaces and inviting members
- Data isolation and permission control
50 changes: 25 additions & 25 deletions samples/todo/package-lock.json

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

7 changes: 4 additions & 3 deletions samples/todo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "todo",
"version": "0.1.0",
"version": "0.2.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -17,7 +17,8 @@
"dependencies": {
"@heroicons/react": "^2.0.12",
"@prisma/client": "^4.4.0",
"@zenstackhq/runtime": "latest",
"@zenstackhq/internal": "^0.2.1",
"@zenstackhq/runtime": "^0.2.1",
"daisyui": "^2.31.0",
"moment": "^2.29.4",
"nanoid": "^4.0.0",
Expand All @@ -39,6 +40,6 @@
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8",
"typescript": "^4.6.2",
"zenstack": "latest"
"zenstack": "^0.2.1"
}
}