Browse Source

Adding audit script and commiting all of the audits that it made, updating all yarn locks.

pull/4089/head
mike12345567 5 years ago
parent
commit
7802bb1e45
  1. 1
      package.json
  2. 1050
      packages/auth/yarn.lock
  3. 1773
      packages/bbui/yarn.lock
  4. 2
      packages/builder/vite.config.js
  5. 3413
      packages/builder/yarn.lock
  6. 601
      packages/cli/yarn.lock
  7. 2237
      packages/client/yarn.lock
  8. 4491
      packages/server/yarn.lock
  9. 1349
      packages/string-templates/yarn.lock
  10. 2547
      packages/worker/yarn.lock
  11. 50
      scripts/audit.js
  12. 2103
      yarn.lock

1
package.json

@ -59,6 +59,7 @@
"mode:self": "yarn env:selfhost:enable && yarn env:multi:disable && yarn env:account:disable",
"mode:cloud": "yarn env:selfhost:disable && yarn env:multi:enable && yarn env:account:disable",
"mode:account": "yarn mode:cloud && yarn env:account:enable",
"security:audit": "node scripts/audit.js",
"postinstall": "husky install"
}
}

1050
packages/auth/yarn.lock

File diff suppressed because it is too large

1773
packages/bbui/yarn.lock

File diff suppressed because it is too large

2
packages/builder/vite.config.js

@ -1,4 +1,4 @@
import svelte from "@sveltejs/vite-plugin-svelte"
import { svelte } from "@sveltejs/vite-plugin-svelte"
import replace from "@rollup/plugin-replace"
import path from "path"

3413
packages/builder/yarn.lock

File diff suppressed because it is too large

601
packages/cli/yarn.lock

File diff suppressed because it is too large

2237
packages/client/yarn.lock

File diff suppressed because it is too large

4491
packages/server/yarn.lock

File diff suppressed because it is too large

1349
packages/string-templates/yarn.lock

File diff suppressed because it is too large

2547
packages/worker/yarn.lock

File diff suppressed because it is too large

50
scripts/audit.js

@ -0,0 +1,50 @@
const fs = require("fs")
const { join } = require("path")
const { spawnSync } =require("child_process")
const PACKAGES_PATH = join(__dirname, "..", "packages")
function getPackages() {
return fs.readdirSync(PACKAGES_PATH)
}
function deleteFile(path) {
try {
fs.unlinkSync(path)
} catch (err) {
// don't error, it just doesn't exist
}
}
function removeModules(path) {
if (fs.existsSync(path)) {
fs.rmdirSync(path, { recursive: true })
}
}
function executeInPackage(packageName) {
const dir = join(PACKAGES_PATH, packageName)
if (!fs.existsSync(join(dir, "package.json"))) {
console.error(`SKIPPING ${packageName} directory, no package.json`)
return
}
const packageLockLoc = join(dir, "package-lock.json")
const modulesLoc = join(dir, "node_modules")
deleteFile(join(dir, "yarn.lock"))
deleteFile(packageLockLoc)
removeModules(modulesLoc)
const opts = { cwd: dir, stdio: "inherit", shell: true }
spawnSync("npm", ["i", "--package-lock-only"], opts)
spawnSync("npm", ["audit", "fix"], opts)
spawnSync("yarn", ["import"], opts)
deleteFile(packageLockLoc)
removeModules(modulesLoc)
}
const packages = getPackages()
for (let pkg of packages) {
executeInPackage(pkg)
}
spawnSync("yarn", ["bootstrap"], { cwd: join(__dirname, ".."), stdio: "inherit", shell: true })

2103
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save