Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(private): schema CLI #8957

Merged
merged 8 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 2 additions & 6 deletions packages/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@

Its like GraphQL, RPC, or Protobuf... but for anything!

## Usage

> ⚠️ Private

This package may currently only be used within EmberData. A public version is coming soon 💜
---

## Installation

Expand All @@ -53,7 +49,7 @@ pnpm install @warp-drive/schema
Scaffold the schema for a `User` resource

```no-highlight
npx -p @warp-drive-schema resource user
npx -p @warp-drive/schema resource user
```

Parse Schemas
Expand Down
20 changes: 10 additions & 10 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
"scripts": {
"build:parse": "bun build src/parse.ts --compile --outfile parse",
"build:scaffold": "bun build src/scaffold.ts --compile --outfile scaffold",
"build": "bun run build:parse && bun run build:scaffold",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
"_build": "bun run build:parse && bun run build:scaffold",
"prepack": "bun run _build"
},
"files": [
"README.md",
Expand All @@ -38,15 +37,16 @@
"resource": "./scaffold resource"
},
"main": "src/index.ts",
"peerDependencies": {
"typescript": "^5.4.5"
},
"dependencies": {
"chalk": "^5.3.0"
},
"peerDependencies": {},
"dependencies": {},
"devDependencies": {
"bun-types": "1.1.3",
"pnpm-sync-dependencies-meta-injected": "0.0.10"
"chalk": "^5.3.0",
"@babel/parser": "^7.24.4",
"@babel/traverse": "^7.24.1",
"@types/babel__parser": "^7.1.1",
"@types/babel__traverse": "^7.20.5",
"typescript": "^5.4.5"
},
"engines": {
"node": ">= 18.20.2"
Expand Down
Binary file modified packages/schema/parse
Binary file not shown.
Binary file modified packages/schema/scaffold
Binary file not shown.
13 changes: 12 additions & 1 deletion packages/schema/src/parse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
async function main() {}
import { getSchemaConfig } from './parser/steps/get-config';
import { gatherSchemaFiles } from './parser/steps/gather-schema-files';
import { compileJSONSchemas } from './parser/compile/json';

async function main() {
const config = await getSchemaConfig();

const modules = await gatherSchemaFiles(config);
const compiledJson = await compileJSONSchemas(modules);

console.log(compiledJson);
}

await main();
Loading
Loading