@netlify/build 27.20.1 → 27.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // This is a workaround for npm issue: https://github.com/npm/cli/issues/2632
4
- // eslint-disable-next-line import/no-unassigned-import
4
+
5
5
  import './lib/core/bin.js'
package/lib/core/build.js CHANGED
@@ -133,7 +133,6 @@ const tExecBuild = async function ({
133
133
  const systemLog = getSystemLogger(logs, debug, systemLogFile)
134
134
  const pluginsOptions = addCorePlugins({ netlifyConfig, constants })
135
135
  // `errorParams` is purposely stateful
136
- // eslint-disable-next-line fp/no-mutating-assign
137
136
  Object.assign(errorParams, { netlifyConfig, pluginsOptions, siteInfo, childEnv, userNodeVersion })
138
137
 
139
138
  const {
package/lib/core/flags.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint eslint-comments/no-use: off, max-lines: off */
2
-
3
1
  const jsonParse = function (value) {
4
2
  return value === undefined ? undefined : JSON.parse(value)
5
3
  }
@@ -7,7 +7,7 @@ export const getSeverity = function (severity = FALLBACK_SEVERITY) {
7
7
  }
8
8
 
9
9
  // Map error severities to exit codes and status (used for telemetry purposes)
10
- /* eslint-disable no-magic-numbers */
10
+
11
11
  const SEVERITY_MAP = {
12
12
  success: { severityCode: 0, status: 'success' },
13
13
  none: { severityCode: 1, status: 'cancelled' },
@@ -6,13 +6,11 @@ import { CUSTOM_ERROR_KEY } from './info.js'
6
6
  // process. We need this since errors static properties are not kept by
7
7
  // `v8.serialize()`.
8
8
  export const jsonToError = function ({ name, message, stack, ...errorProps }) {
9
- // eslint-disable-next-line unicorn/error-message
10
9
  const error = new Error('')
11
10
 
12
11
  assignErrorProps(error, { name, message, stack })
13
12
  // Assign static error properties (if any)
14
13
  // We need to mutate the `error` directly to preserve its `name`, `stack`, etc.
15
- // eslint-disable-next-line fp/no-mutating-assign
16
14
  Object.assign(error, errorProps)
17
15
 
18
16
  return error
@@ -97,7 +97,9 @@ const updateErrorName = function (error, type) {
97
97
  // This might fail if `name` is a getter or is non-writable.
98
98
  try {
99
99
  error.name = type
100
- } catch {}
100
+ } catch {
101
+ // continue regardless error
102
+ }
101
103
  return name
102
104
  }
103
105
 
@@ -126,11 +128,10 @@ const getEventProps = function ({ severity, group, groupingHash, metadata, app }
126
128
  // Add more information to Bugsnag events
127
129
  const onError = function (event, eventProps) {
128
130
  // Bugsnag client requires directly mutating the `event`
129
- // eslint-disable-next-line fp/no-mutating-assign
130
131
  Object.assign(event, {
131
132
  ...eventProps,
132
133
  unhandled: event.unhandled || eventProps.unhandled,
133
- // eslint-disable-next-line no-underscore-dangle
134
+
134
135
  _metadata: { ...event._metadata, ...eventProps._metadata },
135
136
  app: { ...event.app, ...eventProps.app },
136
137
  })
@@ -66,4 +66,6 @@ const getLogger = function (logs, isTest) {
66
66
  return { debug: noop, info: noop, warn: logFunc, error: logFunc }
67
67
  }
68
68
 
69
- const noop = function () {}
69
+ const noop = function () {
70
+ // this is a noop function
71
+ }
@@ -22,7 +22,6 @@ const importLogic = async function (pluginPath, tsNodeService) {
22
22
  // which is currently making it impossible for local plugins to use both
23
23
  // pure ES modules and TypeScript.
24
24
  if (tsNodeService !== undefined) {
25
- // eslint-disable-next-line import/no-dynamic-require
26
25
  return require(pluginPath)
27
26
  }
28
27
 
@@ -39,7 +39,9 @@ const getError = function (error, message, func) {
39
39
  // This might fail if `name` is a getter or is non-writable.
40
40
  try {
41
41
  error.message = `${message}\n${error.message}`
42
- } catch {}
42
+ } catch {
43
+ // continue regardless error
44
+ }
43
45
  return error
44
46
  }
45
47
 
@@ -101,14 +101,12 @@ const sendEventToChild = async function ({ childProcess, callId, eventName, payl
101
101
  // Respond to events from parent to child process.
102
102
  // This runs forever until `childProcess.kill()` is called.
103
103
  // We need to use `new Promise()` and callbacks because this runs forever.
104
- // eslint-disable-next-line promise/prefer-await-to-callbacks
105
104
  export const getEventsFromParent = function (callback) {
106
105
  return new Promise((resolve, reject) => {
107
106
  process.on('message', async (message) => {
108
107
  try {
109
108
  const [callId, eventName, payload] = message
110
109
  const payloadA = parsePayload(payload)
111
- // eslint-disable-next-line promise/prefer-await-to-callbacks
112
110
  return await callback(callId, eventName, payloadA)
113
111
  } catch (error) {
114
112
  reject(error)
@@ -14,7 +14,6 @@ import { validateEdgeFunctionsManifest } from './validate_manifest/validate_edge
14
14
  const DENO_CLI_CACHE_DIRECTORY = '.netlify/plugins/deno-cli'
15
15
  const IMPORT_MAP_FILENAME = 'edge-functions-import-map.json'
16
16
 
17
- // eslint-disable-next-line complexity, max-statements
18
17
  const coreStep = async function ({
19
18
  buildDir,
20
19
  constants: {
@@ -55,7 +55,7 @@ const zipFunctionsAndLogResults = async ({
55
55
  }
56
56
 
57
57
  // Plugin to package Netlify functions with @netlify/zip-it-and-ship-it
58
- // eslint-disable-next-line complexity
58
+
59
59
  const coreStep = async function ({
60
60
  childEnv,
61
61
  constants: {
@@ -128,7 +128,6 @@ const executeBuildStep = async function ({
128
128
  mode,
129
129
  })
130
130
 
131
- // eslint-disable-next-line fp/no-mutating-assign
132
131
  Object.assign(errorParams, { netlifyConfig, siteInfo, childEnv, userNodeVersion })
133
132
 
134
133
  try {
@@ -33,7 +33,7 @@ const sendTimers = async function ({ timers, host, port, framework }) {
33
33
  // the internal API.
34
34
  const startClient = async function (host, port) {
35
35
  const client = new StatsdClient({ host, port, socketTimeout: 0 })
36
- // eslint-disable-next-line no-underscore-dangle
36
+
37
37
  await promisify(client._socket._createSocket.bind(client._socket))()
38
38
  return client
39
39
  }
@@ -19,5 +19,7 @@ const getPackageObj = async function ({ cwd, normalize = true }) {
19
19
  return await readPackageUp({ cwd, normalize })
20
20
  // If the `package.json` is invalid and `normalize` is `true`, an error is
21
21
  // thrown. We return `undefined` then.
22
- } catch {}
22
+ } catch {
23
+ // continue regardless error
24
+ }
23
25
  }
@@ -34,7 +34,6 @@ export const resolvePath = async function (path, basedir) {
34
34
  // https://github.com/browserify/resolve/issues/151#issuecomment-368210310
35
35
  const resolvePathWithBasedir = function (path, basedir) {
36
36
  return new Promise((resolve, reject) => {
37
- // eslint-disable-next-line promise/prefer-await-to-callbacks
38
37
  resolveLib(path, { basedir }, (error, resolvedPath) => {
39
38
  if (error) {
40
39
  return reject(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "27.20.1",
3
+ "version": "27.20.2",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/core/main.js",
@@ -21,9 +21,9 @@
21
21
  "Swyx <swyx@netlify.com> (https://www.swyx.io)"
22
22
  ],
23
23
  "scripts": {
24
- "prepublishOnly": "cd ../../ && npm run prepublishOnly",
25
24
  "prebuild": "rm -rf lib",
26
25
  "build": "cp -a src lib/",
26
+ "pretest": "tsd .",
27
27
  "test": "ava",
28
28
  "test:ci": "c8 -r lcovonly -r text -r json ava",
29
29
  "test:measure": "node tools/tests_duration.mjs"
@@ -62,12 +62,12 @@
62
62
  "license": "MIT",
63
63
  "dependencies": {
64
64
  "@bugsnag/js": "^7.0.0",
65
- "@netlify/edge-bundler": "^2.6.0",
66
- "@netlify/cache-utils": "^4.1.5",
65
+ "@netlify/cache-utils": "^4.1.6",
67
66
  "@netlify/config": "^18.2.4",
67
+ "@netlify/edge-bundler": "^2.6.0",
68
68
  "@netlify/functions-utils": "^4.2.10",
69
69
  "@netlify/git-utils": "^4.1.2",
70
- "@netlify/plugins-list": "^6.46.0",
70
+ "@netlify/plugins-list": "^6.48.0",
71
71
  "@netlify/run-utils": "^4.0.2",
72
72
  "@netlify/zip-it-and-ship-it": "^7.1.2",
73
73
  "@sindresorhus/slugify": "^2.0.0",
@@ -121,6 +121,7 @@
121
121
  "@netlify/nock-udp": "^1.0.0",
122
122
  "atob": "^2.1.2",
123
123
  "ava": "^4.0.0",
124
+ "c8": "^7.12.0",
124
125
  "cpy": "^8.1.0",
125
126
  "del": "^6.0.0",
126
127
  "fast-safe-stringify": "^2.0.7",
@@ -134,9 +135,11 @@
134
135
  "path-key": "^4.0.0",
135
136
  "process-exists": "^5.0.0",
136
137
  "sinon": "^13.0.0",
138
+ "tsd": "^0.24.1",
137
139
  "yarn": "^1.22.4"
138
140
  },
139
141
  "engines": {
140
142
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
141
- }
143
+ },
144
+ "gitHead": "605e5e2c9053dde263beba12886e1160163ce3ec"
142
145
  }