@netlify/build 27.13.0 → 27.15.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.15.1",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/core/main.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@bugsnag/js": "^7.0.0",
|
|
59
|
-
"@netlify/edge-bundler": "^1.
|
|
59
|
+
"@netlify/edge-bundler": "^1.13.0",
|
|
60
60
|
"@netlify/cache-utils": "^4.0.0",
|
|
61
61
|
"@netlify/config": "^18.2.0",
|
|
62
62
|
"@netlify/functions-utils": "^4.2.4",
|
package/src/core/build.js
CHANGED
|
@@ -455,7 +455,12 @@ const initAndRunBuild = async function ({
|
|
|
455
455
|
configMutations,
|
|
456
456
|
}
|
|
457
457
|
} finally {
|
|
458
|
-
|
|
458
|
+
// Terminate the child processes of plugins so that they don't linger after
|
|
459
|
+
// the build is finished. The exception is when running in the dev timeline
|
|
460
|
+
// since those are long-running events by nature.
|
|
461
|
+
if (timeline !== 'dev') {
|
|
462
|
+
stopPlugins(childProcesses)
|
|
463
|
+
}
|
|
459
464
|
}
|
|
460
465
|
}
|
|
461
466
|
|
|
@@ -36,7 +36,7 @@ const isNotCorePlugin = function ({ origin }) {
|
|
|
36
36
|
|
|
37
37
|
const isRuntime = function ({ packageName }) {
|
|
38
38
|
// Make this a bit more robust in the future
|
|
39
|
-
return ['@netlify/next-runtime'].includes(packageName)
|
|
39
|
+
return ['@netlify/next-runtime', '@netlify/plugin-nextjs'].includes(packageName)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const getPluginDescription = function (
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'
|
|
2
2
|
import { pathToFileURL } from 'url'
|
|
3
3
|
|
|
4
|
+
import { ROOT_PACKAGE_JSON } from '../../utils/json.js'
|
|
5
|
+
import { DEV_EVENTS, EVENTS } from '../events.js'
|
|
6
|
+
|
|
4
7
|
import { addTsErrorInfo } from './typescript.js'
|
|
5
8
|
|
|
6
9
|
const require = createRequire(import.meta.url)
|
|
@@ -48,8 +51,13 @@ const loadLogic = function ({ logic, inputs }) {
|
|
|
48
51
|
return logic
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
const metadata = {
|
|
55
|
+
events: new Set([...DEV_EVENTS, ...EVENTS]),
|
|
56
|
+
version: ROOT_PACKAGE_JSON.version,
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
try {
|
|
52
|
-
return logic(inputs)
|
|
60
|
+
return logic(inputs, metadata)
|
|
53
61
|
} catch (error) {
|
|
54
62
|
error.message = `Could not load plugin:\n${error.message}`
|
|
55
63
|
throw error
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { promises as fs } from 'fs'
|
|
2
2
|
import { dirname, join, resolve } from 'path'
|
|
3
|
+
import { env } from 'process'
|
|
3
4
|
|
|
4
5
|
import { bundle, find } from '@netlify/edge-bundler'
|
|
5
6
|
import { pathExists } from 'path-exists'
|
|
6
7
|
|
|
7
8
|
import { logFunctionsToBundle } from '../../log/messages/core_steps.js'
|
|
9
|
+
import { getUtils } from '../../plugins/child/utils.js'
|
|
8
10
|
|
|
9
11
|
import { tagBundlingError } from './lib/error.js'
|
|
10
12
|
import { parseManifest } from './lib/internal_manifest.js'
|
|
@@ -15,26 +17,20 @@ const DENO_CLI_CACHE_DIRECTORY = '.netlify/plugins/deno-cli'
|
|
|
15
17
|
const IMPORT_MAP_FILENAME = 'edge-functions-import-map.json'
|
|
16
18
|
|
|
17
19
|
// eslint-disable-next-line complexity, max-statements
|
|
18
|
-
const coreStep = async function ({
|
|
19
|
-
|
|
20
|
-
constants: {
|
|
20
|
+
const coreStep = async function ({ buildDir, constants, debug, systemLog, featureFlags, logs, netlifyConfig }) {
|
|
21
|
+
const {
|
|
21
22
|
EDGE_FUNCTIONS_DIST: distDirectory,
|
|
22
23
|
EDGE_FUNCTIONS_SRC: srcDirectory,
|
|
23
24
|
INTERNAL_EDGE_FUNCTIONS_SRC: internalSrcDirectory,
|
|
24
25
|
IS_LOCAL: isRunningLocally,
|
|
25
|
-
}
|
|
26
|
-
debug,
|
|
27
|
-
systemLog,
|
|
28
|
-
featureFlags,
|
|
29
|
-
logs,
|
|
30
|
-
netlifyConfig,
|
|
31
|
-
}) {
|
|
26
|
+
} = constants
|
|
32
27
|
const { edge_functions: configDeclarations = [] } = netlifyConfig
|
|
33
28
|
const distPath = resolve(buildDir, distDirectory)
|
|
34
29
|
const internalSrcPath = resolve(buildDir, internalSrcDirectory)
|
|
35
30
|
const distImportMapPath = join(dirname(internalSrcPath), IMPORT_MAP_FILENAME)
|
|
36
31
|
const srcPath = srcDirectory ? resolve(buildDir, srcDirectory) : undefined
|
|
37
32
|
const sourcePaths = [internalSrcPath, srcPath].filter(Boolean)
|
|
33
|
+
const utils = getUtils({ event: 'onBuild', constants, runState: {} })
|
|
38
34
|
|
|
39
35
|
logFunctions({ internalSrcDirectory, internalSrcPath, logs, srcDirectory, srcPath })
|
|
40
36
|
|
|
@@ -69,6 +65,12 @@ const coreStep = async function ({
|
|
|
69
65
|
|
|
70
66
|
await validateEdgeFunctionsManifest({ buildDir, constants: { EDGE_FUNCTIONS_DIST: distDirectory } })
|
|
71
67
|
|
|
68
|
+
if (!isRunningLocally) {
|
|
69
|
+
const logsLink = `https://app.netlify.com/sites/${env.SITE_NAME}/edge-functions?scope=deployid:${env.DEPLOY_ID}`
|
|
70
|
+
const summaryText = `${declarations.length} edge functions deployed. [Watch Logs](${logsLink})`
|
|
71
|
+
utils.status.show({ summary: summaryText, title: 'Edge Functions' })
|
|
72
|
+
}
|
|
73
|
+
|
|
72
74
|
return {}
|
|
73
75
|
}
|
|
74
76
|
|