netlify-cli 17.19.4 → 17.19.5
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/dist/commands/base-command.d.ts +1 -1
- package/dist/commands/base-command.js +1 -1
- package/dist/commands/serve/serve.d.ts.map +1 -1
- package/dist/commands/serve/serve.js +7 -3
- package/dist/lib/edge-functions/proxy.d.ts.map +1 -1
- package/dist/lib/edge-functions/proxy.js +2 -1
- package/dist/lib/edge-functions/registry.d.ts.map +1 -1
- package/dist/lib/edge-functions/registry.js +2 -1
- package/dist/lib/settings.d.ts +4 -11
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/lib/settings.js +4 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/proxy.d.ts.map +1 -1
- package/dist/utils/proxy.js +0 -25
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ export default class BaseCommand extends Command {
|
|
|
64
64
|
scheme?: string;
|
|
65
65
|
}): ReturnType<typeof resolveConfig>;
|
|
66
66
|
/**
|
|
67
|
-
* get a path inside the `.netlify` project folder
|
|
67
|
+
* get a path inside the `.netlify` project folder resolving with the workspace package
|
|
68
68
|
*/
|
|
69
69
|
getPathInProject(...paths: string[]): string;
|
|
70
70
|
/**
|
|
@@ -559,7 +559,7 @@ class BaseCommand extends Command {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
562
|
-
* get a path inside the `.netlify` project folder
|
|
562
|
+
* get a path inside the `.netlify` project folder resolving with the workspace package
|
|
563
563
|
*/
|
|
564
564
|
getPathInProject(...paths) {
|
|
565
565
|
return join(this.workspacePackage || '', '.netlify', ...paths);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/serve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwBxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAG5C,eAAO,MAAM,KAAK,YAAmB,YAAY,WAAW,WAAW,uBAgJtE,CAAA"}
|
|
@@ -3,9 +3,9 @@ import { BLOBS_CONTEXT_VARIABLE, encodeBlobsContext, getBlobsContext } from '../
|
|
|
3
3
|
import { promptEditorHelper } from '../../lib/edge-functions/editor-helper.js';
|
|
4
4
|
import { startFunctionsServer } from '../../lib/functions/server.js';
|
|
5
5
|
import { printBanner } from '../../utils/banner.js';
|
|
6
|
-
import {
|
|
6
|
+
import { NETLIFYDEVERR, NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, exit, log, normalizeConfig, } from '../../utils/command-helpers.js';
|
|
7
7
|
import detectServerSettings, { getConfigWithPlugins } from '../../utils/detect-server-settings.js';
|
|
8
|
-
import { getDotEnvVariables, getSiteInformation, injectEnvVariables
|
|
8
|
+
import { UNLINKED_SITE_MOCK_ID, getDotEnvVariables, getSiteInformation, injectEnvVariables } from '../../utils/dev.js';
|
|
9
9
|
import { getEnvelopeEnv } from '../../utils/env/index.js';
|
|
10
10
|
import { getInternalFunctionsDir } from '../../utils/functions/functions.js';
|
|
11
11
|
import { ensureNetlifyIgnore } from '../../utils/gitignore.js';
|
|
@@ -46,7 +46,11 @@ export const serve = async (options, command) => {
|
|
|
46
46
|
// Ensure the internal functions directory exists so that the functions
|
|
47
47
|
// server and registry are initialized, and any functions created by
|
|
48
48
|
// Netlify Build are loaded.
|
|
49
|
-
await getInternalFunctionsDir({
|
|
49
|
+
await getInternalFunctionsDir({
|
|
50
|
+
base: site.root,
|
|
51
|
+
ensureExists: true,
|
|
52
|
+
packagePath: command.workspacePackage,
|
|
53
|
+
});
|
|
50
54
|
let settings;
|
|
51
55
|
try {
|
|
52
56
|
settings = await detectServerSettings(devConfig, options, command);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/proxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAM3C,OAAO,WAAW,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/proxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAM3C,OAAO,WAAW,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAUhD,QAAA,MAAM,aAAa,eAAmC,CAAA;AA4BtD,eAAO,MAAM,kBAAkB,mCAI9B,CAAA;AAKD,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,aAAc,QAAQ,YAAY,MAAM,WAKxE,CAAA;AAED,eAAO,MAAM,uBAAuB,8BAMnC,CAAA;AAED,eAAO,MAAM,eAAe;eAqBf,MAAM;kBACH,YAAY;aACjB,WAAW;YACZ,QAAQ;gBACJ,MAAM;WACX,OAAO;SACT,QAAQ;aACJ,QAAQ;gBACL,QAAQ;qBACH,QAAQ;sBACP,QAAQ;qBACT,QAAQ;cACf,QAAQ;qBACD,QAAQ;gBACb,MAAM;;cAER,QAAQ;cACR,QAAQ;WACX,QAAQ;oBAyBI,eAAe,GAAG;IAAE,eAAe,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,iCAkDjF,CAAA;AAGD,eAAO,MAAM,sBAAsB,uBAA4C,CAAA"}
|
|
@@ -6,6 +6,7 @@ import getAvailablePort from 'get-port';
|
|
|
6
6
|
import { NETLIFYDEVERR, chalk, error as printError } from '../../utils/command-helpers.js';
|
|
7
7
|
import { getFeatureFlagsFromSiteInfo } from '../../utils/feature-flags.js';
|
|
8
8
|
import { getGeoLocation } from '../geo-location.js';
|
|
9
|
+
import { getPathInProject } from '../settings.js';
|
|
9
10
|
import { startSpinner, stopSpinner } from '../spinner.js';
|
|
10
11
|
import { getBootstrapURL } from './bootstrap.js';
|
|
11
12
|
import { DIST_IMPORT_MAP_PATH, EDGE_FUNCTIONS_SERVE_FOLDER } from './consts.js';
|
|
@@ -118,7 +119,7 @@ export const initializeProxy = async ({ accountId, blobsContext, command, config
|
|
|
118
119
|
export const isEdgeFunctionsRequest = (req) => req[headersSymbol] !== undefined;
|
|
119
120
|
const prepareServer = async ({ command, config, configPath, debug, directory, env: configEnv, featureFlags, getUpdatedConfig, inspectSettings, port, projectDir, repositoryRoot, }) => {
|
|
120
121
|
try {
|
|
121
|
-
const distImportMapPath =
|
|
122
|
+
const distImportMapPath = getPathInProject([DIST_IMPORT_MAP_PATH]);
|
|
122
123
|
const servePath = resolve(projectDir, command.getPathInProject(EDGE_FUNCTIONS_SERVE_FOLDER));
|
|
123
124
|
await rm(servePath, { force: true, recursive: true });
|
|
124
125
|
const runIsolate = await bundler.serve({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAuD,MAAM,uBAAuB,CAAA;AAE7G,OAAO,WAAW,MAAM,gCAAgC,CAAA;AAYxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA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 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
import { NETLIFYDEVERR, NETLIFYDEVLOG, NETLIFYDEVWARN, nonNullable, chalk, log, warn, watchDebounced, isNodeError, } from '../../utils/command-helpers.js';
|
|
5
5
|
import { MultiMap } from '../../utils/multimap.js';
|
|
6
|
+
import { getPathInProject } from '../settings.js';
|
|
6
7
|
import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from './consts.js';
|
|
7
8
|
/**
|
|
8
9
|
* Given an Edge Bundler module graph and an index of modules by path,
|
|
@@ -340,7 +341,7 @@ export class EdgeFunctionsRegistry {
|
|
|
340
341
|
return { functionsConfig, graph, npmSpecifiersWithExtraneousFiles, success };
|
|
341
342
|
}
|
|
342
343
|
get internalDirectory() {
|
|
343
|
-
return join(this.projectDir,
|
|
344
|
+
return join(this.projectDir, getPathInProject([INTERNAL_EDGE_FUNCTIONS_FOLDER]));
|
|
344
345
|
}
|
|
345
346
|
async readDeployConfig() {
|
|
346
347
|
const manifestPath = join(this.internalDirectory, 'manifest.json');
|
package/dist/lib/settings.d.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deprecated method to get netlify's home config - ~/.netlify/...
|
|
3
3
|
* @deprecated
|
|
4
|
-
* @param {string[]} paths
|
|
5
|
-
* @returns {string}
|
|
6
4
|
*/
|
|
7
|
-
export declare const getLegacyPathInHome: (paths:
|
|
5
|
+
export declare const getLegacyPathInHome: (paths: string[]) => string;
|
|
8
6
|
/**
|
|
9
7
|
* get a global path on the os base path
|
|
10
|
-
* @param {string[]} paths
|
|
11
|
-
* @returns {string}
|
|
12
8
|
*/
|
|
13
|
-
export declare const getPathInHome: (paths:
|
|
9
|
+
export declare const getPathInHome: (paths: string[]) => string;
|
|
14
10
|
/**
|
|
15
|
-
* get a path inside the project folder
|
|
16
|
-
* @param {string[]} paths
|
|
17
|
-
* @deprecated This does not work in monorepos use Basecommand.getPathInProject instead
|
|
18
|
-
* @returns {string}
|
|
11
|
+
* get a path inside the project folder "NOT WORKSPACE AWARE"
|
|
19
12
|
*/
|
|
20
|
-
export declare const getPathInProject: (paths:
|
|
13
|
+
export declare const getPathInProject: (paths: string[]) => string;
|
|
21
14
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,EAAE,WAAoD,CAAA;AAEvG;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,EAAE,WAA6C,CAAA;AAE1F;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,EAAE,WAAsC,CAAA"}
|
package/dist/lib/settings.js
CHANGED
|
@@ -6,32 +6,13 @@ const NETLIFY_HOME = '.netlify';
|
|
|
6
6
|
/**
|
|
7
7
|
* Deprecated method to get netlify's home config - ~/.netlify/...
|
|
8
8
|
* @deprecated
|
|
9
|
-
* @param {string[]} paths
|
|
10
|
-
* @returns {string}
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
|
-
export const getLegacyPathInHome = (paths) => {
|
|
14
|
-
const pathInHome = path.join(os.homedir(), NETLIFY_HOME, ...paths);
|
|
15
|
-
return pathInHome;
|
|
16
|
-
};
|
|
10
|
+
export const getLegacyPathInHome = (paths) => path.join(os.homedir(), NETLIFY_HOME, ...paths);
|
|
17
11
|
/**
|
|
18
12
|
* get a global path on the os base path
|
|
19
|
-
* @param {string[]} paths
|
|
20
|
-
* @returns {string}
|
|
21
13
|
*/
|
|
22
|
-
|
|
23
|
-
export const getPathInHome = (paths) => {
|
|
24
|
-
const pathInHome = path.join(OSBasedPaths.config, ...paths);
|
|
25
|
-
return pathInHome;
|
|
26
|
-
};
|
|
14
|
+
export const getPathInHome = (paths) => path.join(OSBasedPaths.config, ...paths);
|
|
27
15
|
/**
|
|
28
|
-
* get a path inside the project folder
|
|
29
|
-
* @param {string[]} paths
|
|
30
|
-
* @deprecated This does not work in monorepos use Basecommand.getPathInProject instead
|
|
31
|
-
* @returns {string}
|
|
16
|
+
* get a path inside the project folder "NOT WORKSPACE AWARE"
|
|
32
17
|
*/
|
|
33
|
-
|
|
34
|
-
export const getPathInProject = (paths) => {
|
|
35
|
-
const pathInProject = path.join(NETLIFY_HOME, ...paths);
|
|
36
|
-
return pathInProject;
|
|
37
|
-
};
|
|
18
|
+
export const getPathInProject = (paths) => path.join(NETLIFY_HOME, ...paths);
|