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

WIP adapting to sync resolve; cleaning up esm hook stuff #1804

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
208 changes: 174 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -111,6 +111,7 @@
},
"homepage": "https://typestrong.org/ts-node",
"devDependencies": {
"@cspotcode/zx": "^6.1.0",
"@microsoft/api-extractor": "^7.19.4",
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
Expand All @@ -137,7 +138,7 @@
"rimraf": "^3.0.0",
"semver": "^7.1.3",
"throat": "^6.0.1",
"typedoc": "^0.22.10",
"typedoc": "^0.22.17",
"typescript": "4.7.2",
"typescript-json-schema": "^0.53.0",
"util.promisify": "^1.0.1"
Expand Down
27 changes: 27 additions & 0 deletions scripts/get-node-nightly.ts
@@ -0,0 +1,27 @@
#!/usr/bin/env -S ts-node --esm --transpileOnly
import { existsSync, mkdirSync } from 'fs';
import { unlinkSync, rmdirSync } from 'fs';
import { dirname, resolve } from 'path';
import { $ } from '@cspotcode/zx';

async function main() {
const __root = dirname(__dirname);
const downloadDir = resolve(__root, 'temp/node-nightly');
const result = await fetch('https://nodejs.org/download/nightly/index.json');
const index = await result.json();
const latest = index[0];
const { version } = latest;
existsSync(downloadDir) && rmdirSync(downloadDir, { recursive: true });
mkdirSync(downloadDir, { recursive: true });
await $`wget -O ${downloadDir}/download.tar.gz https://nodejs.org/download/nightly/${version}/node-${version}-linux-x64.tar.gz`;
process.chdir(downloadDir);
await $`tar -xzvf ${downloadDir}/download.tar.gz node-${version}-linux-x64/bin/node`;

console.log(``);
console.log(
`export PATH="${downloadDir}/node-${version}-linux-x64/bin:$PATH"`
);
console.log(``);
}

main();
2 changes: 2 additions & 0 deletions scripts/put-node-nightly-on-path.sh
@@ -0,0 +1,2 @@
# Dot-source this in a bash shell
export PATH="$PWD/$(echo temp/node-nightly/node-*/bin):$PATH"