@vercel/remix-builder 2.0.2 → 2.0.4
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/index.js +3735 -19
- package/package.json +6 -6
- package/dist/build.d.ts +0 -2
- package/dist/build.js +0 -480
- package/dist/build.js.map +0 -1
- package/dist/hydrogen.d.ts +0 -23
- package/dist/hydrogen.js +0 -85
- package/dist/hydrogen.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js.map +0 -1
- package/dist/prepare-cache.d.ts +0 -2
- package/dist/prepare-cache.js +0 -25
- package/dist/prepare-cache.js.map +0 -1
- package/dist/utils.d.ts +0 -55
- package/dist/utils.js +0 -349
- package/dist/utils.js.map +0 -1
package/dist/hydrogen.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hydrogen.js","sourceRoot":"","sources":["../src/hydrogen.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAChC,uCAAqD;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,mBAAmB,CACjC,OAAgB,EAChB,gBAAwB;IAExB,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACjE,MAAM,mBAAmB,GAAG,UAAU,CAAC,oBAAoB,CACzD,qBAAU,CAAC,gBAAgB,CAC5B,CAAC,CAAC,CAAC,CAAC;IACL,MAAM,aAAa,GAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO,CAAC,GAAG,CACT,qCAAqC,IAAA,eAAQ,EAAC,gBAAgB,CAAC,GAAG,CACnE,CAAC;QACF,OAAO;KACR;IAED,MAAM,aAAa,GAAG,mBAAmB,CAAC,mBAAmB,CAC3D,qBAAU,CAAC,uBAAuB,CACnC,CAAC;IACF,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,aAAa,CAAC,EAAE;QAClD,OAAO,CAAC,GAAG,CACT,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C,UAAU;SAC5D,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACrB,IAAI,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC;IACrD,mBAAmB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAEjD,MAAM,cAAc,GAAG;QACrB,cAAc,EAAE,QAAQ;QACxB,mBAAmB,EAAE,WAAW;KACjC,CAAC;IACF,MAAM,OAAO,GAAG,iBAAiB,aAAa;SAC3C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,iBAAiB,IAAI,EAAE,CAAC;SAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;SAChD,GAAG,CACF,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CACT,YAAY,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,SAAS,CAC3C,CAAC,CACF,4BAA4B,IAAI,CAAC,SAAS,CACzC,CAAC,CACF,0CAA0C,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CACtE;SACA,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAEhB,MAAM,iBAAiB,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IACnD,OAAO,GAAG,OAAO,KAAK,iBAAiB,EAAE,CAAC;AAC5C,CAAC;AA9FD,kDA8FC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAa,QAAA,OAAO,GAAG,CAAC,CAAC;AACzB,0CAAwB;AACxB,kDAAgC"}
|
package/dist/prepare-cache.d.ts
DELETED
package/dist/prepare-cache.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prepareCache = void 0;
|
|
4
|
-
const build_utils_1 = require("@vercel/build-utils");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
7
|
-
const prepareCache = async ({ entrypoint, repoRootPath, workPath, }) => {
|
|
8
|
-
const root = repoRootPath || workPath;
|
|
9
|
-
const mountpoint = (0, path_1.dirname)(entrypoint);
|
|
10
|
-
const entrypointFsDirname = (0, path_1.join)(workPath, mountpoint);
|
|
11
|
-
const packageJsonPath = (0, path_1.join)(entrypointFsDirname, 'package.json');
|
|
12
|
-
const remixRunDevPath = (0, path_1.dirname)(utils_1._require.resolve('@remix-run/dev/package.json', {
|
|
13
|
-
paths: [entrypointFsDirname],
|
|
14
|
-
}));
|
|
15
|
-
const remixConfig = await (0, utils_1.chdirAndReadConfig)(remixRunDevPath, entrypointFsDirname, packageJsonPath);
|
|
16
|
-
const [nodeModulesFiles, cacheDirFiles] = await Promise.all([
|
|
17
|
-
// Cache `node_modules`
|
|
18
|
-
(0, build_utils_1.glob)('**/node_modules/**', root),
|
|
19
|
-
// Cache the Remix "cacheDirectory" (typically `.cache`)
|
|
20
|
-
(0, build_utils_1.glob)((0, path_1.relative)(root, (0, path_1.join)(remixConfig.cacheDirectory, '**')), root),
|
|
21
|
-
]);
|
|
22
|
-
return { ...nodeModulesFiles, ...cacheDirFiles };
|
|
23
|
-
};
|
|
24
|
-
exports.prepareCache = prepareCache;
|
|
25
|
-
//# sourceMappingURL=prepare-cache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-cache.js","sourceRoot":"","sources":["../src/prepare-cache.ts"],"names":[],"mappings":";;;AAAA,qDAA2C;AAC3C,+BAA+C;AAC/C,mCAAuD;AAGhD,MAAM,YAAY,GAAiB,KAAK,EAAE,EAC/C,UAAU,EACV,YAAY,EACZ,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,YAAY,IAAI,QAAQ,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;IACvC,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,IAAA,cAAO,EAC7B,gBAAQ,CAAC,OAAO,CAAC,6BAA6B,EAAE;QAC9C,KAAK,EAAE,CAAC,mBAAmB,CAAC;KAC7B,CAAC,CACH,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAkB,EAC1C,eAAe,EACf,mBAAmB,EACnB,eAAe,CAChB,CAAC;IACF,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1D,uBAAuB;QACvB,IAAA,kBAAI,EAAC,oBAAoB,EAAE,IAAI,CAAC;QAEhC,wDAAwD;QACxD,IAAA,kBAAI,EAAC,IAAA,eAAQ,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;KACnE,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa,EAAE,CAAC;AACnD,CAAC,CAAC;AA5BW,QAAA,YAAY,gBA4BvB"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import type { ConfigRoute, RouteManifest } from '@remix-run/dev/dist/config/routes';
|
|
4
|
-
import type { RemixConfig } from '@remix-run/dev/dist/config';
|
|
5
|
-
import type { BaseFunctionConfig } from '@vercel/static-config';
|
|
6
|
-
import type { CliType, SpawnOptionsExtended } from '@vercel/build-utils/dist/fs/run-user-scripts';
|
|
7
|
-
export declare const _require: typeof require;
|
|
8
|
-
export interface ResolvedNodeRouteConfig {
|
|
9
|
-
runtime: 'nodejs';
|
|
10
|
-
regions?: string[];
|
|
11
|
-
maxDuration?: number;
|
|
12
|
-
memory?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface ResolvedEdgeRouteConfig {
|
|
15
|
-
runtime: 'edge';
|
|
16
|
-
regions?: BaseFunctionConfig['regions'];
|
|
17
|
-
}
|
|
18
|
-
export type ResolvedRouteConfig = ResolvedNodeRouteConfig | ResolvedEdgeRouteConfig;
|
|
19
|
-
export interface ResolvedRoutePaths {
|
|
20
|
-
/**
|
|
21
|
-
* The full URL path of the route, as will be shown
|
|
22
|
-
* on the Functions tab in the deployment inspector.
|
|
23
|
-
*/
|
|
24
|
-
path: string;
|
|
25
|
-
/**
|
|
26
|
-
* The full URL path of the route, but with syntax that
|
|
27
|
-
* is compatible with the `path-to-regexp` module.
|
|
28
|
-
*/
|
|
29
|
-
rePath: string;
|
|
30
|
-
}
|
|
31
|
-
export declare function findEntry(dir: string, basename: string): string | undefined;
|
|
32
|
-
export declare function findConfig(dir: string, basename: string): string | undefined;
|
|
33
|
-
export declare function getResolvedRouteConfig(route: ConfigRoute, routes: RouteManifest, configs: Map<ConfigRoute, BaseFunctionConfig | null>, isHydrogen2: boolean): ResolvedRouteConfig;
|
|
34
|
-
export declare function calculateRouteConfigHash(config: ResolvedRouteConfig): string;
|
|
35
|
-
export declare function isLayoutRoute(routeId: string, routes: Pick<ConfigRoute, 'id' | 'parentId'>[]): boolean;
|
|
36
|
-
export declare function getRouteIterator(route: ConfigRoute, routes: RouteManifest): Generator<ConfigRoute, void, unknown>;
|
|
37
|
-
export declare function getPathFromRoute(route: ConfigRoute, routes: RouteManifest): ResolvedRoutePaths;
|
|
38
|
-
export declare function getRegExpFromPath(rePath: string): RegExp | false;
|
|
39
|
-
/**
|
|
40
|
-
* Updates the `dest` process.env object to match the `source` one.
|
|
41
|
-
* A function is returned to restore the the `dest` env back to how
|
|
42
|
-
* it was originally.
|
|
43
|
-
*/
|
|
44
|
-
export declare function syncEnv(source: NodeJS.ProcessEnv, dest: NodeJS.ProcessEnv): () => any;
|
|
45
|
-
export declare function chdirAndReadConfig(remixRunDevPath: string, dir: string, packageJsonPath: string): Promise<RemixConfig>;
|
|
46
|
-
export interface AddDependenciesOptions extends SpawnOptionsExtended {
|
|
47
|
-
saveDev?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Runs `npm i ${name}` / `pnpm i ${name}` / `yarn add ${name}`.
|
|
51
|
-
*/
|
|
52
|
-
export declare function addDependencies(cliType: CliType, names: string[], opts?: AddDependenciesOptions): Promise<void>;
|
|
53
|
-
export declare function resolveSemverMinMax(min: string, max: string, version: string): string;
|
|
54
|
-
export declare function ensureResolvable(start: string, base: string, pkgName: string): Promise<string>;
|
|
55
|
-
export declare function isESM(path: string): boolean;
|
package/dist/utils.js
DELETED
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
var _a;
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.isESM = exports.ensureResolvable = exports.resolveSemverMinMax = exports.addDependencies = exports.chdirAndReadConfig = exports.syncEnv = exports.getRegExpFromPath = exports.getPathFromRoute = exports.getRouteIterator = exports.isLayoutRoute = exports.calculateRouteConfigHash = exports.getResolvedRouteConfig = exports.findConfig = exports.findEntry = exports._require = void 0;
|
|
31
|
-
const semver_1 = __importDefault(require("semver"));
|
|
32
|
-
const child_process_1 = require("child_process");
|
|
33
|
-
const fs_1 = require("fs");
|
|
34
|
-
const path_1 = require("path");
|
|
35
|
-
const path_to_regexp_1 = require("path-to-regexp");
|
|
36
|
-
const build_utils_1 = require("@vercel/build-utils");
|
|
37
|
-
const build_utils_2 = require("@vercel/build-utils");
|
|
38
|
-
exports._require = eval('require');
|
|
39
|
-
const SPLAT_PATH = '/:params*';
|
|
40
|
-
const entryExts = ['.js', '.jsx', '.ts', '.tsx'];
|
|
41
|
-
function findEntry(dir, basename) {
|
|
42
|
-
for (const ext of entryExts) {
|
|
43
|
-
const file = (0, path_1.resolve)(dir, basename + ext);
|
|
44
|
-
if ((0, fs_1.existsSync)(file))
|
|
45
|
-
return (0, path_1.relative)(dir, file);
|
|
46
|
-
}
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
exports.findEntry = findEntry;
|
|
50
|
-
const configExts = ['.js', '.cjs', '.mjs'];
|
|
51
|
-
function findConfig(dir, basename) {
|
|
52
|
-
for (const ext of configExts) {
|
|
53
|
-
const name = basename + ext;
|
|
54
|
-
const file = (0, path_1.join)(dir, name);
|
|
55
|
-
if ((0, fs_1.existsSync)(file))
|
|
56
|
-
return file;
|
|
57
|
-
}
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
exports.findConfig = findConfig;
|
|
61
|
-
function isEdgeRuntime(runtime) {
|
|
62
|
-
return runtime === 'edge' || runtime === 'experimental-edge';
|
|
63
|
-
}
|
|
64
|
-
function getResolvedRouteConfig(route, routes, configs, isHydrogen2) {
|
|
65
|
-
let runtime;
|
|
66
|
-
let regions;
|
|
67
|
-
let maxDuration;
|
|
68
|
-
let memory;
|
|
69
|
-
for (const currentRoute of getRouteIterator(route, routes)) {
|
|
70
|
-
const staticConfig = configs.get(currentRoute);
|
|
71
|
-
if (staticConfig) {
|
|
72
|
-
if (typeof runtime === 'undefined' && staticConfig.runtime) {
|
|
73
|
-
runtime = isEdgeRuntime(staticConfig.runtime) ? 'edge' : 'nodejs';
|
|
74
|
-
}
|
|
75
|
-
if (typeof regions === 'undefined') {
|
|
76
|
-
regions = staticConfig.regions;
|
|
77
|
-
}
|
|
78
|
-
if (typeof maxDuration === 'undefined') {
|
|
79
|
-
maxDuration = staticConfig.maxDuration;
|
|
80
|
-
}
|
|
81
|
-
if (typeof memory === 'undefined') {
|
|
82
|
-
memory = staticConfig.memory;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (Array.isArray(regions)) {
|
|
87
|
-
regions = Array.from(new Set(regions)).sort();
|
|
88
|
-
}
|
|
89
|
-
if (isHydrogen2 || runtime === 'edge') {
|
|
90
|
-
return { runtime: 'edge', regions };
|
|
91
|
-
}
|
|
92
|
-
if (regions && !Array.isArray(regions)) {
|
|
93
|
-
throw new Error(`"regions" for route "${route.id}" must be an array of strings`);
|
|
94
|
-
}
|
|
95
|
-
return { runtime: 'nodejs', regions, maxDuration, memory };
|
|
96
|
-
}
|
|
97
|
-
exports.getResolvedRouteConfig = getResolvedRouteConfig;
|
|
98
|
-
function calculateRouteConfigHash(config) {
|
|
99
|
-
const str = JSON.stringify(config);
|
|
100
|
-
return Buffer.from(str).toString('base64url');
|
|
101
|
-
}
|
|
102
|
-
exports.calculateRouteConfigHash = calculateRouteConfigHash;
|
|
103
|
-
function isLayoutRoute(routeId, routes) {
|
|
104
|
-
return routes.some(r => r.parentId === routeId);
|
|
105
|
-
}
|
|
106
|
-
exports.isLayoutRoute = isLayoutRoute;
|
|
107
|
-
function* getRouteIterator(route, routes) {
|
|
108
|
-
let currentRoute = route;
|
|
109
|
-
do {
|
|
110
|
-
yield currentRoute;
|
|
111
|
-
if (currentRoute.parentId) {
|
|
112
|
-
currentRoute = routes[currentRoute.parentId];
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
} while (currentRoute);
|
|
118
|
-
}
|
|
119
|
-
exports.getRouteIterator = getRouteIterator;
|
|
120
|
-
function getPathFromRoute(route, routes) {
|
|
121
|
-
if (route.id === 'root' ||
|
|
122
|
-
(route.parentId === 'root' && !route.path && route.index)) {
|
|
123
|
-
return { path: 'index', rePath: '/index' };
|
|
124
|
-
}
|
|
125
|
-
const pathParts = [];
|
|
126
|
-
const rePathParts = [];
|
|
127
|
-
for (const currentRoute of getRouteIterator(route, routes)) {
|
|
128
|
-
if (!currentRoute.path)
|
|
129
|
-
continue;
|
|
130
|
-
const currentRouteParts = currentRoute.path.split('/').reverse();
|
|
131
|
-
for (const part of currentRouteParts) {
|
|
132
|
-
if (part.endsWith('?')) {
|
|
133
|
-
if (part.startsWith(':')) {
|
|
134
|
-
// Optional path parameter
|
|
135
|
-
pathParts.push(`(${part.substring(0, part.length - 1)})`);
|
|
136
|
-
rePathParts.push(part);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
// Optional static segment
|
|
140
|
-
const p = `(${part.substring(0, part.length - 1)})`;
|
|
141
|
-
pathParts.push(p);
|
|
142
|
-
rePathParts.push(`${p}?`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
pathParts.push(part);
|
|
147
|
-
rePathParts.push(part);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const path = pathParts.reverse().join('/');
|
|
152
|
-
// Replace "/*" at the end to handle "splat routes"
|
|
153
|
-
let rePath = rePathParts.reverse().join('/');
|
|
154
|
-
rePath =
|
|
155
|
-
rePath === '*' ? SPLAT_PATH : `/${rePath.replace(/\/\*$/, SPLAT_PATH)}`;
|
|
156
|
-
return { path, rePath };
|
|
157
|
-
}
|
|
158
|
-
exports.getPathFromRoute = getPathFromRoute;
|
|
159
|
-
function getRegExpFromPath(rePath) {
|
|
160
|
-
const keys = [];
|
|
161
|
-
const re = (0, path_to_regexp_1.pathToRegexp)(rePath, keys);
|
|
162
|
-
return keys.length > 0 ? re : false;
|
|
163
|
-
}
|
|
164
|
-
exports.getRegExpFromPath = getRegExpFromPath;
|
|
165
|
-
/**
|
|
166
|
-
* Updates the `dest` process.env object to match the `source` one.
|
|
167
|
-
* A function is returned to restore the the `dest` env back to how
|
|
168
|
-
* it was originally.
|
|
169
|
-
*/
|
|
170
|
-
function syncEnv(source, dest) {
|
|
171
|
-
const originalDest = { ...dest };
|
|
172
|
-
Object.assign(dest, source);
|
|
173
|
-
for (const key of Object.keys(dest)) {
|
|
174
|
-
if (!(key in source)) {
|
|
175
|
-
delete dest[key];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return () => syncEnv(originalDest, dest);
|
|
179
|
-
}
|
|
180
|
-
exports.syncEnv = syncEnv;
|
|
181
|
-
async function chdirAndReadConfig(remixRunDevPath, dir, packageJsonPath) {
|
|
182
|
-
const { readConfig } = await (_a = (0, path_1.join)(remixRunDevPath, 'dist/config.js'), Promise.resolve().then(() => __importStar(require(_a))));
|
|
183
|
-
const originalCwd = process.cwd();
|
|
184
|
-
// As of Remix v1.14.0, reading the config may trigger adding
|
|
185
|
-
// "isbot" as a dependency, and `npm`/`pnpm`/`yarn` may be invoked.
|
|
186
|
-
// We want to prevent that behavior, so trick `readConfig()`
|
|
187
|
-
// into thinking that "isbot" is already installed.
|
|
188
|
-
let modifiedPackageJson = false;
|
|
189
|
-
const pkgRaw = await fs_1.promises.readFile(packageJsonPath, 'utf8');
|
|
190
|
-
const pkg = JSON.parse(pkgRaw);
|
|
191
|
-
if (!pkg.dependencies?.['isbot']) {
|
|
192
|
-
pkg.dependencies.isbot = 'latest';
|
|
193
|
-
await fs_1.promises.writeFile(packageJsonPath, JSON.stringify(pkg));
|
|
194
|
-
modifiedPackageJson = true;
|
|
195
|
-
}
|
|
196
|
-
// Suppress any warnings emitted from `readConfig()` to avoid
|
|
197
|
-
// printing them > 1 time. They will already be printed during
|
|
198
|
-
// `remix build` when invoking the Build Command.
|
|
199
|
-
const warn = console.warn;
|
|
200
|
-
console.warn = build_utils_1.debug;
|
|
201
|
-
let remixConfig;
|
|
202
|
-
try {
|
|
203
|
-
process.chdir(dir);
|
|
204
|
-
remixConfig = await readConfig(dir);
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
console.warn = warn;
|
|
208
|
-
process.chdir(originalCwd);
|
|
209
|
-
if (modifiedPackageJson) {
|
|
210
|
-
await fs_1.promises.writeFile(packageJsonPath, pkgRaw);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return remixConfig;
|
|
214
|
-
}
|
|
215
|
-
exports.chdirAndReadConfig = chdirAndReadConfig;
|
|
216
|
-
/**
|
|
217
|
-
* Runs `npm i ${name}` / `pnpm i ${name}` / `yarn add ${name}`.
|
|
218
|
-
*/
|
|
219
|
-
function addDependencies(cliType, names, opts = {}) {
|
|
220
|
-
(0, build_utils_1.debug)('Installing additional dependencies:');
|
|
221
|
-
for (const name of names) {
|
|
222
|
-
(0, build_utils_1.debug)(` - ${name}`);
|
|
223
|
-
}
|
|
224
|
-
const args = [];
|
|
225
|
-
if (cliType === 'npm' || cliType === 'pnpm') {
|
|
226
|
-
args.push('install');
|
|
227
|
-
if (opts.saveDev) {
|
|
228
|
-
args.push('--save-dev');
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
// 'yarn'
|
|
233
|
-
args.push('add');
|
|
234
|
-
if (opts.saveDev) {
|
|
235
|
-
args.push('--dev');
|
|
236
|
-
}
|
|
237
|
-
const yarnVersion = (0, child_process_1.execSync)('yarn -v', { encoding: 'utf8' }).trim();
|
|
238
|
-
const isYarnV1 = semver_1.default.satisfies(yarnVersion, '1');
|
|
239
|
-
if (isYarnV1) {
|
|
240
|
-
// Ignoring workspace check is only needed on Yarn v1
|
|
241
|
-
args.push('--ignore-workspace-root-check');
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
// Don't fail if pnpm is being run at the workspace root
|
|
245
|
-
if (cliType === 'pnpm' && opts.cwd) {
|
|
246
|
-
if ((0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'pnpm-workspace.yaml'))) {
|
|
247
|
-
args.push('--workspace-root');
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return (0, build_utils_1.spawnAsync)(cliType, args.concat(names), opts);
|
|
251
|
-
}
|
|
252
|
-
exports.addDependencies = addDependencies;
|
|
253
|
-
function resolveSemverMinMax(min, max, version) {
|
|
254
|
-
const floored = semver_1.default.intersects(version, `>= ${min}`) ? version : min;
|
|
255
|
-
return semver_1.default.intersects(floored, `<= ${max}`) ? floored : max;
|
|
256
|
-
}
|
|
257
|
-
exports.resolveSemverMinMax = resolveSemverMinMax;
|
|
258
|
-
async function ensureResolvable(start, base, pkgName) {
|
|
259
|
-
try {
|
|
260
|
-
const resolvedPkgPath = exports._require.resolve(`${pkgName}/package.json`, {
|
|
261
|
-
paths: [start],
|
|
262
|
-
});
|
|
263
|
-
const resolvedPath = (0, path_1.dirname)(resolvedPkgPath);
|
|
264
|
-
if (!(0, path_1.relative)(base, resolvedPath).startsWith(`..${path_1.sep}`)) {
|
|
265
|
-
// Resolved path is within the root of the project, so all good
|
|
266
|
-
(0, build_utils_1.debug)(`"${pkgName}" resolved to '${resolvedPath}'`);
|
|
267
|
-
return resolvedPath;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
catch (err) {
|
|
271
|
-
if (err.code !== 'MODULE_NOT_FOUND') {
|
|
272
|
-
throw err;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
// If we got to here then `pkgName` was not resolvable up to the root
|
|
276
|
-
// of the project. Try a couple symlink tricks, otherwise we'll bail.
|
|
277
|
-
// Attempt to find the package in `node_modules/.pnpm` (pnpm)
|
|
278
|
-
const pnpmDir = await (0, build_utils_2.walkParentDirs)({
|
|
279
|
-
base,
|
|
280
|
-
start,
|
|
281
|
-
filename: 'node_modules/.pnpm',
|
|
282
|
-
});
|
|
283
|
-
if (pnpmDir) {
|
|
284
|
-
const prefix = `${pkgName.replace('/', '+')}@`;
|
|
285
|
-
const packages = await fs_1.promises.readdir(pnpmDir);
|
|
286
|
-
const match = packages.find(p => p.startsWith(prefix));
|
|
287
|
-
if (match) {
|
|
288
|
-
const pkgDir = (0, path_1.join)(pnpmDir, match, 'node_modules', pkgName);
|
|
289
|
-
await ensureSymlink(pkgDir, (0, path_1.join)(start, 'node_modules'), pkgName);
|
|
290
|
-
return pkgDir;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
// Attempt to find the package in `node_modules/.store` (npm 9+ linked mode)
|
|
294
|
-
const npmDir = await (0, build_utils_2.walkParentDirs)({
|
|
295
|
-
base,
|
|
296
|
-
start,
|
|
297
|
-
filename: 'node_modules/.store',
|
|
298
|
-
});
|
|
299
|
-
if (npmDir) {
|
|
300
|
-
const prefix = `${(0, path_1.basename)(pkgName)}@`;
|
|
301
|
-
const prefixDir = (0, path_1.join)(npmDir, (0, path_1.dirname)(pkgName));
|
|
302
|
-
const packages = await fs_1.promises.readdir(prefixDir);
|
|
303
|
-
const match = packages.find(p => p.startsWith(prefix));
|
|
304
|
-
if (match) {
|
|
305
|
-
const pkgDir = (0, path_1.join)(prefixDir, match, 'node_modules', pkgName);
|
|
306
|
-
await ensureSymlink(pkgDir, (0, path_1.join)(start, 'node_modules'), pkgName);
|
|
307
|
-
return pkgDir;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
throw new Error(`Failed to resolve "${pkgName}". To fix this error, add "${pkgName}" to "dependencies" in your \`package.json\` file.`);
|
|
311
|
-
}
|
|
312
|
-
exports.ensureResolvable = ensureResolvable;
|
|
313
|
-
async function ensureSymlink(target, nodeModulesDir, pkgName) {
|
|
314
|
-
const symlinkPath = (0, path_1.join)(nodeModulesDir, pkgName);
|
|
315
|
-
const symlinkDir = (0, path_1.dirname)(symlinkPath);
|
|
316
|
-
const relativeTarget = (0, path_1.relative)(symlinkDir, target);
|
|
317
|
-
try {
|
|
318
|
-
const existingTarget = await fs_1.promises.readlink(symlinkPath);
|
|
319
|
-
if (existingTarget === relativeTarget) {
|
|
320
|
-
// Symlink is already the expected value, so do nothing
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
// If a symlink already exists then delete it if the target doesn't match
|
|
325
|
-
await fs_1.promises.unlink(symlinkPath);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
catch (err) {
|
|
329
|
-
// Ignore when path does not exist or is not a symlink
|
|
330
|
-
if (err.code !== 'ENOENT' && err.code !== 'EINVAL') {
|
|
331
|
-
throw err;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
await fs_1.promises.symlink(relativeTarget, symlinkPath);
|
|
335
|
-
(0, build_utils_1.debug)(`Created symlink for "${pkgName}"`);
|
|
336
|
-
}
|
|
337
|
-
function isESM(path) {
|
|
338
|
-
// Figure out if the `remix.config` file is using ESM syntax
|
|
339
|
-
let isESM = false;
|
|
340
|
-
try {
|
|
341
|
-
(0, exports._require)(path);
|
|
342
|
-
}
|
|
343
|
-
catch (err) {
|
|
344
|
-
isESM = err.code === 'ERR_REQUIRE_ESM';
|
|
345
|
-
}
|
|
346
|
-
return isESM;
|
|
347
|
-
}
|
|
348
|
-
exports.isESM = isESM;
|
|
349
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,iDAAyC;AACzC,2BAAgD;AAChD,+BAAuE;AACvE,mDAAmD;AACnD,qDAAwD;AACxD,qDAAqD;AAYxC,QAAA,QAAQ,GAAmB,IAAI,CAAC,SAAS,CAAC,CAAC;AA+BxD,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEjD,SAAgB,SAAS,CAAC,GAAW,EAAE,QAAgB;IACrD,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;QAC3B,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,CAAC,CAAC;QAC1C,IAAI,IAAA,eAAU,EAAC,IAAI,CAAC;YAAE,OAAO,IAAA,eAAQ,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KAClD;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,8BAOC;AAED,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,SAAgB,UAAU,CAAC,GAAW,EAAE,QAAgB;IACtD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC5B,MAAM,IAAI,GAAG,QAAQ,GAAG,GAAG,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7B,IAAI,IAAA,eAAU,EAA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