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: add quicktype tool #60

Merged
merged 3 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions generate-event-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ fi

echo "Building event registry generator"
# Note: the command line flags here are all to just produce minimal output unless there's a problem
dotnet build -nologo -clp:NoSummary -v quiet tools/Google.Events.Tools.GenerateRegistry
dotnet build -nologo -clp:NoSummary -v quiet tools/registry/Google.Events.Tools.GenerateRegistry

echo "Running event registry generator"
# Command line arguments to the registry generator:
# - Path to the protobuf file descriptor set (created in compile.sh)
# - Path to the README.md to update
dotnet run --no-build -p tools/Google.Events.Tools.GenerateRegistry \
dotnet run --no-build -p tools/registry/Google.Events.Tools.GenerateRegistry \
-- $PROTO_DESCRIPTOR_SET README.md
31 changes: 26 additions & 5 deletions tools/quicktype-wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,37 @@

This node module that wraps the `quicktype` tool to generate code using JSON Schema.

## Build and Run
## Install

This tool can be installed as a global CLI or run as a Node script. Requires Node 8+.

### CLI (Recommended)

Install the CLI globally:

```sh
npm run build
npm start
sudo npm run cli
grant marked this conversation as resolved.
Show resolved Hide resolved
```

This builds the script in the `build/` directory. Then runs the script.
Then type `qt` to run the generator.

### Node Script

You can also run as a script. Build then run:

```sh
npm run compile
npm run start
```

## Run

const IN = process.env.IN || `${HOMEDIR}/Documents/github/googleapis/google-cloudevents/proto/`;
const OUT = process.env.OUT || `${HOMEDIR}/Documents/out`;
grant marked this conversation as resolved.
Show resolved Hide resolved
const L = (process.env.L || LANGUAGE.TYPESCRIPT).toUpperCase() as TARGET_LANGUAGE;


## Watch
## Develop/Watch

To continually watch the script insead of building after every change,
run this command in a separate terminal:
Expand Down