Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
update ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Dec 9, 2021
1 parent 6aac55c commit 4b1240f
Show file tree
Hide file tree
Showing 42 changed files with 1,275 additions and 535 deletions.
79 changes: 63 additions & 16 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"scripts": {
"build": "npm run tsc && cross-env NODE_OPTIONS=--max_old_space_size=4096 lerna run build",
"clean": "npm run tsc.clean && npx lerna clean -y && npx shx rm -rf node_modules",
"create": "ts-node scripts/create",
"docs.build": "shx cp -r src/packages/ganache/dist/web/* docs/assets/js/ganache && lerna run docs.build && ts-node scripts/build-docs/",
"create": "cd scripts && ts-node create",
"docs.build": "shx cp -r src/packages/ganache/dist/web/* docs/assets/js/ganache && lerna run docs.build && cd scripts && ts-node build-docs",
"docs.preview": "lerna run docs.preview",
"postinstall": "ts-node scripts/postinstall",
"postinstall": "cd scripts && ts-node postinstall",
"reinstall": "npm run clean && npm install",
"prepublishOnly": "ts-node ./scripts/filter-shrinkwrap.ts \"$(lerna list --parseable --scope ganache)\"/npm-shrinkwrap.json",
"prepublishOnly": "cd scripts && ts-node filter-shrinkwrap.ts \"$(lerna list --parseable --scope ganache)\"/npm-shrinkwrap.json",
"postpublish": "git restore \"$(lerna list --parseable --scope ganache)\"/npm-shrinkwrap.json",
"start": "lerna exec --loglevel=silent --scope ganache -- npm run start --silent -- ",
"test": "lerna exec --concurrency 1 -- npm run test",
Expand Down Expand Up @@ -48,7 +48,7 @@
"pretty-quick": "3.1.0",
"semver": "7.3.5",
"shx": "0.3.3",
"ts-node": "9.1.1",
"ts-node": "10.4.0",
"ts-transformer-inline-file": "0.1.1",
"ttypescript": "1.5.12",
"typescript": "4.5.2",
Expand Down
16 changes: 10 additions & 6 deletions scripts/link-ts-references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type PackageInfo = {
};

function flat(arrays: any[][]) {
return [].concat.apply([], arrays);
return [].concat.apply([], arrays as any);
}

function getConfigByName(name: string) {
Expand Down Expand Up @@ -73,7 +73,9 @@ function updateConfig(config: PackageInfo) {
tsConfigReferences = tsConfigReferences.filter(tsConfigReference => {
const existingRefPath = resolve(path, tsConfigReference.path);
const stillExists = references.some(name => {
const relPath = getConfigByName(name).path;
const config = getConfigByName(name);
if (!config) return false;
const relPath = config.path;
if (relPath === existingRefPath) {
return true;
} else {
Expand All @@ -91,10 +93,12 @@ function updateConfig(config: PackageInfo) {
// add package.json deps to tsconfig references:
references.forEach(name => {
const referenceConfig = getConfigByName(name);
if(!referenceConfig) throw new Error(`missing config ${name}`);

// projects that are referenced by other projects must have the `composite: true` in their tsconfig compileOptions
if (
!referenceConfig.tsConfig.compilerOptions ||
!referenceConfig.tsConfig.compilerOptions.composite
(!referenceConfig.tsConfig.compilerOptions ||
!referenceConfig.tsConfig.compilerOptions.composite)
) {
if (!referenceConfig.tsConfig.compilerOptions)
referenceConfig.tsConfig.compilerOptions = {};
Expand Down Expand Up @@ -148,12 +152,12 @@ const packageDirectories = flat(
})
).filter(dir => existsSync(join(dir, "package.json")));

function keys(object: {}) {
function keys(object: {} | undefined) {
return object ? Object.keys(object) : [];
}

// get all configs
const configs: PackageInfo[] = packageDirectories.map(pkg => {
const configs: PackageInfo[] = packageDirectories.map((pkg: any) => {
const tsConfigFile = join(pkg, "tsconfig.json");
let tsConfig: TsConfigFile;
let packageJson: PackageJson;
Expand Down
2 changes: 1 addition & 1 deletion scripts/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const execArgs: ExecSyncOptions = { cwd, stdio: "inherit" };
// run `lerna bootstrap`
let lernaUseCi: boolean = false;
if (process.env.npm_config_argv) {
let npmArgs: { cooked?: string[] };
let npmArgs: { cooked?: string[] } | null = null;
try {
npmArgs = JSON.parse(process.env.npm_config_argv);
} catch {}
Expand Down
93 changes: 63 additions & 30 deletions src/chains/ethereum/address/package-lock.json

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

2 changes: 1 addition & 1 deletion src/chains/ethereum/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"cross-env": "7.0.3",
"mocha": "9.1.3",
"nyc": "15.1.0",
"ts-node": "9.1.1",
"ts-node": "10.4.0",
"ttypescript": "1.5.12",
"typescript": "4.5.2"
},
Expand Down
Loading

0 comments on commit 4b1240f

Please sign in to comment.