Merge pull request #6542 from overleaf/jpa-em-code-sharing-workspaces

[misc] npm workspaces

GitOrigin-RevId: 87aa72db6637fb238d7cd35b0a48ac3ed58ab3eb
This commit is contained in:
Jakob Ackermann
2022-02-16 11:31:07 +00:00
committed by Copybot
parent b2062462e7
commit fbf86af2c5
111 changed files with 80687 additions and 92611 deletions
@@ -4,6 +4,7 @@ access-token-encryptor
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
File diff suppressed because it is too large Load Diff
@@ -5,10 +5,10 @@
"main": "index.js",
"scripts": {
"test": "mocha test/**/*.js",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test"
},
"author": "",
@@ -19,11 +19,11 @@
},
"devDependencies": {
"bunyan": "^1.8.15",
"chai": "^4.3.4",
"chai": "^4.3.6",
"@overleaf/logger": "^2.2.0",
"mocha": "^6.2.2",
"mocha": "^8.4.0",
"nock": "0.15.2",
"sandboxed-module": "^2.0.3",
"sinon": "^7.5.0"
"sandboxed-module": "^2.0.4",
"sinon": "^9.2.4"
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ logger
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
-1139
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -10,10 +10,10 @@
"version": "3.1.0",
"scripts": {
"test": "mocha --grep=$MOCHA_GREP test/**/*.js",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"test:ci": "npm run test"
},
"dependencies": {
@@ -24,11 +24,11 @@
"yn": "^4.0.0"
},
"devDependencies": {
"chai": "^4.2.0",
"chai": "^4.3.6",
"mocha": "^8.4.0",
"sandboxed-module": "^2.0.4",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0"
"sinon": "^9.2.4",
"sinon-chai": "^3.7.0"
},
"peerDependencies": {
"@overleaf/metrics": ">= 4.0.0"
+2 -1
View File
@@ -4,6 +4,7 @@ metrics
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
-2486
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -16,19 +16,19 @@
},
"devDependencies": {
"bunyan": "^1.0.0",
"chai": "^4.2.0",
"mocha": "^8.0.1",
"chai": "^4.3.6",
"mocha": "^8.4.0",
"sandboxed-module": "^2.0.4",
"sinon": "^9.0.2"
"sinon": "^9.2.4"
},
"scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"test:unit": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/unit",
"test:acceptance": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/acceptance",
"test": "npm run test:unit && npm run test:acceptance",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test"
},
"peerDependencies": {
+2 -1
View File
@@ -4,6 +4,7 @@ o-error
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
-3009
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -21,15 +21,15 @@
"build": "npm run --silent typecheck && npm run --silent test && npm run --silent declaration:build && npm run --silent update-readme",
"declaration:build": "rm -f index.d.ts && tsc --allowJs --declaration --emitDeclarationOnly --moduleResolution node --target ES6 index.js",
"declaration:check": "git diff --exit-code -- index.d.ts",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"prepublishOnly": "npm run --silent declaration:build && npm run --silent declaration:check",
"test": "mocha",
"test:coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
"typecheck": "tsc --allowJs --checkJs --noEmit --moduleResolution node --strict --target ES6 *.js test/**/*.js",
"update-readme": "doc/update-readme.js",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run typecheck && npm run test"
},
"author": "Overleaf (https://www.overleaf.com)",
@@ -38,7 +38,7 @@
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/node": "^14.18.1",
"chai": "^4.3.4",
"chai": "^4.3.6",
"jsdoc-to-markdown": "^7.1.0",
"markdown-toc": "^1.2.0",
"mocha": "^9.1.3",
+2 -1
View File
@@ -4,6 +4,7 @@ object-persistor
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -6,10 +6,10 @@
"scripts": {
"test": "npm run lint && npm run format && npm run test:unit",
"test:unit": "mocha",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test:unit"
},
"repository": {
@@ -19,7 +19,7 @@
"author": "Overleaf (https://www.overleaf.com/)",
"license": "AGPL-3.0",
"dependencies": {
"@google-cloud/storage": "^5.1.2",
"@google-cloud/storage": "~5.1.2",
"@overleaf/o-error": "^3.4.0",
"aws-sdk": "^2.718.0",
"fast-crc32c": "^2.0.0",
@@ -30,12 +30,12 @@
"tiny-async-pool": "^1.1.0"
},
"devDependencies": {
"chai": "^4.2.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"mocha": "^8.0.1",
"mocha": "^8.4.0",
"mongodb": "^3.5.9",
"sandboxed-module": "^2.0.4",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0"
"sinon": "^9.2.4",
"sinon-chai": "^3.7.0"
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ redis-wrapper
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -11,10 +11,10 @@
"repository": "github:overleaf/redis-wrapper",
"license": "ISC",
"scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test": "mocha --recursive test/unit/src/",
"test:ci": "npm run test"
},
@@ -26,9 +26,9 @@
},
"devDependencies": {
"@overleaf/o-error": "^3.4.0",
"chai": "^4.3.4",
"chai": "^4.3.6",
"@overleaf/logger": "^2.3.0",
"mocha": "^8.3.2",
"mocha": "^8.4.0",
"sandboxed-module": "^2.0.4",
"sinon": "^9.2.4"
}
+26 -43
View File
@@ -1,58 +1,41 @@
/* eslint-disable no-console */
let defaults, possibleConfigFiles, settingsExist
const fs = require('fs')
const path = require('path')
const env = (process.env.NODE_ENV || 'development').toLowerCase()
const Path = require('path')
const { merge } = require('./merge')
const defaultSettingsPath = path.join(
__dirname,
'../../../config/settings.defaults'
)
const CWD = process.cwd()
const NODE_ENV = (process.env.NODE_ENV || 'development').toLowerCase()
const SHARELATEX_CONFIG = process.env.SHARELATEX_CONFIG
if (fs.existsSync(`${defaultSettingsPath}.js`)) {
console.log(`Using default settings from ${defaultSettingsPath}.js`)
defaults = require(`${defaultSettingsPath}.js`)
let settings
let settingsExist = false
const defaultsPath = pathIfExists(Path.join(CWD, 'config/settings.defaults.js'))
if (defaultsPath) {
console.log(`Using default settings from ${defaultsPath}`)
settings = require(defaultsPath)
settingsExist = true
} else if (fs.existsSync(`${defaultSettingsPath}.coffee`)) {
// TODO: remove this in the next major version
throw new Error(
`CoffeeScript settings file ${defaultSettingsPath}.coffee is no longer supported, please convert to JavaScript`
)
} else {
defaults = {}
settingsExist = false
settings = {}
}
if (process.env.SHARELATEX_CONFIG) {
possibleConfigFiles = [process.env.SHARELATEX_CONFIG]
} else {
possibleConfigFiles = [
path.join(process.cwd(), `config/settings.${env}.js`),
path.join(__dirname, `../../../config/settings.${env}.js`),
// TODO: remove these in the next major version
path.join(process.cwd(), `config/settings.${env}.coffee`),
path.join(__dirname, `../../../config/settings.${env}.coffee`),
]
}
for (const file of possibleConfigFiles) {
if (fs.existsSync(file)) {
// TODO: remove this in the next major version
if (file.endsWith('.coffee')) {
throw new Error(
`CoffeeScript settings file ${file} is no longer supported, please convert to JavaScript`
)
}
console.log('Using settings from ' + file)
module.exports = merge(require(file), defaults)
settingsExist = true
break
}
const overridesPath =
pathIfExists(SHARELATEX_CONFIG) ||
pathIfExists(Path.join(CWD, `config/settings.${NODE_ENV}.js`))
if (overridesPath) {
console.log(`Using settings from ${overridesPath}`)
settings = merge(require(overridesPath), settings)
settingsExist = true
}
if (!settingsExist) {
console.warn("No settings or defaults found. I'm flying blind.")
}
module.exports = defaults
module.exports = settings
function pathIfExists(path) {
if (path && fs.existsSync(path)) {
return path
}
return null
}
+2 -1
View File
@@ -4,6 +4,7 @@ settings
--env-add=
--env-pass-through=
--is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3
--public-repo=False
--script-version=4.0.0
--script-version=4.1.0
-5
View File
@@ -1,5 +0,0 @@
{
"name": "@overleaf/settings",
"version": "2.1.1",
"lockfileVersion": 1
}
+5 -5
View File
@@ -1,13 +1,13 @@
{
"name": "@overleaf/settings",
"description": "A centralised settings system for Overleaf",
"version": "2.1.1",
"version": "3.0.0",
"repository": "overleaf/settings-module",
"scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "prettier --write $PWD/'**/*.js'",
"test": "echo noop",
"test:ci": "echo noop"
}