Skip to content

Commit

Permalink
Remove ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Nov 5, 2024
1 parent dadfa5e commit 9ba0915
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 43 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ JS_SKYPACK_PACKAGE_CHECK_REQ += artifacts/dist
################################################################################

.PHONY: run-example
run-example: artifacts/link-dependencies.touch
source test/fixture/example/invalid-values.sh; node --loader ts-node/esm test/fixture/example/run.ts
run-example: artifacts/link-dependencies.touch artifacts/dist
source test/fixture/example/invalid-values.sh; node test/fixture/example/run.js

.PHONY: copy-example
copy-example: artifacts/link-dependencies.touch
Expand Down Expand Up @@ -53,5 +53,5 @@ artifacts/dist/esm: tsconfig.build.esm.json tsconfig.json artifacts/link-depende
echo '{"type":"module"}' > "$@/package.json"
@touch "$@"

ENVIRONMENT.md: artifacts/link-dependencies.touch $(JS_SOURCE_FILES) $(JS_TEST_FILES)
ENVIRONMENT.md: artifacts/link-dependencies.touch artifacts/dist $(JS_SOURCE_FILES) $(JS_TEST_FILES)
AUSTENITE_SPEC=true AUSTENITE_APP=example node test/fixture/example/run.js > "$@"
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.1.0",
"publint": "^0.2.12",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.13.0",
"vite-tsconfig-paths": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
number,
string,
url,
} from "../../../src/index.js";
} from "../../../artifacts/dist/esm/index.js";

export const cdnUrl = url("CDN_URL", "CDN to use when serving static assets", {
protocols: ["http:", "https:"],
Expand Down
37 changes: 33 additions & 4 deletions test/fixture/example/run.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
import { register } from "node:module";
import { pathToFileURL } from "node:url";
import { initialize } from "../../../artifacts/dist/esm/node.js";
import {
cdnUrl,
earthAtomCount,
grpcTimeout,
isDebug,
logLevel,
port,
readDsn,
redisPrimary,
sampleRatio,
sessionKey,
weight,
} from "./env.js";

register("ts-node/esm", pathToFileURL("./"));
await import("./run.ts");
await initialize();

console.log("");
console.log("Environment is valid 🎉");
console.log("");

console.table({
cdnUrl: cdnUrl.value().toString(),
earthAtomCount: earthAtomCount.value(),
grpcTimeout: grpcTimeout.value()?.total("millisecond"),
isDebug: isDebug.value(),
logLevel: logLevel.value(),
port: port.value(),
readDsn: readDsn.value(),
redisPrimary: `${redisPrimary.value().host}:${redisPrimary.value().port}`,
sampleRatio: sampleRatio.value(),
sessionKey: sessionKey.value().toString("base64"),
weight: weight.value(),
});
34 changes: 0 additions & 34 deletions test/fixture/example/run.ts

This file was deleted.

0 comments on commit 9ba0915

Please sign in to comment.