Skip to content

Update ts-node to 10.4.0 #2123

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

Merged
merged 33 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
488101b
update
MaxGraey Nov 6, 2021
3f009ab
fix?
MaxGraey Nov 6, 2021
80695a4
faster?
MaxGraey Nov 6, 2021
061bebd
faster?
MaxGraey Nov 6, 2021
8444ad9
better?
MaxGraey Nov 6, 2021
4246008
better?
MaxGraey Nov 6, 2021
3c49252
skipLibCheck
MaxGraey Nov 7, 2021
2e34005
update config for other ts-nodes
MaxGraey Nov 7, 2021
540445f
changes
MaxGraey Nov 7, 2021
92901e5
fixes
MaxGraey Nov 7, 2021
83781b1
fix
MaxGraey Nov 7, 2021
979a743
fallback to assemblyscript/index only for non-TSError exeptions
MaxGraey Nov 7, 2021
9a48d6b
better
MaxGraey Nov 7, 2021
eceff0a
Merge branch 'main' into upd-ts-node
MaxGraey Nov 7, 2021
cf06f23
tune tsconfig
MaxGraey Nov 7, 2021
e03ffd7
exclude test folder as well
MaxGraey Nov 7, 2021
fa0424a
better
MaxGraey Nov 7, 2021
c9032cd
more
MaxGraey Nov 7, 2021
6679640
add prepublish scripts for ci
MaxGraey Nov 8, 2021
a09112c
Revert "add prepublish scripts for ci"
MaxGraey Nov 8, 2021
dd54315
add helper script which just update entry file & use it in CI
MaxGraey Nov 8, 2021
21a7a8e
fix typo
MaxGraey Nov 8, 2021
8d47b9a
remove unnecessary source-map-support
MaxGraey Nov 8, 2021
0e07997
add noEmit: true
MaxGraey Nov 8, 2021
bb7f86d
revert. noEmit ican't be overriden
MaxGraey Nov 8, 2021
e443cc6
add Cache dependencies in check stage
MaxGraey Nov 8, 2021
96a2cdb
fix
MaxGraey Nov 8, 2021
9daf2b9
fix
MaxGraey Nov 8, 2021
8a5f272
caching doesn't take any benefits so remove it
MaxGraey Nov 8, 2021
c14bc55
refactor. Revert source-map-support package
MaxGraey Nov 8, 2021
5d6e080
reuse prepublish script
MaxGraey Nov 8, 2021
f42d096
fix
MaxGraey Nov 8, 2021
11e2bfb
fix
MaxGraey Nov 8, 2021
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
"make": "npm run clean && npm test && npm run build && npm test",
"all": "npm run check && npm run make",
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md",
"prepare-ci": "node scripts/postpublish --prepare-for-ci",
"prepublishOnly": "node scripts/prepublish",
"postpublish": "node scripts/postpublish",
"prepare-ci": "node scripts/replace-entry",
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
"asbuild:untouched": "node bin/asc --config src/asconfig.json --target untouched",
"asbuild:optimized": "node bin/asc --config src/asconfig.json --target optimized",
Expand Down
88 changes: 47 additions & 41 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,51 @@ const path = require("path");
const pkg = require("../package.json");
const devFiles = require("./postpublish-files.json");

if (!pkg.releaseFiles) {
console.log("Package has already been updated");
return;
}
var isCI = process.argv[3] == '--prepare-for-ci';

if (!isCI) {
if (!pkg.releaseFiles) {
console.log("Package has already been updated");
return;
}

console.log("Backing up development files ...");

devFiles.forEach(originalName => {
const backupName = originalName + ".backup";
console.log("- " + originalName + " -> " + backupName);
fs.copyFileSync(
path.join(__dirname, "..", originalName),
path.join(__dirname, "..", backupName)
);
});

console.log("Backing up development files ...");

devFiles.forEach(originalName => {
const backupName = originalName + ".backup";
console.log("- " + originalName + " -> " + backupName);
fs.copyFileSync(
path.join(__dirname, "..", originalName),
path.join(__dirname, "..", backupName)
);
});

console.log("Updating package.json ...");

// Stuff we don't need in release
Object.keys(pkg.devDependencies).forEach(dep => delete pkg.dependencies[dep]);
delete pkg.devDependencies;
delete pkg.scripts;

// Stuff we want in release
pkg.files = pkg.releaseFiles;
delete pkg.releaseFiles;

// Copy contributors from NOTICE to .contributors
const notice = fs.readFileSync(path.join(__dirname, "..", "NOTICE"), "utf8");
const noticeRange = ["dcode.io>", "Portions of this software"];
const posStart = notice.indexOf(noticeRange[0]);
const posEnd = notice.indexOf(noticeRange[1], posStart);
if (posStart < 0 || posEnd < 0) throw Error("unexpected NOTICE format");
pkg.contributors = [];
for (let entry of notice.substring(posStart + noticeRange[0].length, posEnd).trim().matchAll(/^\* ([^<\n]+(?: <([^>\n]+)>))/mg)) {
pkg.contributors.push(entry[1]);
console.log("Updating package.json ...");

// Stuff we don't need in release
Object.keys(pkg.devDependencies).forEach(dep => delete pkg.dependencies[dep]);
delete pkg.devDependencies;
delete pkg.scripts;

// Stuff we want in release
pkg.files = pkg.releaseFiles;
delete pkg.releaseFiles;

// Copy contributors from NOTICE to .contributors
const notice = fs.readFileSync(path.join(__dirname, "..", "NOTICE"), "utf8");
const noticeRange = ["dcode.io>", "Portions of this software"];
const posStart = notice.indexOf(noticeRange[0]);
const posEnd = notice.indexOf(noticeRange[1], posStart);
if (posStart < 0 || posEnd < 0) throw Error("unexpected NOTICE format");
pkg.contributors = [];
for (let entry of notice.substring(posStart + noticeRange[0].length, posEnd).trim().matchAll(/^\* ([^<\n]+(?: <([^>\n]+)>))/mg)) {
pkg.contributors.push(entry[1]);
}
if (!pkg.contributors.length) throw Error("missing contributors");
fs.writeFileSync(path.join(__dirname, "..", "package.json"), [
JSON.stringify(pkg, null, 2), '\n'
].join(""));
}
if (!pkg.contributors.length) throw Error("missing contributors");
fs.writeFileSync(path.join(__dirname, "..", "package.json"), [
JSON.stringify(pkg, null, 2), '\n'
].join(""));

console.log("Copying index.release.js -> index.js ...");
fs.copyFileSync(
Expand All @@ -59,5 +63,7 @@ fs.copyFileSync(
path.join(__dirname, "..", "index.d.ts")
);

// We are going to use these immediately, so, to be sure:
setTimeout(() => console.log("OK"), 2000);
if (!isCI) {
// We are going to use these immediately, so, to be sure:
setTimeout(() => console.log("OK"), 2000);
}
14 changes: 0 additions & 14 deletions scripts/replace-entry.js

This file was deleted.