@granite-js/mpack 0.1.7 → 0.1.8

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 (91) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bundler/Bundler.d.ts +1 -1
  3. package/dist/bundler/Bundler.js +2 -2
  4. package/dist/bundler/internal/presets.d.ts +2 -1
  5. package/dist/bundler/internal/presets.js +2 -4
  6. package/dist/bundler/plugins/buildStatusPlugin/buildStatusPlugin.d.ts +2 -2
  7. package/dist/bundler/plugins/buildStatusPlugin/buildStatusPlugin.js +4 -5
  8. package/dist/bundler/plugins/dependencyAliasPlugin/aliasResolver.d.ts +1 -1
  9. package/dist/bundler/plugins/dependencyAliasPlugin/protocolResolver.d.ts +1 -1
  10. package/dist/bundler/plugins/shared/swc.d.ts +1 -1
  11. package/dist/bundler/plugins/transformPlugin/steps/createTransformToHermesSyntaxStep.d.ts +1 -1
  12. package/dist/constants/index.d.ts +1 -1
  13. package/dist/constants/index.js +1 -1
  14. package/dist/index.d.ts +3 -6
  15. package/dist/index.js +9 -9
  16. package/dist/metro/build.d.ts +17 -0
  17. package/dist/metro/build.js +104 -0
  18. package/dist/metro/getMetroConfig.d.ts +2 -13
  19. package/dist/metro/getMetroConfig.js +3 -6
  20. package/dist/metro/index.d.ts +1 -2
  21. package/dist/metro/index.js +20 -3
  22. package/dist/operations/build.d.ts +15 -0
  23. package/dist/operations/{runBundle.js → build.js} +51 -37
  24. package/dist/operations/createDebuggerMiddleware.d.ts +1 -2
  25. package/dist/operations/createDebuggerMiddleware.js +4 -4
  26. package/dist/operations/experimental/serve.d.ts +11 -0
  27. package/dist/operations/experimental/{runServer.js → serve.js} +21 -22
  28. package/dist/operations/index.d.ts +3 -3
  29. package/dist/operations/index.js +23 -6
  30. package/dist/operations/openDebugger.d.ts +1 -1
  31. package/dist/operations/openDebugger.js +3 -2
  32. package/dist/operations/serve.d.ts +10 -0
  33. package/dist/operations/{runServer.js → serve.js} +11 -13
  34. package/dist/plugins/statusPlugin.js +1 -1
  35. package/dist/server/DevServer.js +8 -9
  36. package/dist/server/helpers/createBundlerForDevServer.d.ts +3 -5
  37. package/dist/server/helpers/createBundlerForDevServer.js +7 -20
  38. package/dist/server/helpers/mergeBundles.d.ts +1 -1
  39. package/dist/server/plugins/serveBundlePlugin.d.ts +2 -2
  40. package/dist/server/plugins/symbolicatePlugin/symbolicatePlugin.d.ts +2 -2
  41. package/dist/server/types.d.ts +9 -13
  42. package/dist/types/BundlerConfig.d.ts +1 -34
  43. package/dist/types/Id.d.ts +3 -0
  44. package/dist/{bundler/types.js → types/Id.js} +2 -2
  45. package/dist/types/Plugin.d.ts +2 -2
  46. package/dist/types/index.d.ts +1 -5
  47. package/dist/types/index.js +2 -10
  48. package/dist/utils/getId.js +1 -8
  49. package/dist/utils/progressBar.d.ts +1 -1
  50. package/dist/utils/writeBundle.d.ts +1 -1
  51. package/package.json +5 -4
  52. package/dist/bundler/types.d.ts +0 -17
  53. package/dist/metro/runBuild.d.ts +0 -12
  54. package/dist/metro/runBuild.js +0 -66
  55. package/dist/metro/runtime.d.ts +0 -3
  56. package/dist/metro/runtime.js +0 -54
  57. package/dist/metro/types.d.ts +0 -92
  58. package/dist/metro/types.js +0 -16
  59. package/dist/operations/experimental/runServer.d.ts +0 -15
  60. package/dist/operations/runBundle.d.ts +0 -12
  61. package/dist/operations/runServer.d.ts +0 -15
  62. package/dist/types/BuildConfig.d.ts +0 -183
  63. package/dist/types/BuildConfig.js +0 -16
  64. package/dist/types/Config.d.ts +0 -12
  65. package/dist/types/Config.js +0 -16
  66. package/dist/types/DevServerConfig.d.ts +0 -4
  67. package/dist/types/DevServerConfig.js +0 -16
  68. package/dist/types/ServicesConfig.d.ts +0 -2
  69. package/dist/types/ServicesConfig.js +0 -16
  70. package/dist/types/TaskConfig.d.ts +0 -11
  71. package/dist/types/TaskConfig.js +0 -16
  72. package/dist/types/schemas/buildConfigSchema.d.ts +0 -198
  73. package/dist/types/schemas/buildConfigSchema.js +0 -70
  74. package/dist/types/schemas/bundlerConfigSchema.d.ts +0 -3
  75. package/dist/types/schemas/bundlerConfigSchema.js +0 -51
  76. package/dist/types/schemas/configSchema.d.ts +0 -3
  77. package/dist/types/schemas/configSchema.js +0 -50
  78. package/dist/types/schemas/devServerConfigSchema.d.ts +0 -3
  79. package/dist/types/schemas/devServerConfigSchema.js +0 -42
  80. package/dist/types/schemas/index.d.ts +0 -6
  81. package/dist/types/schemas/index.js +0 -32
  82. package/dist/types/schemas/servicesConfigSchema.d.ts +0 -3
  83. package/dist/types/schemas/servicesConfigSchema.js +0 -48
  84. package/dist/types/schemas/taskConfigSchema.d.ts +0 -3
  85. package/dist/types/schemas/taskConfigSchema.js +0 -44
  86. package/dist/utils/mergeBanners.d.ts +0 -6
  87. package/dist/utils/mergeBanners.js +0 -35
  88. package/dist/utils/mergeBuildConfigs.d.ts +0 -2
  89. package/dist/utils/mergeBuildConfigs.js +0 -59
  90. package/dist/utils/mergeInject.d.ts +0 -3
  91. package/dist/utils/mergeInject.js +0 -30
