From 91a932ab6c13ec6470e38c047e554e8fd352a1ac Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 21 Jul 2024 11:17:17 +1200 Subject: [PATCH] chore: update dependencies --- README.md | 19 ++++-- package-lock.json | 95 +++++++++++++++++++++------- package.json | 12 ++-- src/nrun.js | 1 + src/yarn_remove_package_from_lock.js | 4 +- tsconfig.json | 6 +- 6 files changed, 95 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index bf5a466..a5cfcbc 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,23 @@ # scripts -This is a loose collection of "scripts" that I have had use for, and that I want to keep around somewhere just in case. +This is a loose collection of "scripts" that I have had use for, and that I want +to keep around somewhere just in case. -PRs & issues are welcomed, so feel free to ask questions, request help, improve existing stuff (any form of documentation is especially welcomed<3), and point out flaws. +PRs & issues are welcomed, so feel free to ask questions, request help, improve +existing stuff (any form of documentation is especially welcomed<3), and point +out flaws. -While the majority of scripts are written in shell, there are a few scripts powered by Node/JS. -These require Node 12+, but otherwise have no dependencies - the `package.json` in the repo provides only dev dependencies such as `TypeScript` & `Prettier`. +While the majority of scripts are written in shell, there are a few scripts +powered by Node/JS. These require Node 12+, but otherwise have no dependencies - +the `package.json` in the repo provides only dev dependencies such as +`TypeScript` & `Prettier`. Some details on the files so far: ### `git-compare-between-branchs` -Commands & stuff for easily comparing branches; this is useful for gitflow stuff. +Commands & stuff for easily comparing branches; this is useful for gitflow +stuff. -It can help you answer "What branches have been merged on both `master` and `production`?". +It can help you answer "What branches have been merged on both `master` and +`production`?". diff --git a/package-lock.json b/package-lock.json index 4819dc6..15849f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,37 +1,84 @@ { "name": "scripts", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@schemastore/package": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@schemastore/package/-/package-0.0.5.tgz", - "integrity": "sha512-0XEiMT/Rh8I0SEIO81fo5MN3AHhONFv9SJ1IIJ5OTI3PN/jG032OPlHUMxvrun7yc6YUGtufVg2WPQVK8PaH5Q==", - "dev": true + "packages": { + "": { + "name": "scripts", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@schemastore/package": "0.0.10", + "@tsconfig/node20": "^20.1.4", + "@types/node": "^20.0.0", + "prettier": "^3.0.0", + "prettier-config-ackama": "^1.0.0", + "typescript": "^5.5.0" + } }, - "@types/node": { - "version": "14.0.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", - "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==", + "node_modules/@schemastore/package": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@schemastore/package/-/package-0.0.10.tgz", + "integrity": "sha512-D3LxMCnkgsb4LO5sDKf6E+yahM2SqpEHmkqMPDSJis5Cy/j2MgWo/g/iq0lECK0mrPWfx3hqKm2ZJlqxwbRJQA==", "dev": true }, - "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "node_modules/@tsconfig/node20": { + "version": "20.1.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.4.tgz", + "integrity": "sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==", "dev": true }, - "prettier-config-ackama": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/prettier-config-ackama/-/prettier-config-ackama-0.1.2.tgz", - "integrity": "sha512-ASax4E/pbyMdo0RxBX/UAdmb5mIDJc6pT6lCRDeKJuXIxxmRdk8xLga+KvqyN1VkJ4wWiyFPZ63R8W9ZHwYyhA==", - "dev": true + "node_modules/@types/node": { + "version": "20.14.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", + "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-config-ackama": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/prettier-config-ackama/-/prettier-config-ackama-1.1.0.tgz", + "integrity": "sha512-Tpo5Y/77rA1vkIjztF/l/3AWWW665H+atYqZ5C5m0KLwXG7CP7+vXsmpWLiQXYP3pbBLTw7BWTS9t7ERiw0Ejw==", + "dev": true, + "peerDependencies": { + "prettier": ">= 2.0" + } + }, + "node_modules/typescript": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } }, - "typescript": { - "version": "3.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", - "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true } } diff --git a/package.json b/package.json index 03e0b01..a2bc86e 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,12 @@ "typecheck": "tsc --noEmit" }, "prettier": "prettier-config-ackama", - "dependencies": {}, "devDependencies": { - "@schemastore/package": "0.0.5", - "@types/node": "^14.0.13", - "prettier": "^2.0.5", - "prettier-config-ackama": "^0.1.2", - "typescript": "^3.9.5" + "@schemastore/package": "0.0.10", + "@tsconfig/node20": "^20.1.4", + "@types/node": "^20.0.0", + "prettier": "^3.0.0", + "prettier-config-ackama": "^1.0.0", + "typescript": "^5.5.0" } } diff --git a/src/nrun.js b/src/nrun.js index a5d8800..f74b3c0 100755 --- a/src/nrun.js +++ b/src/nrun.js @@ -11,6 +11,7 @@ const readPackageJsonOrExit = () => { return require(join(process.cwd(), 'package.json')); } catch (error) { // if we could not find a `package.json`, don't do anything + // @ts-expect-error: it's not worth trying to cast this to ErrnoException if (error.code === 'MODULE_NOT_FOUND') { // console.warn(process.env); process.exit(); diff --git a/src/yarn_remove_package_from_lock.js b/src/yarn_remove_package_from_lock.js index 0c29f72..fcd57a6 100755 --- a/src/yarn_remove_package_from_lock.js +++ b/src/yarn_remove_package_from_lock.js @@ -31,7 +31,9 @@ const findBlockInLock = (lockContents, packageVersionHeader) => { // add a newline to ensure that we're matching against the "whole line" otherwise // we'll error on e.g. `first-pkg` and `my-first-pkg` when trying to remove `first-pgk` - if (lockContents.indexOf(`\n${packageVersionHeader}`, lockEntryStart + 1) !== -1) { + if ( + lockContents.indexOf(`\n${packageVersionHeader}`, lockEntryStart + 1) !== -1 + ) { throw new Error( 'INTEGRITY FAILURE: Multiple matches for packageVersionHeader in yarn.lock' ); diff --git a/tsconfig.json b/tsconfig.json index b4ee3d1..1cf3cb8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,14 @@ { + "extends": "@tsconfig/node20", "compilerOptions": { - "target": "ES2019", "module": "CommonJS", "moduleResolution": "Node", - "lib": ["ES2020"], "rootDir": "./", "baseUrl": "./", "checkJs": true, "allowJs": true, "noEmit": true, - "strict": true, "resolveJsonModule": true, - "useDefineForClassFields": true, - "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noEmitOnError": true, "noUnusedLocals": true,