@chuckcchen/vite-plugin 1.0.3 → 1.0.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/bundler.d.ts +5 -45
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +30 -172
- package/dist/bundler.js.map +1 -1
- package/dist/core.d.ts +0 -8
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +15 -56
- package/dist/core.js.map +1 -1
- package/dist/factory.d.ts +51 -45
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +215 -184
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/route-parser.d.ts +141 -0
- package/dist/route-parser.d.ts.map +1 -0
- package/dist/route-parser.js +293 -0
- package/dist/route-parser.js.map +1 -0
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +64 -125
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +230 -168
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -1,58 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EdgeOne Vite Plugin Adapter - Utility Functions Module
|
|
3
3
|
*
|
|
4
|
-
* This module provides
|
|
4
|
+
* This module provides utility functions for:
|
|
5
5
|
* - Logging
|
|
6
|
-
* - File system operations
|
|
6
|
+
* - File system operations
|
|
7
7
|
* - Path detection
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
8
|
+
* - Config file loading
|
|
9
|
+
* - Server wrapper generation
|
|
10
|
+
* - Meta configuration
|
|
10
11
|
*/
|
|
11
12
|
import fs from "fs/promises";
|
|
12
13
|
import path from "path";
|
|
14
|
+
import { pathToFileURL } from "url";
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Logging
|
|
17
|
+
// ============================================================================
|
|
13
18
|
/**
|
|
14
19
|
* Create logger instance
|
|
15
|
-
*
|
|
16
|
-
* @param verbose - Enable verbose logging mode, default is false
|
|
17
|
-
* @returns Logger object with log, verbose, warn, error methods
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const logger = createLogger(true);
|
|
21
|
-
* logger.verbose("This message only shows in verbose mode");
|
|
22
|
-
* logger.warn("This is a warning message");
|
|
23
20
|
*/
|
|
24
21
|
export function createLogger(verbose = false) {
|
|
25
22
|
return {
|
|
26
|
-
// Normal log, always outputs
|
|
27
23
|
log: (message, ...args) => {
|
|
28
24
|
console.log(`[EdgeOne Adapter] ${message}`, ...args);
|
|
29
25
|
},
|
|
30
|
-
// Verbose log, only outputs in verbose mode
|
|
31
26
|
verbose: (message, ...args) => {
|
|
32
27
|
if (verbose) {
|
|
33
28
|
console.log(`[EdgeOne Adapter] ${message}`, ...args);
|
|
34
29
|
}
|
|
35
30
|
},
|
|
36
|
-
// Warning log with warning icon
|
|
37
31
|
warn: (message, ...args) => {
|
|
38
32
|
console.warn(`[EdgeOne Adapter] ⚠️ ${message}`, ...args);
|
|
39
33
|
},
|
|
40
|
-
// Error log with error icon
|
|
41
34
|
error: (message, ...args) => {
|
|
42
35
|
console.error(`[EdgeOne Adapter] ❌ ${message}`, ...args);
|
|
43
36
|
},
|
|
44
37
|
};
|
|
45
38
|
}
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// File System Operations
|
|
41
|
+
// ============================================================================
|
|
46
42
|
/**
|
|
47
43
|
* Check if specified path exists
|
|
48
|
-
*
|
|
49
|
-
* @param filePath - File or directory path to check
|
|
50
|
-
* @returns True if path exists, false otherwise
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* if (await pathExists('/path/to/file')) {
|
|
54
|
-
* console.log('File exists');
|
|
55
|
-
* }
|
|
56
44
|
*/
|
|
57
45
|
export async function pathExists(filePath) {
|
|
58
46
|
try {
|
|
@@ -63,200 +51,274 @@ export async function pathExists(filePath) {
|
|
|
63
51
|
return false;
|
|
64
52
|
}
|
|
65
53
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Find first existing path from candidate list
|
|
68
|
-
*
|
|
69
|
-
* @param candidates - Candidate paths array, sorted by priority
|
|
70
|
-
* @returns First existing path, or null if none exist
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* const buildDir = await findExistingPath([
|
|
74
|
-
* '/project/dist',
|
|
75
|
-
* '/project/build',
|
|
76
|
-
* '/project/output'
|
|
77
|
-
* ]);
|
|
78
|
-
*/
|
|
79
|
-
export async function findExistingPath(candidates) {
|
|
80
|
-
for (const candidate of candidates) {
|
|
81
|
-
if (await pathExists(candidate)) {
|
|
82
|
-
return candidate;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
54
|
/**
|
|
88
55
|
* Recursively copy directory
|
|
89
|
-
* Copy all contents from source directory to destination directory
|
|
90
|
-
*
|
|
91
|
-
* @param src - Source directory path
|
|
92
|
-
* @param dest - Destination directory path
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* await copyDirectory('dist/client', '.edgeone/assets');
|
|
96
56
|
*/
|
|
97
57
|
export async function copyDirectory(src, dest) {
|
|
98
58
|
await fs.cp(src, dest, { recursive: true });
|
|
99
59
|
}
|
|
100
60
|
/**
|
|
101
|
-
*
|
|
102
|
-
* Used to ensure directory is in a clean empty state
|
|
103
|
-
*
|
|
104
|
-
* @param dir - Directory path to clean
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* await cleanDirectory('.edgeone');
|
|
108
|
-
*/
|
|
109
|
-
export async function cleanDirectory(dir) {
|
|
110
|
-
await fs.rm(dir, { recursive: true, force: true });
|
|
111
|
-
await fs.mkdir(dir, { recursive: true });
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Ensure directory exists
|
|
115
|
-
* Recursively create if directory doesn't exist
|
|
116
|
-
*
|
|
117
|
-
* @param dir - Directory path
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* await ensureDirectory('.edgeone/server-handler');
|
|
61
|
+
* Ensure directory exists (creates recursively if needed)
|
|
121
62
|
*/
|
|
122
63
|
export async function ensureDirectory(dir) {
|
|
123
64
|
await fs.mkdir(dir, { recursive: true });
|
|
124
65
|
}
|
|
125
66
|
/**
|
|
126
67
|
* Read file content as string
|
|
127
|
-
*
|
|
128
|
-
* @param filePath - File path
|
|
129
|
-
* @returns File content string (UTF-8 encoded)
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* const content = await readFile('dist/server/index.js');
|
|
133
68
|
*/
|
|
134
69
|
export async function readFile(filePath) {
|
|
135
70
|
return fs.readFile(filePath, "utf-8");
|
|
136
71
|
}
|
|
137
72
|
/**
|
|
138
|
-
* Write content to file
|
|
139
|
-
* Automatically creates parent directory if it doesn't exist
|
|
140
|
-
*
|
|
141
|
-
* @param filePath - File path
|
|
142
|
-
* @param content - Content to write
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* await writeFile('.edgeone/meta.json', JSON.stringify(config));
|
|
73
|
+
* Write content to file (auto-creates parent directory)
|
|
146
74
|
*/
|
|
147
75
|
export async function writeFile(filePath, content) {
|
|
148
|
-
// Ensure parent directory exists
|
|
149
76
|
await ensureDirectory(path.dirname(filePath));
|
|
150
77
|
await fs.writeFile(filePath, content);
|
|
151
78
|
}
|
|
152
79
|
/**
|
|
153
80
|
* Delete file
|
|
154
|
-
*
|
|
155
|
-
* @param filePath - File path to delete
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* await deleteFile('server-wrapper.temp.js');
|
|
159
81
|
*/
|
|
160
82
|
export async function deleteFile(filePath) {
|
|
161
83
|
await fs.unlink(filePath);
|
|
162
84
|
}
|
|
163
85
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* @param
|
|
167
|
-
* @returns Formatted string, e.g. "1.5 KB", "2.3 MB"
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* formatSize(1536); // "1.5 KB"
|
|
171
|
-
* formatSize(2457600); // "2.34 MB"
|
|
86
|
+
* List files in directory
|
|
87
|
+
* @param dir - Directory path
|
|
88
|
+
* @param logger - Optional logger for verbose error reporting
|
|
172
89
|
*/
|
|
173
|
-
export function
|
|
174
|
-
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
90
|
+
export async function listFiles(dir, logger) {
|
|
91
|
+
try {
|
|
92
|
+
return await fs.readdir(dir);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
logger?.verbose(`Failed to list files in ${dir}: ${error instanceof Error ? error.message : String(error)}`);
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
182
98
|
}
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Path Detection
|
|
101
|
+
// ============================================================================
|
|
183
102
|
/**
|
|
184
|
-
*
|
|
185
|
-
* Used to wait for async operations to complete, like file writes
|
|
186
|
-
*
|
|
187
|
-
* @param condition - Async condition function returning boolean
|
|
188
|
-
* @param options - Configuration options
|
|
189
|
-
* @param options.maxRetries - Maximum retry count, default 15
|
|
190
|
-
* @param options.delay - Delay between retries in milliseconds, default 300ms
|
|
191
|
-
* @returns True if condition met, false if timeout
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* const ready = await waitFor(
|
|
195
|
-
* async () => await pathExists('dist/index.html'),
|
|
196
|
-
* { maxRetries: 10, delay: 500 }
|
|
197
|
-
* );
|
|
103
|
+
* Detect config file from candidate list
|
|
198
104
|
*/
|
|
199
|
-
export async function
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return true;
|
|
105
|
+
export async function detectConfigFile(projectRoot, patterns) {
|
|
106
|
+
for (const pattern of patterns) {
|
|
107
|
+
const fullPath = path.join(projectRoot, pattern);
|
|
108
|
+
if (await pathExists(fullPath)) {
|
|
109
|
+
return fullPath;
|
|
205
110
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Detect build directory from candidate list
|
|
116
|
+
*/
|
|
117
|
+
export async function detectBuildDir(projectRoot, candidates) {
|
|
118
|
+
for (const candidate of candidates) {
|
|
119
|
+
const dirPath = path.join(projectRoot, candidate);
|
|
120
|
+
if (await pathExists(dirPath)) {
|
|
121
|
+
return dirPath;
|
|
209
122
|
}
|
|
210
123
|
}
|
|
211
|
-
return
|
|
124
|
+
return null;
|
|
212
125
|
}
|
|
213
126
|
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* @param dir - Directory path
|
|
217
|
-
* @returns Array of file and directory names, empty array if directory doesn't exist
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* const files = await listFiles('dist/client');
|
|
221
|
-
* // ['index.html', 'assets', 'favicon.ico']
|
|
127
|
+
* Detect server entry file from candidate list
|
|
222
128
|
*/
|
|
223
|
-
export async function
|
|
129
|
+
export async function detectServerEntry(serverDir, candidates = ["index.js", "index.mjs", "entry.js", "main.js"]) {
|
|
130
|
+
for (const candidate of candidates) {
|
|
131
|
+
const entryPath = path.join(serverDir, candidate);
|
|
132
|
+
if (await pathExists(entryPath)) {
|
|
133
|
+
return entryPath;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Dynamically import config file
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* Dynamically import config file
|
|
143
|
+
* @param configPath - Path to config file
|
|
144
|
+
* @param logger - Optional logger for verbose error reporting
|
|
145
|
+
*/
|
|
146
|
+
export async function loadConfigFile(configPath, logger) {
|
|
224
147
|
try {
|
|
225
|
-
|
|
148
|
+
const fileUrl = pathToFileURL(configPath).href;
|
|
149
|
+
const module = await import(`${fileUrl}?t=${Date.now()}`);
|
|
150
|
+
return module.default;
|
|
226
151
|
}
|
|
227
|
-
catch {
|
|
228
|
-
|
|
152
|
+
catch (importError) {
|
|
153
|
+
logger?.verbose(`Dynamic import failed for ${configPath}: ${importError instanceof Error ? importError.message : String(importError)}`);
|
|
154
|
+
// If dynamic import fails (e.g., TypeScript file), try to parse the file content
|
|
155
|
+
try {
|
|
156
|
+
const content = await fs.readFile(configPath, "utf-8");
|
|
157
|
+
return parseConfigFromContent(content);
|
|
158
|
+
}
|
|
159
|
+
catch (parseError) {
|
|
160
|
+
logger?.verbose(`Config parsing failed for ${configPath}: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
229
163
|
}
|
|
230
164
|
}
|
|
231
165
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* @param dir - Directory path
|
|
235
|
-
* @returns Total file count (excluding directories)
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* const count = await countFiles('dist');
|
|
239
|
-
* console.log(`Build artifacts contain ${count} files`);
|
|
166
|
+
* Parse config object from file content (simple extraction for common patterns)
|
|
167
|
+
* This is a fallback when dynamic import fails (e.g., for TypeScript files)
|
|
240
168
|
*/
|
|
241
|
-
|
|
242
|
-
let count = 0;
|
|
169
|
+
function parseConfigFromContent(content) {
|
|
243
170
|
try {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
count += await countFiles(path.join(dir, entry.name));
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
// Increment file count
|
|
253
|
-
count++;
|
|
254
|
-
}
|
|
171
|
+
const config = {};
|
|
172
|
+
// Extract ssr: true/false
|
|
173
|
+
const ssrMatch = content.match(/ssr\s*:\s*(true|false)/);
|
|
174
|
+
if (ssrMatch) {
|
|
175
|
+
config.ssr = ssrMatch[1] === "true";
|
|
255
176
|
}
|
|
177
|
+
// Extract buildDirectory: "..."
|
|
178
|
+
const buildDirMatch = content.match(/buildDirectory\s*:\s*["']([^"']+)["']/);
|
|
179
|
+
if (buildDirMatch) {
|
|
180
|
+
config.buildDirectory = buildDirMatch[1];
|
|
181
|
+
}
|
|
182
|
+
// Extract serverBuildFile: "..."
|
|
183
|
+
const serverBuildFileMatch = content.match(/serverBuildFile\s*:\s*["']([^"']+)["']/);
|
|
184
|
+
if (serverBuildFileMatch) {
|
|
185
|
+
config.serverBuildFile = serverBuildFileMatch[1];
|
|
186
|
+
}
|
|
187
|
+
// Extract serverModuleFormat: "..."
|
|
188
|
+
const serverModuleFormatMatch = content.match(/serverModuleFormat\s*:\s*["']([^"']+)["']/);
|
|
189
|
+
if (serverModuleFormatMatch) {
|
|
190
|
+
config.serverModuleFormat = serverModuleFormatMatch[1];
|
|
191
|
+
}
|
|
192
|
+
return Object.keys(config).length > 0 ? config : null;
|
|
256
193
|
}
|
|
257
194
|
catch {
|
|
258
|
-
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// ============================================================================
|
|
199
|
+
// Route Helpers
|
|
200
|
+
// ============================================================================
|
|
201
|
+
/**
|
|
202
|
+
* Normalize route path
|
|
203
|
+
*/
|
|
204
|
+
export function normalizeRoutePath(routePath) {
|
|
205
|
+
let normalized = routePath.replace(/\/+/g, "/");
|
|
206
|
+
if (!normalized.startsWith("/")) {
|
|
207
|
+
normalized = "/" + normalized;
|
|
208
|
+
}
|
|
209
|
+
if (normalized !== "/" && normalized.endsWith("/")) {
|
|
210
|
+
normalized = normalized.slice(0, -1);
|
|
211
|
+
}
|
|
212
|
+
return normalized;
|
|
213
|
+
}
|
|
214
|
+
// ============================================================================
|
|
215
|
+
// Meta Configuration
|
|
216
|
+
// ============================================================================
|
|
217
|
+
/**
|
|
218
|
+
* Create default meta configuration
|
|
219
|
+
*/
|
|
220
|
+
export function createDefaultMeta(routes, options = {}) {
|
|
221
|
+
const { isSSR = false, has404 = false } = options;
|
|
222
|
+
return {
|
|
223
|
+
conf: {
|
|
224
|
+
headers: [],
|
|
225
|
+
redirects: [],
|
|
226
|
+
rewrites: [],
|
|
227
|
+
caches: [],
|
|
228
|
+
has404,
|
|
229
|
+
ssr404: isSSR && !has404,
|
|
230
|
+
},
|
|
231
|
+
has404,
|
|
232
|
+
frameworkRoutes: routes,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// ============================================================================
|
|
236
|
+
// Server Wrapper Generation
|
|
237
|
+
// ============================================================================
|
|
238
|
+
/** Node.js IncomingMessage to Web Request converter code */
|
|
239
|
+
export const NODE_REQUEST_CONVERTER_CODE = `
|
|
240
|
+
function nodeRequestToWebRequest(nodeReq) {
|
|
241
|
+
const protocol = nodeReq.connection?.encrypted ? 'https' : 'http';
|
|
242
|
+
const host = nodeReq.headers.host || 'localhost';
|
|
243
|
+
const url = \`\${protocol}://\${host}\${nodeReq.url}\`;
|
|
244
|
+
|
|
245
|
+
const headers = new Headers();
|
|
246
|
+
for (const [key, value] of Object.entries(nodeReq.headers)) {
|
|
247
|
+
if (value) {
|
|
248
|
+
if (Array.isArray(value)) {
|
|
249
|
+
value.forEach(v => headers.append(key, v));
|
|
250
|
+
} else {
|
|
251
|
+
headers.set(key, value);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const init = {
|
|
257
|
+
method: nodeReq.method,
|
|
258
|
+
headers: headers,
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
if (nodeReq.method !== 'GET' && nodeReq.method !== 'HEAD') {
|
|
262
|
+
init.body = nodeReq;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return new Request(url, init);
|
|
266
|
+
}
|
|
267
|
+
`.trim();
|
|
268
|
+
/**
|
|
269
|
+
* Generate server wrapper code
|
|
270
|
+
*/
|
|
271
|
+
export async function generateServerWrapperCode(options) {
|
|
272
|
+
const { serverEntryPath, handlerSetup = "", handlerCall, imports = "", needsNodeRequestConversion = true, mode = "inline", additionalExports = [], } = options;
|
|
273
|
+
const parts = [];
|
|
274
|
+
if (mode === "inline") {
|
|
275
|
+
const serverBuildContent = await readFile(serverEntryPath);
|
|
276
|
+
parts.push(`// Server build content`);
|
|
277
|
+
parts.push(serverBuildContent);
|
|
278
|
+
parts.push(``);
|
|
279
|
+
parts.push(`// HTTP server wrapper`);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
parts.push(`// Server Wrapper for EdgeOne`);
|
|
283
|
+
parts.push(`import server from "${serverEntryPath}";`);
|
|
284
|
+
parts.push(``);
|
|
285
|
+
}
|
|
286
|
+
if (imports) {
|
|
287
|
+
parts.push(imports);
|
|
288
|
+
parts.push(``);
|
|
289
|
+
}
|
|
290
|
+
if (handlerSetup) {
|
|
291
|
+
parts.push(handlerSetup);
|
|
292
|
+
parts.push(``);
|
|
293
|
+
}
|
|
294
|
+
if (needsNodeRequestConversion) {
|
|
295
|
+
parts.push(NODE_REQUEST_CONVERTER_CODE);
|
|
296
|
+
parts.push(``);
|
|
297
|
+
}
|
|
298
|
+
parts.push(`
|
|
299
|
+
async function nodeRequestHandler(nodeReq, ...args) {
|
|
300
|
+
const webRequest = nodeRequestToWebRequest(nodeReq);
|
|
301
|
+
return ${handlerCall};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export default nodeRequestHandler;`.trim());
|
|
305
|
+
if (mode === "import" && additionalExports.length > 0) {
|
|
306
|
+
parts.push(`\nexport { ${additionalExports.join(", ")} };`);
|
|
307
|
+
}
|
|
308
|
+
return parts.join("\n");
|
|
309
|
+
}
|
|
310
|
+
// ============================================================================
|
|
311
|
+
// Logging Helpers
|
|
312
|
+
// ============================================================================
|
|
313
|
+
/**
|
|
314
|
+
* Log build artifacts info
|
|
315
|
+
*/
|
|
316
|
+
export function logBuildArtifacts(logger, adapterName, artifacts) {
|
|
317
|
+
logger.verbose(`${adapterName} build artifacts:`);
|
|
318
|
+
logger.verbose(` Client: ${artifacts.clientDir || "not found"}`);
|
|
319
|
+
logger.verbose(` Server: ${artifacts.serverDir || "not found"}`);
|
|
320
|
+
if (artifacts.serverEntry) {
|
|
321
|
+
logger.verbose(` Server entry: ${artifacts.serverEntry}`);
|
|
259
322
|
}
|
|
260
|
-
return count;
|
|
261
323
|
}
|
|
262
324
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,UAAmB,KAAK;IACnD,OAAO;QACL,GAAG,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC/C,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QACD,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC5C,OAAO,CAAC,IAAI,CAAC,yBAAyB,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,KAAK,EAAE,CAA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