@@ -1,12 +0,0 @@
1
- import type { MetroConfig } from './types';
2
- export declare function runBuild({ appName, scheme, rootPath, entry, platform, minify, out, dev, additionalConfig, }: {
3
- appName: string;
4
- scheme: string;
5
- rootPath: string;
6
- entry: string;
7
- platform: 'ios' | 'android';
8
- minify: boolean;
9
- out: string;
10
- dev: boolean;
11
- additionalConfig?: MetroConfig;
12
- }): Promise<void>;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var runBuild_exports = {};
30
- __export(runBuild_exports, {
31
- runBuild: () => runBuild
32
- });
33
- module.exports = __toCommonJS(runBuild_exports);
34
- var import_getMetroConfig = require("./getMetroConfig");
35
- var import_src = __toESM(require("../vendors/metro/src"));
36
- async function runBuild({
37
- appName,
38
- scheme,
39
- rootPath,
40
- entry,
41
- platform,
42
- minify,
43
- out,
44
- dev,
45
- additionalConfig
46
- }) {
47
- const config = await (0, import_getMetroConfig.getMetroConfig)(
48
- {
49
- appName,
50
- rootPath,
51
- scheme
52
- },
53
- additionalConfig
54
- );
55
- await import_src.default.runBuild(config, {
56
- entry,
57
- platform,
58
- minify,
59
- out,
60
- dev
61
- });
62
- }
63
- // Annotate the CommonJS export names for ESM import in node:
64
- 0 && (module.exports = {
65
- runBuild
66
- });
@@ -1,3 +0,0 @@
1
- export declare function writeEnvScript(rootPath: string, appName: string, scheme: string): Promise<{
2
- path: string;
3
- }>;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var runtime_exports = {};
30
- __export(runtime_exports, {
31
- writeEnvScript: () => writeEnvScript
32
- });
33
- module.exports = __toCommonJS(runtime_exports);
34
- var import_promises = __toESM(require("fs/promises"));
35
- var import_path = __toESM(require("path"));
36
- async function writeEnvScript(rootPath, appName, scheme) {
37
- const script = getEnvScript(appName, scheme);
38
- const basePath = import_path.default.join(rootPath, ".granite");
39
- const filePath = import_path.default.join(basePath, ".env.js");
40
- await import_promises.default.access(basePath).catch(() => import_promises.default.mkdir(basePath));
41
- await import_promises.default.writeFile(filePath, script, { encoding: "utf-8" });
42
- return { path: filePath };
43
- }
44
- function getEnvScript(appName, scheme) {
45
- const script = [
46
- "global.__granite = global.__granite || {};",
47
- `global.__granite.app = { name: ${appName.startsWith("babel:") ? appName.slice(6) : JSON.stringify(appName)}, scheme: ${JSON.stringify(scheme)} };`
48
- ].join("\n");
49
- return script;
50
- }
51
- // Annotate the CommonJS export names for ESM import in node:
52
- 0 && (module.exports = {
53
- writeEnvScript
54
- });
@@ -1,92 +0,0 @@
1
- import { ReportableEvent } from "../vendors/metro/src/lib/ReportableEvent";
2
- type Untyped = any;
3
- interface PackageJson {
4
- readonly name?: string;
5
- readonly main?: string;
6
- readonly exports?: string | Untyped;
7
- }
8
- interface PackageInfo {
9
- readonly packageJson: PackageJson;
10
- readonly rootPath: string;
11
- }
12
- type ResolveAsset = (dirPath: string, assetName: string, extension: string) => string[] | undefined;
13
- interface ResolutionContext {
14
- readonly assetExts: string[];
15
- readonly allowHaste: boolean;
16
- readonly customResolverOptions: Untyped;
17
- readonly disableHierarchicalLookup: boolean;
18
- readonly doesFileExist: Untyped;
19
- readonly extraNodeModules?: {
20
- [key: string]: string;
21
- };
22
- readonly getPackage: (packageJsonPath: string) => PackageJson | null;
23
- readonly getPackageForModule: (modulePath: string) => PackageInfo | null;
24
- readonly dependency?: any;
25
- readonly mainFields: string[];
26
- readonly originModulePath: string;
27
- readonly nodeModulesPaths: string[];
28
- readonly preferNativePlatform: boolean;
29
- readonly resolveAsset: ResolveAsset;
30
- readonly redirectModulePath: (modulePath: string) => string | false;
31
- readonly resolveHasteModule: (name: string) => string | undefined;
32
- readonly resolveHastePackage: (name: string) => string | undefined;
33
- readonly resolveRequest?: CustomResolver;
34
- readonly sourceExts: string[];
35
- readonly unstable_conditionsByPlatform: {
36
- [platform: string]: string[];
37
- };
38
- unstable_conditionNames: string[];
39
- unstable_enablePackageExports: boolean;
40
- unstable_getRealPath?: any;
41
- unstable_logWarning: (message: string) => void;
42
- }
43
- export interface CustomResolutionContext extends ResolutionContext {
44
- readonly resolveRequest: CustomResolver;
45
- }
46
- type CustomResolver = (context: CustomResolutionContext, moduleName: string, platform: string | null) => any;
47
- interface ResolverConfig {
48
- assetExts: string[];
49
- assetResolutions: string[];
50
- blacklistRE?: RegExp | RegExp[];
51
- blockList: RegExp | RegExp[];
52
- dependencyExtractor?: string;
53
- disableHierarchicalLookup: boolean;
54
- extraNodeModules: {
55
- [name: string]: string;
56
- };
57
- emptyModulePath: string;
58
- enableGlobalPackages: boolean;
59
- hasteImplModulePath?: string;
60
- nodeModulesPaths: string[];
61
- platforms: string[];
62
- resolveRequest?: CustomResolver;
63
- resolverMainFields: string[];
64
- sourceExts: string[];
65
- unstable_enableSymlinks: boolean;
66
- unstable_conditionNames: string[];
67
- unstable_conditionsByPlatform: Readonly<{
68
- [platform: string]: string[];
69
- }>;
70
- unstable_enablePackageExports: boolean;
71
- useWatchman: boolean;
72
- requireCycleIgnorePatterns: ReadonlyArray<RegExp>;
73
- }
74
- /**
75
- * 패키지에서 타입 정의 파일이 export 되어있지 않아 별도로 타입을 정의합니다.
76
- */
77
- export interface MetroConfig {
78
- readonly watchFolders?: string[];
79
- readonly cacheStores?: any;
80
- readonly resolver?: Partial<ResolverConfig>;
81
- readonly server?: any;
82
- readonly serializer?: object & {
83
- getPolyfills?: () => string[];
84
- };
85
- readonly symbolicator?: any;
86
- readonly transformer?: any;
87
- readonly watcher?: any;
88
- readonly reporter?: {
89
- update: (event: ReportableEvent) => void;
90
- };
91
- }
92
- export {};
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
@@ -1,15 +0,0 @@
1
- import type { DevServerPlugin } from '../../server/types';
2
- import type { DevServerConfig } from '../../types/DevServerConfig';
3
- interface RunServerArgs {
4
- appName: string;
5
- scheme: string;
6
- devServerConfig: DevServerConfig;
7
- host?: string;
8
- port?: number;
9
- plugins?: DevServerPlugin[];
10
- onServerReady?: () => Promise<void> | void;
11
- }
12
- export declare function experimental_runServer({ appName, scheme, devServerConfig, host, port, plugins, onServerReady, }: RunServerArgs): Promise<{
13
- cleanup: () => Promise<void>;
14
- }>;
15
- export {};
@@ -1,12 +0,0 @@
1
- import { BundlerConfig, Config, PluginFactory } from '../types';
2
- interface RunBundleOptions {
3
- config: Config;
4
- rootDir: BundlerConfig['rootDir'];
5
- dev: BundlerConfig['dev'];
6
- cache: BundlerConfig['cache'];
7
- metafile: BundlerConfig['metafile'];
8
- plugins?: PluginFactory[];
9
- tag?: string;
10
- }
11
- export declare function runBundle(options: RunBundleOptions): Promise<import("..").BuildResult[]>;
12
- export {};
@@ -1,15 +0,0 @@
1
- import type { HandleFunction } from 'connect';
2
- import { Config } from '..';
3
- import { type AdditionalMetroConfig } from '../metro/getMetroConfig';
4
- interface RunServerConfig {
5
- config: Config;
6
- host?: string;
7
- port?: number;
8
- middlewares?: HandleFunction[];
9
- enableEmbeddedReactDevTools?: boolean;
10
- onServerReady?: () => Promise<void> | void;
11
- cwd?: string;
12
- additionalConfig?: AdditionalMetroConfig;
13
- }
14
- export declare function runServer({ config, host, port, middlewares, enableEmbeddedReactDevTools, onServerReady, cwd, additionalConfig, }: RunServerConfig): Promise<void>;
15
- export {};
@@ -1,183 +0,0 @@
1
- import * as swc from '@swc/core';
2
- import * as esbuild from 'esbuild';
3
- export interface BuildConfig {
4
- /**
5
- * 빌드 타겟 플랫폼
6
- */
7
- platform: 'ios' | 'android';
8
- /**
9
- * 빌드 진입점 파일 경로
10
- */
11
- entry: string;
12
- /**
13
- * 빌드 결과 파일 경로
14
- */
15
- outfile: string;
16
- /**
17
- * 소스맵 결과 파일 경로
18
- *
19
- * @default `${outfile}.map`
20
- */
21
- sourcemapOutfile?: string;
22
- /**
23
- * 모듈 resolution 구성
24
- */
25
- resolver?: {
26
- /**
27
- * 의존성 alias 구성
28
- */
29
- alias?: AliasConfig[];
30
- /**
31
- * 커스텀 모듈 Protocol 구성
32
- */
33
- protocols?: ProtocolConfig;
34
- };
35
- /**
36
- * 커스텀 Transform 구성
37
- */
38
- transformSync?: (id: string, code: string) => string;
39
- transformAsync?: (id: string, code: string) => Promise<string>;
40
- /**
41
- * esbuild 구성
42
- */
43
- esbuild?: esbuild.BuildOptions & {
44
- /**
45
- * Entry point 최상단에 주입할 스크립트 경로
46
- *
47
- * esbuild.inject 옵션에 추가한 스크립트의 경우 entry-point 모듈에만 주입되는 것이 아니라 모든 모듈에 주입되는 문제가 있음.
48
- * entry-point 모듈의 최상단에만 코드를 주입하도록 별도 옵션을 구성합니다.
49
- *
50
- * - 의도한 것과 같이 entry-point 모듈 최상단에 1회만 주입(import)됩니다
51
- * - 중복되는 inject 스크립트가 제거되어 번들 크기가 작아집니다
52
- *
53
- * @see issue {@link https://github.com/evanw/esbuild/issues/475}
54
- */
55
- prelude?: string[];
56
- };
57
- /**
58
- * 커스텀 babel 구성
59
- */
60
- babel?: {
61
- /**
62
- * Babel transform 처리를 위한 규칙 리스트
63
- * (속도가 느리기 때문에 특정 조건이 충족할 때에만 transform 하기 위한 옵션)
64
- *
65
- * 모든 규칙이 `false`를 반환할 경우 Babel transform 과정을 건너뜁니다
66
- */
67
- conditions?: Array<(code: string, path: string) => boolean>;
68
- configFile?: string;
69
- presets?: string[];
70
- plugins?: (string | [string, any])[];
71
- };
72
- /**
73
- * 커스텀 swc 구성
74
- */
75
- swc?: {
76
- /**
77
- * 플러그인 바이너리(wasm) 경로, 플러그인 구성
78
- */
79
- plugins?: NonNullable<swc.JscConfig['experimental']>['plugins'];
80
- };
81
- /**
82
- * 추가 데이터
83
- *
84
- * 작업 결과 데이터에 포함되며, 특정 값을 기반으로 후처리 하기 위한 목적으로 사용
85
- * (eg. 프리셋에서 특정 extra 데이터를 추가해주고, 결과에서 어떤 프리셋으로 빌드되었는지 구분)
86
- *
87
- * ```js
88
- * const result = new Bundler({
89
- * bundlerConfig: {
90
- * buildConfig: {
91
- * extra: {
92
- * reanimated: 3,
93
- * },
94
- * },
95
- * },
96
- * ...
97
- * }).build();
98
- *
99
- * if (result.extra?.reanimated === 3) {
100
- * // reav3 에 대한 빌드 결과물 처리
101
- * }
102
- * ```
103
- */
104
- extra?: any;
105
- }
106
- export interface AliasConfig {
107
- /**
108
- * 치환 대상 모듈 경로
109
- */
110
- from: string;
111
- /**
112
- * 치환할 모듈 경로 혹은 모듈 경로를 반환하는 함수
113
- */
114
- to: string | ((context: {
115
- args: esbuild.OnResolveArgs;
116
- resolve: esbuild.PluginBuild['resolve'];
117
- }) => string | Promise<string>);
118
- /**
119
- * - `false`: (기본값) subpath 가 존재해도 치환합니다 (`^name(?:$|/)`)
120
- * - `true`: 완벽히 일치하는 대상만 치환합니다 (`^name$`)
121
- *
122
- * ```js
123
- * const config = {
124
- * alias: [
125
- * { from: 'react-native', to: 'react-native-0.68' },
126
- * { from: 'react', to: 'react-17', exact: true },
127
- * ],
128
- * };
129
- *
130
- * // AS IS
131
- * import * as RN from 'react-native';
132
- * import 'react-native/Libraries/Core/InitializeCore';
133
- * import React from 'react';
134
- * import runtime from 'react/runtime';
135
- *
136
- * // TO BE
137
- * import * as RN from 'react-native-0.68';
138
- * import 'react-native-0.68/Libraries/Core/InitializeCore';
139
- * import React from 'react-17';
140
- * import runtime from 'react/runtime'; // exact
141
- * ```
142
- */
143
- exact?: boolean;
144
- }
145
- /**
146
- * 커스텀 프로토콜 Resolve 구성
147
- *
148
- * 지정한 프로토콜로 참조하는 모듈을 직접 resolve, load 할 수 있도록 구성하는 옵션입니다
149
- *
150
- * ```ts
151
- * // AS-IS
152
- * import mod from 'custom-protocol:/path/to/module';
153
- *
154
- * // TO-BE
155
- * // `custom-protocol:/path/to/module` 모듈은 아래와 같이 처리됨
156
- * export default global.__import('/path/to/module');
157
- * ```
158
- *
159
- * 구성 예시
160
- *
161
- * ```ts
162
- * {
163
- * 'custom-protocol': {
164
- * resolve: (args) => args.path,
165
- * load: (args) => {
166
- * return { loader: 'ts', contents: `export default global.__import('${args.path}')` };
167
- * },
168
- * },
169
- * }
170
- * ```
171
- */
172
- export interface ProtocolConfig {
173
- [name: string]: {
174
- /**
175
- * Resolve 할 모듈 경로
176
- */
177
- resolve?: (args: esbuild.OnResolveArgs) => string | Promise<string>;
178
- /**
179
- * Resolve 된 경로를 기준으로 모듈 코드를 반환
180
- */
181
- load: (args: esbuild.OnLoadArgs) => esbuild.OnLoadResult | Promise<esbuild.OnLoadResult>;
182
- };
183
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var BuildConfig_exports = {};
16
- module.exports = __toCommonJS(BuildConfig_exports);
@@ -1,12 +0,0 @@
1
- import type { DevServerConfig } from './DevServerConfig';
2
- import type { ServicesConfig } from './ServicesConfig';
3
- import type { TaskConfig } from './TaskConfig';
4
- export interface Config {
5
- appName: string;
6
- scheme: string;
7
- commands?: unknown[];
8
- concurrency?: number;
9
- tasks: TaskConfig[];
10
- devServer?: DevServerConfig;
11
- services?: ServicesConfig;
12
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var Config_exports = {};
16
- module.exports = __toCommonJS(Config_exports);
@@ -1,4 +0,0 @@
1
- import type { BuildConfig } from './BuildConfig';
2
- export interface DevServerConfig {
3
- build: Omit<BuildConfig, 'platform' | 'outfile'>;
4
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var DevServerConfig_exports = {};
16
- module.exports = __toCommonJS(DevServerConfig_exports);
@@ -1,2 +0,0 @@
1
- import type { BundlerConfig } from './BundlerConfig';
2
- export type ServicesConfig = BundlerConfig['services'];
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var ServicesConfig_exports = {};
16
- module.exports = __toCommonJS(ServicesConfig_exports);
@@ -1,11 +0,0 @@
1
- import type { BuildConfig } from './BuildConfig';
2
- export type INTERNAL__Id = string & {
3
- __id: true;
4
- };
5
- export interface TaskConfig {
6
- /**
7
- * 작업 식별자
8
- */
9
- tag: string;
10
- build: BuildConfig;
11
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var TaskConfig_exports = {};
16
- module.exports = __toCommonJS(TaskConfig_exports);