Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

chore: reworking CLI + import specifiers #345

Merged
merged 9 commits into from
Oct 31, 2022
Merged

chore: reworking CLI + import specifiers #345

merged 9 commits into from
Oct 31, 2022

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Oct 31, 2022

Resolved #258

This PR includes a variety of tweaks to the CLI:

  • specify target chain via SCALE or chainspec file paths or WebSocket URL.
  • choose the Capi import specifier of codegened output (denoland/x is the default). This enables us to override to a local version or the NPM name.

Usage is slightly different.

deno run -A -r https://deno.land/x/capi/codegen.ts \
  --src=wss://rpc.polkadot.io \
  --out=polkadot \
  --import=capi

In the context of this repo, we could run the following:

deno task run codegen.ts \
  --src=wss://rpc.polkadot.io \
  --out=polkadot \
  --import=mod.ts

Given that we specify mod.ts as the Capi import specifier, the files generated into the polkadot dir will import capi via ../mod.ts.

codegen.ts Outdated Show resolved Hide resolved
codegen.ts Outdated Show resolved Hide resolved
codegen.ts Show resolved Hide resolved
codegen/Files.ts Outdated Show resolved Hide resolved
codegen/mod.ts Outdated Show resolved Hide resolved
codegen/mod.ts Outdated Show resolved Hide resolved
@harrysolovay harrysolovay marked this pull request as ready for review October 31, 2022 20:42
test_util/codegen.ts Outdated Show resolved Hide resolved
@harrysolovay harrysolovay merged commit 3e262ae into main Oct 31, 2022
@harrysolovay harrysolovay deleted the cli branch October 31, 2022 21:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codegen Import Specifier
2 participants