diff --git a/.gitignore b/.gitignore index 20a95464ff..8698d163a9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,7 @@ # JetBrains IDE files .idea/ -# Tracks package-lock.json installation state -.installed.package-lock.json + # Linkinator full site link check results .linkinator/ diff --git a/package-lock.json b/package-lock.json index a5c6dc6997..e7b425dfdc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "packages": { "": { "name": "docs.github.com", - "hasInstallScript": true, "license": "(MIT AND CC-BY-4.0)", "dependencies": { "@elastic/elasticsearch": "8.13.1", diff --git a/package.json b/package.json index 2aaffe7435..2240ee1767 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "check-github-github-links": "tsx src/links/scripts/check-github-github-links.ts", "clone-early-access": "./src/early-access/scripts/clone-locally", "clone-translations": "./src/languages/scripts/clone-translations.sh", - "cmp-files": "tsx src/workflows/cmp-files.ts", "content-changes-table-comment": "tsx src/workflows/content-changes-table-comment.ts", "copy-fixture-data": "tsx src/tests/scripts/copy-fixture-data.ts", "count-translation-corruptions": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsx src/languages/scripts/count-translation-corruptions.ts", @@ -66,7 +65,6 @@ "openapi-docs": "tsx src/rest/docs.ts", "playwright-test": "playwright test --config src/fixtures/playwright.config.ts --project=\"Google Chrome\"", "lint-report": "tsx src/content-linter/scripts/lint-report.ts", - "postinstall": "cp package-lock.json .installed.package-lock.json && echo \"Updated .installed.package-lock.json\" # see husky/post-checkout and husky/post-merge", "precompute-pageinfo": "tsx src/article-api/scripts/precompute-pageinfo.ts", "prepare": "husky src/workflows/husky", "prettier": "prettier -w \"**/*.{ts,tsx,scss,yml,yaml}\"", diff --git a/src/workflows/cmp-files.ts b/src/workflows/cmp-files.ts deleted file mode 100755 index 91708766dd..0000000000 --- a/src/workflows/cmp-files.ts +++ /dev/null @@ -1,29 +0,0 @@ -// [start-readme] -// -// Given N files. Exit 0 if they all exist and are identical in content. -// -// [end-readme] - -import fs from 'fs' - -import { program } from 'commander' - -program.description('Compare N files').arguments('[files...]').parse(process.argv) - -main(program.args) - -function main(files: string[]) { - if (files.length < 2) throw new Error('Must be at least 2 files') - try { - const contents = files.map((file) => fs.readFileSync(file, 'utf-8')) - if (new Set(contents).size > 1) { - process.exit(1) - } - } catch (error: any) { - if (error.code === 'ENOENT') { - process.exit(1) - } else { - throw error - } - } -} diff --git a/src/workflows/husky/post-checkout b/src/workflows/husky/post-checkout deleted file mode 100755 index 2b3c744788..0000000000 --- a/src/workflows/husky/post-checkout +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -[ -n "$CI" ] && exit 0 - -# Ignore this check if user has DOCS_NO_AUTO_NPM set in their environment -if [ -n "$DOCS_NO_AUTO_NPM" ]; then - echo "Skipping auto-npm install because DOCS_NO_AUTO_NPM is set" - exit 0 -fi - -# Same process in husky/post-merge -echo "Checking if packages need to be installed..." -if npm run cmp-files -- package-lock.json .installed.package-lock.json; then - echo "Packages are up-to-date" -else - echo "Installing packages..." - npm install - echo "Packages are now up-to-date" -fi diff --git a/src/workflows/husky/post-merge b/src/workflows/husky/post-merge deleted file mode 100755 index a5f5599caa..0000000000 --- a/src/workflows/husky/post-merge +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -[ -n "$CI" ] && exit 0 - -# Ignore this check if user has DOCS_NO_AUTO_NPM set in their environment -if [ -n "$DOCS_NO_AUTO_NPM" ]; then - echo "Skipping auto-npm install because DOCS_NO_AUTO_NPM is set" - exit 0 -fi - -# Same process in husky/post-checkout -echo "Checking if packages need to be installed..." -if npm run cmp-files -- package-lock.json .installed.package-lock.json; then - echo "Packages are up-to-date" -else - echo "Installing packages..." - npm install - echo "Packages are now up-to-date" -fi