@module-federation/treeshake-server 0.0.1-alpha.0

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.
Files changed (64) hide show
  1. package/README.md +71 -0
  2. package/bin/treeshake-server.js +35 -0
  3. package/dist/adapters/createAdapterDeps.d.ts +10 -0
  4. package/dist/adapters/local/adapter.d.ts +10 -0
  5. package/dist/adapters/local/index.d.ts +3 -0
  6. package/dist/adapters/local/localObjectStore.d.ts +13 -0
  7. package/dist/adapters/registry.d.ts +7 -0
  8. package/dist/adapters/types.d.ts +74 -0
  9. package/dist/app.d.ts +18 -0
  10. package/dist/cli/ossEnv.d.ts +18 -0
  11. package/dist/domain/build/constant.d.ts +1 -0
  12. package/dist/domain/build/normalize-config.d.ts +22 -0
  13. package/dist/domain/build/retrieve-global-name.d.ts +1 -0
  14. package/dist/domain/build/schema.d.ts +31 -0
  15. package/dist/domain/upload/constant.d.ts +2 -0
  16. package/dist/domain/upload/retrieve-cdn-path.d.ts +4 -0
  17. package/dist/frontend/adapter/index.d.ts +13 -0
  18. package/dist/frontend/adapter/index.js +128 -0
  19. package/dist/frontend/adapter/index.mjs +83 -0
  20. package/dist/frontend/favicon.ico +0 -0
  21. package/dist/frontend/index.html +1 -0
  22. package/dist/frontend/static/css/index.16175e0f.css +1 -0
  23. package/dist/frontend/static/js/296.084d1b43.js +2 -0
  24. package/dist/frontend/static/js/296.084d1b43.js.LICENSE.txt +16 -0
  25. package/dist/frontend/static/js/async/873.21368adc.js +2 -0
  26. package/dist/frontend/static/js/async/951.ec9191e2.js +12 -0
  27. package/dist/frontend/static/js/async/951.ec9191e2.js.LICENSE.txt +6 -0
  28. package/dist/frontend/static/js/async/987.86ff6794.js +2 -0
  29. package/dist/frontend/static/js/async/987.86ff6794.js.LICENSE.txt +6 -0
  30. package/dist/frontend/static/js/index.5488f626.js +88 -0
  31. package/dist/frontend/static/js/lib-react.c59642e3.js +2 -0
  32. package/dist/frontend/static/js/lib-react.c59642e3.js.LICENSE.txt +39 -0
  33. package/dist/frontend/static/js/lib-router.75e1e689.js +4 -0
  34. package/dist/frontend/static/js/lib-router.75e1e689.js.LICENSE.txt +10 -0
  35. package/dist/http/env.d.ts +10 -0
  36. package/dist/http/middlewares/di.middleware.d.ts +4 -0
  37. package/dist/http/middlewares/logger.middleware.d.ts +3 -0
  38. package/dist/http/routes/build.d.ts +3 -0
  39. package/dist/http/routes/index.d.ts +2 -0
  40. package/dist/http/routes/maintenance.d.ts +3 -0
  41. package/dist/http/routes/static.d.ts +5 -0
  42. package/dist/index.d.ts +10 -0
  43. package/dist/index.js +1028 -0
  44. package/dist/index.mjs +957 -0
  45. package/dist/infra/logger.d.ts +6 -0
  46. package/dist/nodeServer.d.ts +7 -0
  47. package/dist/ports/objectStore.d.ts +1 -0
  48. package/dist/ports/projectPublisher.d.ts +1 -0
  49. package/dist/server.d.ts +2 -0
  50. package/dist/server.js +1160 -0
  51. package/dist/server.mjs +1126 -0
  52. package/dist/services/buildService.d.ts +8 -0
  53. package/dist/services/cacheService.d.ts +15 -0
  54. package/dist/services/pnpmMaintenance.d.ts +4 -0
  55. package/dist/services/uploadService.d.ts +36 -0
  56. package/dist/template/re-shake-share/Collect.js +115 -0
  57. package/dist/template/re-shake-share/EmitManifest.js +49 -0
  58. package/dist/template/re-shake-share/index.ts +1 -0
  59. package/dist/template/re-shake-share/package.json +23 -0
  60. package/dist/template/re-shake-share/rspack.config.ts +33 -0
  61. package/dist/utils/runCommand.d.ts +20 -0
  62. package/dist/utils/runtimeEnv.d.ts +3 -0
  63. package/dist/utils/uploadSdk.d.ts +10 -0
  64. package/package.json +68 -0
