Remove automatic npm install feature (#58731)
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -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/
|
||||
|
||||
1
package-lock.json
generated
1
package-lock.json
generated
@@ -5,7 +5,6 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "docs.github.com",
|
||||
"hasInstallScript": true,
|
||||
"license": "(MIT AND CC-BY-4.0)",
|
||||
"dependencies": {
|
||||
"@elastic/elasticsearch": "8.13.1",
|
||||
|
||||
@@ -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}\"",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user