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

Commit

Permalink
Revert "feat: improve node cli experience (#1095)"
Browse files Browse the repository at this point in the history
This reverts commit 28f653f.
  • Loading branch information
tjjfvi authored and ryanleecode committed Jun 23, 2023
1 parent 2aac7c3 commit 78abb16
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
26 changes: 14 additions & 12 deletions _tasks/dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,19 @@ await Promise.all([
compilerOptions: {
importHelpers: true,
sourceMap: true,
target: "ES2022",
lib: ["ES2022", "DOM"],
target: "ES2021",
lib: ["es2022.error"],
},
entryPoints: [
{ name: ".", path: "./mod.ts" },
{ name: "./loader", path: "./deps/shims/loader.node.ts" },
{ kind: "bin", name: "capi", path: "./main.ts" },
{
name: ".",
path: "./mod.ts",
},
{
kind: "bin",
name: "capi",
path: "./main.ts",
},
...entryPoints,
],
mappings: {
Expand All @@ -113,7 +119,6 @@ await Promise.all([
version: "8.13.0",
},
"./deps/shims/shim-deno.ts": "@deno/shim-deno",
"./deps/shims/ts-node-esm.ts": "ts-node/esm",
"node:net": "node:net",
"node:http": "node:http",
"node:stream": "node:stream",
Expand Down Expand Up @@ -155,7 +160,7 @@ await Promise.all([
path.join(capiOutDir, "esm/main.js"),
(content) =>
content
.replace(/^#!.+/, "#!/usr/bin/env -S node --loader capi/loader"),
.replace(/^#!.+/, "#!/usr/bin/env -S node --loader ts-node/esm"),
),
editFile(
path.join(capiOutDir, "esm/_dnt.shims.js"),
Expand Down Expand Up @@ -205,12 +210,9 @@ if (buildExamples) {
importHelpers: true,
sourceMap: true,
target: "ES2021",
lib: ["ES2022", "DOM"],
lib: ["es2022.error", "dom.iterable"],
},
entryPoints: [
...exampleEntryPoints,
{ name: "./deps/ed25519", path: "./deps/ed25519.ts" },
],
entryPoints: exampleEntryPoints,
mappings: {
"https://deno.land/x/[email protected]/keyring/mod.ts": {
name: "@polkadot/keyring",
Expand Down
4 changes: 2 additions & 2 deletions cli/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function withCommonOptions(command: Command) {
.option("-o, --out <out:string>", "Metadata and codegen output directory", {
default: "target/capi",
})
.option("-s, --server <server:string>", "")
.option("-s, --server <server:string>", "", { default: "https://capi.dev/" })
}

interface SyncProps {
Expand Down Expand Up @@ -83,7 +83,7 @@ async function setup(props: SyncProps) {
)
}
const baseUrl = await syncNets(
props.server ?? `https://capi.dev/@${version}/`,
props.server ?? `https://capi.dev/${version}/`,
devnetTempDir,
netSpecs,
)
Expand Down
2 changes: 1 addition & 1 deletion deps/dnt.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/x/dnt@0.37.0/mod.ts"
export * from "https://deno.land/x/dnt@0.34.0/mod.ts"
1 change: 0 additions & 1 deletion deps/shims/loader.node.ts

This file was deleted.

1 change: 0 additions & 1 deletion deps/shims/ts-node-esm.ts

This file was deleted.

2 changes: 1 addition & 1 deletion server/detectVersion.node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function detectVersion(): string | undefined {
const packageJsonPath = new URL("../../package.json", import.meta.url)
const packageJsonPath = new URL("../package.json", import.meta.url)
try {
Deno.statSync(packageJsonPath)
const packageJson = Deno.readTextFileSync(packageJsonPath)
Expand Down

0 comments on commit 78abb16

Please sign in to comment.