package/dist/index.js ADDED
@@ -0,0 +1,1028 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ createApp: ()=>createApp,
37
+ LocalObjectStore: ()=>LocalObjectStore,
38
+ createLogger: ()=>createLogger,
39
+ createOssAdapterRegistry: ()=>createOssAdapterRegistry,
40
+ LocalAdapter: ()=>LocalAdapter,
41
+ createAdapterDeps: ()=>createAdapterDeps,
42
+ createAdapterRegistry: ()=>createAdapterRegistry,
43
+ createServer: ()=>createServer
44
+ });
45
+ const external_hono_namespaceObject = require("hono");
46
+ const cors_namespaceObject = require("hono/cors");
47
+ function createDiMiddleware(deps) {
48
+ return async (c, next)=>{
49
+ c.set('objectStore', deps.objectStore);
50
+ if (deps.projectPublisher) c.set('projectPublisher', deps.projectPublisher);
51
+ await next();
52
+ };
53
+ }
54
+ const external_pino_namespaceObject = require("pino");
55
+ var external_pino_default = /*#__PURE__*/ __webpack_require__.n(external_pino_namespaceObject);
56
+ const createLogger = (opts)=>external_pino_default()({
57
+ level: (null == opts ? void 0 : opts.level) ?? 'info',
58
+ formatters: {
59
+ level (label) {
60
+ return {
61
+ level: label
62
+ };
63
+ }
64
+ }
65
+ });
66
+ let logger_logger = createLogger();
67
+ const setLogger = (next)=>{
68
+ logger_logger = next;
69
+ };
70
+ const loggerMiddleware = async (c, next)=>{
71
+ const category = c.req.path.split('/')[1] || 'root';
72
+ const child = logger_logger.child({
73
+ category,
74
+ path: c.req.path,
75
+ method: c.req.method
76
+ });
77
+ c.set('logger', child);
78
+ await next();
79
+ };
80
+ const external_node_os_namespaceObject = require("node:os");
81
+ var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
82
+ const zod_validator_namespaceObject = require("@hono/zod-validator");
83
+ const external_nanoid_namespaceObject = require("nanoid");
84
+ const external_p_limit_namespaceObject = require("p-limit");
85
+ var external_p_limit_default = /*#__PURE__*/ __webpack_require__.n(external_p_limit_namespaceObject);
86
+ const parseNormalizedKey = (key)=>{
87
+ const res = key.split('@');
88
+ return {
89
+ name: res.slice(0, -1).join('@'),
90
+ version: res[res.length - 1]
91
+ };
92
+ };
93
+ const normalizedKey = (name, v)=>`${name}@${v}`;
94
+ function normalizeConfig(config) {
95
+ const { shared, plugins, target, libraryType, hostName, uploadOptions } = config;
96
+ const commonNormalizedConfig = {
97
+ plugins: (null == plugins ? void 0 : plugins.sort(([a], [b])=>a.localeCompare(b))) ?? [],
98
+ target: Array.isArray(target) ? [
99
+ ...target
100
+ ].sort() : [
101
+ target
102
+ ],
103
+ uploadOptions,
104
+ libraryType,
105
+ hostName
106
+ };
107
+ const normalizedConfig = {};
108
+ shared.forEach(([sharedName, version, usedExports], index)=>{
109
+ const key = normalizedKey(sharedName, version);
110
+ normalizedConfig[key] = {
111
+ ...commonNormalizedConfig,
112
+ shared: shared.slice(0, index).concat(shared.slice(index + 1)).sort(([s, v, u], [b, v2, u2])=>`${s}${v}${u.sort().join('')}`.localeCompare(`${b}${v2}${u2.sort().join('')}`)),
113
+ usedExports
114
+ };
115
+ });
116
+ return normalizedConfig;
117
+ }
118
+ function extractBuildConfig(config, type) {
119
+ const { shared, plugins, target, libraryType, usedExports, hostName } = config;
120
+ return {
121
+ shared,
122
+ plugins,
123
+ target,
124
+ libraryType,
125
+ usedExports,
126
+ type,
127
+ hostName
128
+ };
129
+ }
130
+ const external_zod_namespaceObject = require("zod");
131
+ const UploadOptionsSchema = external_zod_namespaceObject.z.object({
132
+ scmName: external_zod_namespaceObject.z.string(),
133
+ bucketName: external_zod_namespaceObject.z.string(),
134
+ publicFilePath: external_zod_namespaceObject.z.string(),
135
+ publicPath: external_zod_namespaceObject.z.string(),
136
+ cdnRegion: external_zod_namespaceObject.z.string()
137
+ });
138
+ const BasicSchema = external_zod_namespaceObject.z.object({
139
+ shared: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.tuple([
140
+ external_zod_namespaceObject.z.string(),
141
+ external_zod_namespaceObject.z.string(),
142
+ external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())
143
+ ])).describe('List of plugins: [name, version, usedExports]'),
144
+ plugins: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.tuple([
145
+ external_zod_namespaceObject.z.string(),
146
+ external_zod_namespaceObject.z.string().optional()
147
+ ])).describe('Specify extra build plugin names, support specify version in second item').optional(),
148
+ target: external_zod_namespaceObject.z.union([
149
+ external_zod_namespaceObject.z.string(),
150
+ external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())
151
+ ]).describe('Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code, the same with rspack#target'),
152
+ libraryType: external_zod_namespaceObject.z.string(),
153
+ hostName: external_zod_namespaceObject.z.string().describe('The name of the host app / mf')
154
+ });
155
+ const ConfigSchema = BasicSchema.extend({
156
+ uploadOptions: UploadOptionsSchema.optional()
157
+ });
158
+ const CheckTreeShakingSchema = ConfigSchema.extend({
159
+ uploadOptions: UploadOptionsSchema.optional()
160
+ });
161
+ const external_node_crypto_namespaceObject = require("node:crypto");
162
+ const promises_namespaceObject = require("node:fs/promises");
163
+ var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
164
+ const external_node_path_namespaceObject = require("node:path");
165
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
166
+ const STATS_NAME = 'mf-stats.json';
167
+ const external_node_child_process_namespaceObject = require("node:child_process");
168
+ let runtimeEnv = {};
169
+ const setRuntimeEnv = (env)=>{
170
+ runtimeEnv = env;
171
+ };
172
+ const getRuntimeEnv = ()=>runtimeEnv;
173
+ function _define_property(obj, key, value) {
174
+ if (key in obj) Object.defineProperty(obj, key, {
175
+ value: value,
176
+ enumerable: true,
177
+ configurable: true,
178
+ writable: true
179
+ });
180
+ else obj[key] = value;
181
+ return obj;
182
+ }
183
+ class CommandExecutionError extends Error {
184
+ constructor(command, exitCode, stdout, stderr){
185
+ super(`Command "${command}" exited with code ${exitCode}`), _define_property(this, "command", void 0), _define_property(this, "exitCode", void 0), _define_property(this, "stdout", void 0), _define_property(this, "stderr", void 0);
186
+ this.name = 'CommandExecutionError';
187
+ this.command = command;
188
+ this.exitCode = exitCode;
189
+ this.stdout = stdout;
190
+ this.stderr = stderr;
191
+ }
192
+ }
193
+ const runCommand = (command, options = {})=>new Promise((resolve, reject)=>{
194
+ const stdoutChunks = [];
195
+ const stderrChunks = [];
196
+ const child = (0, external_node_child_process_namespaceObject.spawn)(command, {
197
+ cwd: options.cwd,
198
+ env: {
199
+ ...getRuntimeEnv(),
200
+ ...options.env
201
+ },
202
+ shell: true,
203
+ stdio: [
204
+ 'ignore',
205
+ 'pipe',
206
+ 'pipe'
207
+ ]
208
+ });
209
+ child.stdout.on('data', (chunk)=>{
210
+ stdoutChunks.push(chunk.toString());
211
+ });
212
+ child.stderr.on('data', (chunk)=>{
213
+ stderrChunks.push(chunk.toString());
214
+ });
215
+ child.on('error', (error)=>{
216
+ reject(error);
217
+ });
218
+ child.on('close', (exitCode)=>{
219
+ const stdout = stdoutChunks.join('');
220
+ const stderr = stderrChunks.join('');
221
+ if (0 === exitCode) return void resolve({
222
+ stdout,
223
+ stderr,
224
+ exitCode
225
+ });
226
+ reject(new CommandExecutionError(command, exitCode ?? -1, stdout, stderr));
227
+ });
228
+ });
229
+ let installs = 0;
230
+ let pruneScheduled = false;
231
+ let pruning = false;
232
+ const DEFAULT_INTERVAL = 3600000;
233
+ const markInstallStart = ()=>{
234
+ installs++;
235
+ };
236
+ const markInstallEnd = ()=>{
237
+ installs = Math.max(0, installs - 1);
238
+ schedulePruneSoon();
239
+ };
240
+ const schedulePruneSoon = (delay = 30000)=>{
241
+ if (pruneScheduled) return;
242
+ pruneScheduled = true;
243
+ setTimeout(()=>{
244
+ pruneScheduled = false;
245
+ maybePrune();
246
+ }, delay);
247
+ };
248
+ const maybePrune = async ()=>{
249
+ if (pruning || installs > 0) return void schedulePruneSoon(60000);
250
+ pruning = true;
251
+ try {
252
+ await runCommand('pnpm store prune');
253
+ } catch {} finally{
254
+ pruning = false;
255
+ }
256
+ };
257
+ const startPeriodicPrune = (intervalMs = DEFAULT_INTERVAL)=>{
258
+ if (intervalMs <= 0) return;
259
+ setInterval(()=>{
260
+ maybePrune();
261
+ }, intervalMs);
262
+ };
263
+ const createUniqueTempDirByKey = async (key)=>{
264
+ const base = external_node_path_default().join(external_node_os_default().tmpdir(), `re-shake-share-${key}`);
265
+ let candidate = base;
266
+ for(;;)try {
267
+ await promises_default().mkdir(candidate, {
268
+ recursive: false
269
+ });
270
+ return candidate;
271
+ } catch {
272
+ const rand = Math.floor(1e9 * Math.random());
273
+ candidate = `${base}-${rand}`;
274
+ }
275
+ };
276
+ const prepareProject = async (config, excludeShared)=>{
277
+ const key = (0, external_node_crypto_namespaceObject.createHash)('sha256').update(JSON.stringify(config)).digest('hex');
278
+ const dir = await createUniqueTempDirByKey(key);
279
+ const templateDir = external_node_path_default().join(__dirname, '.', 'template', 're-shake-share');
280
+ await promises_default().cp(templateDir, dir, {
281
+ recursive: true
282
+ });
283
+ const pkgPath = external_node_path_default().join(dir, 'package.json');
284
+ const indexPath = external_node_path_default().join(dir, 'index.ts');
285
+ const rspackConfigPath = external_node_path_default().join(dir, 'rspack.config.ts');
286
+ const [pkgContent, indexContent, rspackConfigContent] = await Promise.all([
287
+ promises_default().readFile(pkgPath, 'utf-8'),
288
+ promises_default().readFile(indexPath, 'utf-8'),
289
+ promises_default().readFile(rspackConfigPath, 'utf-8')
290
+ ]);
291
+ const pkg = JSON.parse(pkgContent);
292
+ const deps = {
293
+ ...pkg.dependencies || {}
294
+ };
295
+ const shared = {};
296
+ const mfConfig = {
297
+ name: 're_shake',
298
+ library: {
299
+ type: 'global'
300
+ },
301
+ manifest: true,
302
+ shared
303
+ };
304
+ let pluginImportStr = '';
305
+ let pluginOptionStr = '[\n';
306
+ let sharedImport = '';
307
+ Object.entries(config).forEach(([key, { plugins = [], libraryType, usedExports, hostName }], index)=>{
308
+ const { name, version } = parseNormalizedKey(key);
309
+ deps[name] = version;
310
+ if (!index) {
311
+ plugins.forEach(([pluginName, pluginVersion], pIndex)=>{
312
+ deps[pluginName] = pluginVersion ?? 'latest';
313
+ const pluginImportName = `plugin_${pIndex}`;
314
+ pluginImportStr += `import ${pluginImportName} from '${pluginName}';\n`;
315
+ pluginOptionStr += `new ${pluginImportName}(),`;
316
+ });
317
+ mfConfig.library.type = libraryType;
318
+ mfConfig.name = hostName;
319
+ }
320
+ shared[name] = {
321
+ requiredVersion: version,
322
+ version,
323
+ treeShaking: excludeShared.some(([n, v])=>n === name && v === version) ? void 0 : {
324
+ usedExports,
325
+ mode: 'server-calc'
326
+ }
327
+ };
328
+ sharedImport += `import shared_${index} from '${name}';\n`;
329
+ });
330
+ pluginOptionStr += '\n]';
331
+ pkg.dependencies = deps;
332
+ const newPkgContent = JSON.stringify(pkg, null, 2);
333
+ const sharedImportPlaceholder = "${SHARED_IMPORT}";
334
+ const newIndexContent = indexContent.replace(sharedImportPlaceholder, sharedImport);
335
+ const pluginsPlaceholder = "${ PLUGINS }";
336
+ const mfConfigPlaceholder = "${ MF_CONFIG }";
337
+ let cfg = rspackConfigContent;
338
+ cfg += pluginImportStr;
339
+ cfg = cfg.replace(pluginsPlaceholder, pluginOptionStr);
340
+ cfg = cfg.replace(mfConfigPlaceholder, JSON.stringify(mfConfig, null, 2));
341
+ await Promise.all([
342
+ promises_default().writeFile(pkgPath, newPkgContent),
343
+ promises_default().writeFile(indexPath, newIndexContent),
344
+ promises_default().writeFile(rspackConfigPath, cfg)
345
+ ]);
346
+ return dir;
347
+ };
348
+ const installDependencies = async (cwd)=>{
349
+ markInstallStart();
350
+ try {
351
+ await runCommand("pnpm i --ignore-scripts --no-frozen-lockfile --prefer-offline --reporter=silent --shamefully-hoist", {
352
+ cwd,
353
+ env: {
354
+ npm_config_registry: 'https://registry.npmjs.org/'
355
+ }
356
+ });
357
+ } finally{
358
+ markInstallEnd();
359
+ }
360
+ };
361
+ const buildProject = async (cwd, type)=>{
362
+ const scripts = [];
363
+ if ('re-shake' === type) scripts.push('pnpm build');
364
+ else scripts.push('pnpm build:full');
365
+ await Promise.all(scripts.map((script)=>runCommand(script, {
366
+ cwd
367
+ })));
368
+ };
369
+ const retrieveSharedFilepaths = async (projectDir, type)=>{
370
+ const sharedFilepaths = [];
371
+ const collectSharedFilepaths = async (t)=>{
372
+ const dir = 'full' === t ? 'full-shared' : 'dist';
373
+ const distDir = external_node_path_default().join(projectDir, dir);
374
+ const statsContent = await promises_default().readFile(external_node_path_default().join(distDir, STATS_NAME), 'utf-8');
375
+ const stats = JSON.parse(statsContent);
376
+ stats.shared.forEach((s)=>{
377
+ const { name, version, fallback, fallbackName } = s;
378
+ if (fallback && fallbackName) {
379
+ var _s_usedExports;
380
+ const filepath = external_node_path_default().join(distDir, fallback);
381
+ sharedFilepaths.push({
382
+ name,
383
+ version,
384
+ filepath,
385
+ globalName: fallbackName,
386
+ type: t,
387
+ modules: s.usedExports,
388
+ canTreeShaking: s.canTreeShaking ?? (null == (_s_usedExports = s.usedExports) ? void 0 : _s_usedExports.length) !== 0
389
+ });
390
+ }
391
+ });
392
+ };
393
+ await collectSharedFilepaths(type);
394
+ return sharedFilepaths;
395
+ };
396
+ const runBuild = async (normalizedConfig, excludeShared, type)=>{
397
+ const tStart = Date.now();
398
+ const tmpDir = await prepareProject(normalizedConfig, excludeShared);
399
+ const tPrepare = Date.now();
400
+ logger_logger.info(`prepareProject took ${tPrepare - tStart}ms`);
401
+ await installDependencies(tmpDir);
402
+ const tInstall = Date.now();
403
+ logger_logger.info(`installDependencies took ${tInstall - tPrepare}ms`);
404
+ await buildProject(tmpDir, type);
405
+ const tBuild = Date.now();
406
+ logger_logger.info(`buildProject took ${tBuild - tInstall}ms`);
407
+ const sharedFilePaths = await retrieveSharedFilepaths(tmpDir, type);
408
+ const tRetrieve = Date.now();
409
+ logger_logger.info(`retrieveSharedFilepaths took ${tRetrieve - tBuild}ms`);
410
+ return {
411
+ sharedFilePaths,
412
+ dir: tmpDir
413
+ };
414
+ };
415
+ async function cleanUp(tmpDir) {
416
+ if (!tmpDir) return;
417
+ await promises_default().rm(tmpDir, {
418
+ recursive: true,
419
+ force: true
420
+ });
421
+ }
422
+ const external_json_stable_stringify_namespaceObject = require("json-stable-stringify");
423
+ var external_json_stable_stringify_default = /*#__PURE__*/ __webpack_require__.n(external_json_stable_stringify_namespaceObject);
424
+ const encodeName = function(name, prefix = '', withExt = false) {
425
+ const ext = withExt ? '.js' : '';
426
+ return `${prefix}${name.replace(/@/g, 'scope_').replace(/-/g, '_').replace(/\//g, '__').replace(/\./g, '')}${ext}`;
427
+ };
428
+ function retrieveGlobalName(mfName, sharedName, version) {
429
+ return encodeName(`${mfName}_${sharedName}_${version}`);
430
+ }
431
+ const SERVER_VERSION = 'v0-011501';
432
+ const UPLOADED_DIR = '_shared-tree-shaking';
433
+ function createCacheHash(config, type) {
434
+ const relevant = extractBuildConfig({
435
+ ...config,
436
+ usedExports: 'full' === type ? [] : config.usedExports
437
+ }, type);
438
+ const json = external_json_stable_stringify_default()(relevant);
439
+ if (!json) throw new Error('Can not stringify build config!');
440
+ return (0, external_node_crypto_namespaceObject.createHash)('sha256').update(json).digest('hex');
441
+ }
442
+ function retrieveCDNPath({ config, sharedKey, type }) {
443
+ const configHash = createCacheHash(config, type);
444
+ return `tree-shaking-shared/${SERVER_VERSION}/${sharedKey}/${configHash}.js`;
445
+ }
446
+ async function cacheService_hitCache(sharedKey, config, type, store) {
447
+ const cdnPath = retrieveCDNPath({
448
+ config,
449
+ sharedKey,
450
+ type
451
+ });
452
+ const exists = await store.exists(cdnPath);
453
+ return exists ? store.publicUrl(cdnPath) : null;
454
+ }
455
+ const retrieveCacheItems = async (normalizedConfig, type, store)=>{
456
+ const cacheItems = [];
457
+ const restConfig = {};
458
+ const excludeShared = [];
459
+ for (const [sharedKey, config] of Object.entries(normalizedConfig)){
460
+ let cache = false;
461
+ const { name, version } = parseNormalizedKey(sharedKey);
462
+ const cdnUrl = await cacheService_hitCache(sharedKey, config, type, store);
463
+ if (cdnUrl) {
464
+ cache = true;
465
+ cacheItems.push({
466
+ type,
467
+ name,
468
+ version,
469
+ cdnUrl,
470
+ globalName: retrieveGlobalName(config.hostName, name, version)
471
+ });
472
+ }
473
+ if (cache) excludeShared.push([
474
+ name,
475
+ version
476
+ ]);
477
+ else if (config.usedExports.length || 're-shake' !== type) restConfig[sharedKey] = config;
478
+ else excludeShared.push([
479
+ name,
480
+ version
481
+ ]);
482
+ }
483
+ return {
484
+ cacheItems,
485
+ excludeShared,
486
+ restConfig
487
+ };
488
+ };
489
+ async function uploadToCacheStore(sharedFilePaths, normalizedConfig, store) {
490
+ const results = [];
491
+ for (const file of sharedFilePaths){
492
+ const { name, version, filepath, globalName, type, modules, canTreeShaking } = file;
493
+ try {
494
+ const sharedKey = normalizedKey(name, version);
495
+ logger_logger.info(`Uploading ${sharedKey} to CDN`);
496
+ const config = normalizedConfig[sharedKey];
497
+ const cdnPath = retrieveCDNPath({
498
+ config,
499
+ sharedKey,
500
+ type
501
+ });
502
+ const t0 = Date.now();
503
+ await store.uploadFile(filepath, cdnPath);
504
+ const tUpload = Date.now() - t0;
505
+ const cdnUrl = store.publicUrl(cdnPath);
506
+ const res = {
507
+ name: name,
508
+ version: version,
509
+ globalName: globalName,
510
+ cdnUrl,
511
+ type,
512
+ modules,
513
+ canTreeShaking
514
+ };
515
+ try {
516
+ const jsonFilePath = filepath.replace(/\.js$/, '.json');
517
+ const jsonFile = JSON.stringify(res);
518
+ const jsonCdnUrl = cdnPath.replace(/\.js$/, '.json');
519
+ await promises_default().writeFile(jsonFilePath, jsonFile);
520
+ await store.uploadFile(jsonFilePath, jsonCdnUrl);
521
+ } catch (error) {
522
+ logger_logger.error(`Failed to upload ${name}@${version} json file: ${error}`);
523
+ }
524
+ results.push(res);
525
+ logger_logger.info(`Successfully uploaded ${name}@${version} to ${cdnUrl} in ${tUpload}ms`);
526
+ } catch (error) {
527
+ logger_logger.error(`Failed to upload ${name}@${version}: ${error}`);
528
+ throw error;
529
+ }
530
+ }
531
+ return results;
532
+ }
533
+ const downloadToFile = async (url, destPath)=>{
534
+ const res = await fetch(url);
535
+ if (!res.ok) throw new Error(`Download failed: ${res.status} ${res.statusText} - ${url}`);
536
+ const buf = Buffer.from(await res.arrayBuffer());
537
+ await promises_default().mkdir(external_node_path_default().dirname(destPath), {
538
+ recursive: true
539
+ });
540
+ await promises_default().writeFile(destPath, buf);
541
+ return destPath;
542
+ };
543
+ async function uploadProject(uploadResults, sharedFilePaths, normalizedConfig, publisher, store) {
544
+ const tmpDir = await createUniqueTempDirByKey(`upload-project${Date.now().toString()}`);
545
+ const uploaded = [];
546
+ try {
547
+ for (const item of uploadResults)try {
548
+ const sharedKey = normalizedKey(item.name, item.version);
549
+ const config = normalizedConfig[sharedKey];
550
+ if (!config) {
551
+ logger_logger.error(`No config found for ${item.name}`);
552
+ continue;
553
+ }
554
+ const { uploadOptions } = config;
555
+ if (!uploadOptions) throw new Error(`No uploadOptions found for ${item.name}`);
556
+ const filename = external_node_path_default().basename(new URL(item.cdnUrl, 'http://dummy.com').pathname);
557
+ const localPath = external_node_path_default().join(tmpDir, filename);
558
+ const hash = createCacheHash({
559
+ ...config,
560
+ plugins: config.plugins || []
561
+ }, item.type);
562
+ const cdnUrl = publisher.publicUrl({
563
+ sharedName: item.name,
564
+ hash,
565
+ fileName: filename,
566
+ options: uploadOptions
567
+ });
568
+ const hitCache = await publisher.exists(cdnUrl);
569
+ if (hitCache) {
570
+ logger_logger.info(`Hit cache for ${item.name}@${item.version} -> ${cdnUrl}`);
571
+ uploaded.push({
572
+ ...item,
573
+ cdnUrl
574
+ });
575
+ continue;
576
+ }
577
+ logger_logger.info(`Downloading ${item.name}@${item.version} -> ${localPath}`);
578
+ const t0 = Date.now();
579
+ const cdnPath = retrieveCDNPath({
580
+ config,
581
+ sharedKey,
582
+ type: item.type
583
+ });
584
+ await store.downloadFile(cdnPath, localPath);
585
+ const tDownload = Date.now() - t0;
586
+ logger_logger.info(`Downloaded ${item.name}@${item.version} in ${tDownload}ms`);
587
+ const newCdnUrl = await publisher.publishFile({
588
+ localPath,
589
+ sharedName: item.name,
590
+ hash,
591
+ options: uploadOptions
592
+ });
593
+ uploaded.push({
594
+ ...item,
595
+ cdnUrl: newCdnUrl
596
+ });
597
+ } catch (error) {
598
+ logger_logger.error(`Failed to upload ${item.name}@${item.version}: ${error}`);
599
+ }
600
+ for (const s of sharedFilePaths)try {
601
+ const config = normalizedConfig[normalizedKey(s.name, s.version)];
602
+ if (!config) {
603
+ logger_logger.error(`No config found for ${s.name}`);
604
+ continue;
605
+ }
606
+ const { uploadOptions } = config;
607
+ if (!uploadOptions) throw new Error(`No uploadOptions found for ${s.name}`);
608
+ const hash = createCacheHash({
609
+ ...config,
610
+ plugins: config.plugins || []
611
+ }, s.type);
612
+ const cdnUrl = await publisher.publishFile({
613
+ localPath: s.filepath,
614
+ sharedName: s.name,
615
+ hash,
616
+ options: uploadOptions
617
+ });
618
+ uploaded.push({
619
+ name: s.name,
620
+ version: s.version,
621
+ globalName: s.globalName,
622
+ cdnUrl,
623
+ type: s.type
624
+ });
625
+ } catch (error) {
626
+ logger_logger.error(`Failed to upload ${s.name}@${s.version}: ${error}`);
627
+ }
628
+ return uploaded;
629
+ } finally{
630
+ await promises_default().rm(tmpDir, {
631
+ recursive: true,
632
+ force: true
633
+ });
634
+ }
635
+ }
636
+ async function upload(sharedFilePaths, uploadResults, normalizedConfig, uploadOptions, store, publisher) {
637
+ const cacheUploaded = await uploadToCacheStore(sharedFilePaths, normalizedConfig, store);
638
+ if (!uploadOptions) {
639
+ const hydrated = await Promise.all(uploadResults.map(async (item)=>{
640
+ if ('full' !== item.type) return item;
641
+ const tmpDir = await createUniqueTempDirByKey(`download-full-json${Date.now().toString()}`);
642
+ const jsonPath = external_node_path_default().join(tmpDir, `${item.name}-${item.version}.json`);
643
+ try {
644
+ const tJson0 = Date.now();
645
+ const sharedKey = normalizedKey(item.name, item.version);
646
+ const config = normalizedConfig[sharedKey];
647
+ if (config) {
648
+ const cdnPath = retrieveCDNPath({
649
+ config,
650
+ sharedKey,
651
+ type: item.type
652
+ });
653
+ const jsonCdnPath = cdnPath.replace(/\.js$/, '.json');
654
+ await store.downloadFile(jsonCdnPath, jsonPath);
655
+ } else await downloadToFile(item.cdnUrl.replace('.js', '.json'), jsonPath);
656
+ const tJson = Date.now() - tJson0;
657
+ logger_logger.info(`Downloaded ${item.name}@${item.version} json in ${tJson}ms`);
658
+ const jsonContent = JSON.parse(await promises_default().readFile(jsonPath, 'utf8'));
659
+ return {
660
+ ...item,
661
+ canTreeShaking: jsonContent.canTreeShaking,
662
+ modules: jsonContent.modules
663
+ };
664
+ } catch (jsonError) {
665
+ logger_logger.error(`Failed to download ${item.name}@${item.version} json: ${jsonError}`);
666
+ return {
667
+ ...item,
668
+ canTreeShaking: item.canTreeShaking ?? true
669
+ };
670
+ } finally{
671
+ await promises_default().rm(tmpDir, {
672
+ recursive: true,
673
+ force: true
674
+ });
675
+ }
676
+ }));
677
+ return [
678
+ ...cacheUploaded,
679
+ ...hydrated
680
+ ];
681
+ }
682
+ if (!publisher) throw new Error('uploadOptions provided but no projectPublisher configured (configure the selected adapter to enable it or omit uploadOptions)');
683
+ const projectUploadResults = await uploadProject(uploadResults, sharedFilePaths, normalizedConfig, publisher, store);
684
+ return projectUploadResults;
685
+ }
686
+ const buildLimit = external_p_limit_default()(Math.max(1, external_node_os_default().cpus().length));
687
+ const buildRoute = new external_hono_namespaceObject.Hono();
688
+ buildRoute.post('/', (0, zod_validator_namespaceObject.zValidator)('json', ConfigSchema), async (c)=>{
689
+ const logger = c.get('logger');
690
+ const startTime = Date.now();
691
+ const jobId = (0, external_nanoid_namespaceObject.nanoid)();
692
+ logger.info(jobId);
693
+ const body = c.req.valid('json');
694
+ logger.info(JSON.stringify(body));
695
+ const normalizedConfig = normalizeConfig(body);
696
+ const store = c.get('objectStore');
697
+ const publisher = c.get('projectPublisher');
698
+ try {
699
+ const t0 = Date.now();
700
+ const { cacheItems, excludeShared, restConfig } = await retrieveCacheItems(normalizedConfig, 're-shake', store);
701
+ const tRetrieveCache = Date.now();
702
+ logger.info(`retrieveCacheItems took ${tRetrieveCache - t0}ms`);
703
+ let sharedFilePaths = [];
704
+ let dir;
705
+ if (Object.keys(restConfig).length > 0) {
706
+ const buildResult = await buildLimit(()=>runBuild(normalizedConfig, excludeShared, 're-shake'));
707
+ sharedFilePaths = buildResult.sharedFilePaths;
708
+ dir = buildResult.dir;
709
+ }
710
+ const tBuild = Date.now();
711
+ logger.info(`runBuild took ${tBuild - tRetrieveCache}ms`);
712
+ const uploadResults = await upload(sharedFilePaths, cacheItems, normalizedConfig, body.uploadOptions, store, publisher);
713
+ const tUpload = Date.now();
714
+ logger.info(`upload took ${tUpload - tBuild}ms`);
715
+ cleanUp(dir).catch((err)=>{
716
+ logger.error(`Failed to cleanup dir ${dir}: ${err}`);
717
+ });
718
+ const tCleanUp = Date.now();
719
+ logger.info(`cleanUp scheduled (non-blocking) took ${tCleanUp - tUpload}ms`);
720
+ return c.json({
721
+ jobId,
722
+ status: 'success',
723
+ data: uploadResults,
724
+ cached: cacheItems,
725
+ duration: Date.now() - startTime
726
+ });
727
+ } catch (error) {
728
+ if (error instanceof CommandExecutionError) {
729
+ if (137 === error.exitCode) maybePrune();
730
+ return c.json({
731
+ jobId,
732
+ status: 'failed',
733
+ error: error.message,
734
+ command: error.command,
735
+ exitCode: error.exitCode,
736
+ stdout: error.stdout,
737
+ stderr: error.stderr
738
+ });
739
+ }
740
+ return c.json({
741
+ jobId,
742
+ status: 'failed',
743
+ error: error instanceof Error ? error.message : 'Unknown error'
744
+ });
745
+ }
746
+ });
747
+ async function handleCheckTreeshake(c, body) {
748
+ const logger = c.get('logger');
749
+ const startTime = Date.now();
750
+ const jobId = (0, external_nanoid_namespaceObject.nanoid)();
751
+ logger.info(jobId);
752
+ logger.info(JSON.stringify(body));
753
+ const normalizedConfig = normalizeConfig(body);
754
+ const store = c.get('objectStore');
755
+ const publisher = c.get('projectPublisher');
756
+ try {
757
+ const t0 = Date.now();
758
+ const { cacheItems, excludeShared, restConfig } = await retrieveCacheItems(normalizedConfig, 'full', store);
759
+ const tRetrieveCache = Date.now();
760
+ logger.info(`retrieveCacheItems took ${tRetrieveCache - t0}ms`);
761
+ let sharedFilePaths = [];
762
+ let dir;
763
+ if (Object.keys(restConfig).length > 0) {
764
+ const buildResult = await buildLimit(()=>runBuild(normalizedConfig, excludeShared, 'full'));
765
+ sharedFilePaths = buildResult.sharedFilePaths;
766
+ dir = buildResult.dir;
767
+ }
768
+ const tBuild = Date.now();
769
+ logger.info(`runBuild took ${tBuild - tRetrieveCache}ms`);
770
+ const uploadResults = await upload(sharedFilePaths, cacheItems, normalizedConfig, body.uploadOptions, store, publisher);
771
+ const tUpload = Date.now();
772
+ logger.info(`upload took ${tUpload - tBuild}ms`);
773
+ cleanUp(dir).catch((err)=>{
774
+ logger.error(`Failed to cleanup dir ${dir}: ${err}`);
775
+ });
776
+ const tCleanUp = Date.now();
777
+ logger.info(`cleanUp scheduled (non-blocking) took ${tCleanUp - tUpload}ms`);
778
+ return c.json({
779
+ jobId,
780
+ status: 'success',
781
+ data: uploadResults,
782
+ cached: cacheItems,
783
+ duration: Date.now() - startTime
784
+ });
785
+ } catch (error) {
786
+ if (error instanceof CommandExecutionError) {
787
+ if (137 === error.exitCode) maybePrune();
788
+ return c.json({
789
+ jobId,
790
+ status: 'failed',
791
+ error: error.message,
792
+ command: error.command,
793
+ exitCode: error.exitCode,
794
+ stdout: error.stdout,
795
+ stderr: error.stderr
796
+ });
797
+ }
798
+ return c.json({
799
+ jobId,
800
+ status: 'failed',
801
+ error: error instanceof Error ? error.message : 'Unknown error'
802
+ });
803
+ }
804
+ }
805
+ buildRoute.post('/check-tree-shaking', (0, zod_validator_namespaceObject.zValidator)('json', CheckTreeShakingSchema), async (c)=>handleCheckTreeshake(c, c.req.valid('json')));
806
+ const maintenanceRoute = new external_hono_namespaceObject.Hono();
807
+ maintenanceRoute.post('/', async (c)=>{
808
+ const logger = c.get('logger');
809
+ const jobId = (0, external_nanoid_namespaceObject.nanoid)();
810
+ const startTime = Date.now();
811
+ logger.info(jobId);
812
+ await maybePrune();
813
+ return c.json({
814
+ jobId,
815
+ status: 'success',
816
+ duration: Date.now() - startTime
817
+ });
818
+ });
819
+ const routes = new external_hono_namespaceObject.Hono();
820
+ routes.route('/build', buildRoute);
821
+ routes.route('/clean-cache', maintenanceRoute);
822
+ const external_node_fs_namespaceObject = require("node:fs");
823
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
824
+ function contentTypeByExt(filePath) {
825
+ if (filePath.endsWith('.js')) return "application/javascript";
826
+ if (filePath.endsWith('.json')) return 'application/json';
827
+ return 'application/octet-stream';
828
+ }
829
+ const DEFAULT_STATIC_ROOT = external_node_path_default().join(process.cwd(), 'log', 'static');
830
+ async function serveLocalFile(c, rootDir) {
831
+ let requestPath = c.req.path;
832
+ try {
833
+ requestPath = decodeURIComponent(requestPath);
834
+ } catch {
835
+ return c.text('Not Found', 404);
836
+ }
837
+ const relPath = requestPath.replace(/^\/+/, '');
838
+ const rootResolved = external_node_path_default().resolve(rootDir);
839
+ const filePath = external_node_path_default().resolve(rootResolved, relPath);
840
+ if (filePath !== rootResolved && !filePath.startsWith(`${rootResolved}${external_node_path_default().sep}`)) return c.text('Not Found', 404);
841
+ try {
842
+ const buf = await external_node_fs_default().promises.readFile(filePath);
843
+ return new Response(buf, {
844
+ status: 200,
845
+ headers: {
846
+ 'Content-Type': contentTypeByExt(filePath)
847
+ }
848
+ });
849
+ } catch {
850
+ return c.text('Not Found', 404);
851
+ }
852
+ }
853
+ function createStaticRoute(opts) {
854
+ const staticRoute = new external_hono_namespaceObject.Hono();
855
+ const rootDir = (null == opts ? void 0 : opts.rootDir) ?? DEFAULT_STATIC_ROOT;
856
+ staticRoute.get('/tree-shaking-shared/*', async (c)=>serveLocalFile(c, rootDir));
857
+ return staticRoute;
858
+ }
859
+ function createApp(deps, opts) {
860
+ var _opts_appExtensions, _opts_frontendAdapters;
861
+ if (null == opts ? void 0 : opts.logger) setLogger(opts.logger);
862
+ setRuntimeEnv((null == opts ? void 0 : opts.runtimeEnv) ?? process.env);
863
+ const app = new external_hono_namespaceObject.Hono();
864
+ const corsOrigin = (null == opts ? void 0 : opts.corsOrigin) ?? '*';
865
+ const staticRootDir = (null == opts ? void 0 : opts.staticRootDir) ?? DEFAULT_STATIC_ROOT;
866
+ app.use('*', (0, cors_namespaceObject.cors)({
867
+ origin: corsOrigin,
868
+ allowMethods: [
869
+ 'GET',
870
+ 'POST',
871
+ 'OPTIONS'
872
+ ],
873
+ allowHeaders: [
874
+ 'Content-Type',
875
+ 'Authorization'
876
+ ]
877
+ }));
878
+ app.use('*', loggerMiddleware);
879
+ app.use('*', createDiMiddleware(deps));
880
+ if (null == opts ? void 0 : null == (_opts_appExtensions = opts.appExtensions) ? void 0 : _opts_appExtensions.length) for (const extend of opts.appExtensions)extend(app);
881
+ app.get('/tree-shaking-shared/healthz', (c)=>c.json({
882
+ status: 'ok',
883
+ timestamp: new Date().toISOString()
884
+ }));
885
+ app.route('/tree-shaking-shared', routes);
886
+ app.route('/', createStaticRoute({
887
+ rootDir: staticRootDir
888
+ }));
889
+ if (null == opts ? void 0 : null == (_opts_frontendAdapters = opts.frontendAdapters) ? void 0 : _opts_frontendAdapters.length) for (const adapter of opts.frontendAdapters)adapter.register(app);
890
+ startPeriodicPrune(null == opts ? void 0 : opts.pruneIntervalMs);
891
+ return app;
892
+ }
893
+ const node_server_namespaceObject = require("@hono/node-server");
894
+ function createServer(opts) {
895
+ const port = opts.port ?? 3000;
896
+ const hostname = opts.hostname ?? '0.0.0.0';
897
+ return (0, node_server_namespaceObject.serve)({
898
+ fetch: opts.app.fetch,
899
+ port,
900
+ hostname
901
+ });
902
+ }
903
+ async function createAdapterDeps(params) {
904
+ const adapterId = params.adapterId;
905
+ const adapter = params.registry.getAdapterById(adapterId);
906
+ return adapter.create(params.adapterConfig ?? {}, {
907
+ logger: params.logger ?? logger_logger,
908
+ uploadedDir: params.uploadedDir ?? UPLOADED_DIR
909
+ });
910
+ }
911
+ function localObjectStore_define_property(obj, key, value) {
912
+ if (key in obj) Object.defineProperty(obj, key, {
913
+ value: value,
914
+ enumerable: true,
915
+ configurable: true,
916
+ writable: true
917
+ });
918
+ else obj[key] = value;
919
+ return obj;
920
+ }
921
+ class LocalObjectStore {
922
+ async exists(key) {
923
+ const filePath = external_node_path_default().join(this.rootDir, key.replace(/^\//, ''));
924
+ try {
925
+ const stat = await external_node_fs_default().promises.stat(filePath);
926
+ return stat.isFile();
927
+ } catch {
928
+ return false;
929
+ }
930
+ }
931
+ async uploadFile(localPath, key) {
932
+ const rel = key.replace(/^\//, '');
933
+ const dest = external_node_path_default().join(this.rootDir, rel);
934
+ await external_node_fs_default().promises.mkdir(external_node_path_default().dirname(dest), {
935
+ recursive: true
936
+ });
937
+ await external_node_fs_default().promises.copyFile(localPath, dest);
938
+ }
939
+ async downloadFile(key, localPath) {
940
+ const rel = key.replace(/^\//, '');
941
+ const src = external_node_path_default().join(this.rootDir, rel);
942
+ await external_node_fs_default().promises.mkdir(external_node_path_default().dirname(localPath), {
943
+ recursive: true
944
+ });
945
+ await external_node_fs_default().promises.copyFile(src, localPath);
946
+ }
947
+ publicUrl(key) {
948
+ return `${this.publicBaseUrl}${key.replace(/^\//, '')}`;
949
+ }
950
+ constructor(opts){
951
+ localObjectStore_define_property(this, "rootDir", void 0);
952
+ localObjectStore_define_property(this, "publicBaseUrl", void 0);
953
+ this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? external_node_path_default().join(process.cwd(), 'log', 'static');
954
+ const base = (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
955
+ this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
956
+ }
957
+ }
958
+ function adapter_define_property(obj, key, value) {
959
+ if (key in obj) Object.defineProperty(obj, key, {
960
+ value: value,
961
+ enumerable: true,
962
+ configurable: true,
963
+ writable: true
964
+ });
965
+ else obj[key] = value;
966
+ return obj;
967
+ }
968
+ function envStr(env, name, fallback) {
969
+ const v = env[name];
970
+ if (void 0 === v || '' === v) return fallback;
971
+ return v;
972
+ }
973
+ class LocalAdapter {
974
+ fromEnv(env) {
975
+ return {
976
+ rootDir: envStr(env, 'LOCAL_STORE_DIR', external_node_path_default().join(process.cwd(), 'log', 'static')),
977
+ publicBaseUrl: envStr(env, 'LOCAL_STORE_BASE_URL', '/')
978
+ };
979
+ }
980
+ async create(config, _context) {
981
+ const objectStore = new LocalObjectStore({
982
+ rootDir: config.rootDir,
983
+ publicBaseUrl: config.publicBaseUrl
984
+ });
985
+ return {
986
+ objectStore
987
+ };
988
+ }
989
+ constructor(){
990
+ adapter_define_property(this, "id", 'local');
991
+ }
992
+ }
993
+ function createAdapterRegistry(adapters) {
994
+ return {
995
+ adapters,
996
+ getAdapterById: (id)=>{
997
+ const found = adapters.find((a)=>a.id === id);
998
+ if (!found) throw new Error(`Unknown ADAPTER_ID: ${id}`);
999
+ return found;
1000
+ }
1001
+ };
1002
+ }
1003
+ function createOssAdapterRegistry() {
1004
+ return createAdapterRegistry([
1005
+ new LocalAdapter()
1006
+ ]);
1007
+ }
1008
+ exports.LocalAdapter = __webpack_exports__.LocalAdapter;
1009
+ exports.LocalObjectStore = __webpack_exports__.LocalObjectStore;
1010
+ exports.createAdapterDeps = __webpack_exports__.createAdapterDeps;
1011
+ exports.createAdapterRegistry = __webpack_exports__.createAdapterRegistry;
1012
+ exports.createApp = __webpack_exports__.createApp;
1013
+ exports.createLogger = __webpack_exports__.createLogger;
1014
+ exports.createOssAdapterRegistry = __webpack_exports__.createOssAdapterRegistry;
1015
+ exports.createServer = __webpack_exports__.createServer;
1016
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1017
+ "LocalAdapter",
1018
+ "LocalObjectStore",
1019
+ "createAdapterDeps",
1020
+ "createAdapterRegistry",
1021
+ "createApp",
1022
+ "createLogger",
1023
+ "createOssAdapterRegistry",
1024
+ "createServer"
1025
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1026
+ Object.defineProperty(exports, '__esModule', {
1027
+ value: true
1028
+ });