@zntc/core 0.1.0 → 0.1.2

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/bin/cli-flags.mjs CHANGED
@@ -52,6 +52,9 @@ export const FLAG_REGISTRY = [
52
52
  { kind: 'bool', flag: '--watch', target: 'watch', aliases: ['-w'] },
53
53
  { kind: 'bool', flag: '--watch-json', target: 'watchJson', extra: { watch: true } },
54
54
  { kind: 'bool', flag: '--open', target: 'open' },
55
+ // #4062 PR-C-3 — `zntc dev --lazy`: 동적 import 타겟을 on-demand 로 컴파일(미사용 라우트
56
+ // 미파싱·미emit). dev 서버가 브라우저 요청 시점에 그 청크만 빌드한다. env ZNTC_LAZY=1 와 동치.
57
+ { kind: 'bool', flag: '--lazy', target: 'lazy' },
55
58
  // RN CLI 호환 (#2605 audit P0)
56
59
  { kind: 'bool', flag: '--reset-cache', target: 'resetCache' },
57
60
  { kind: 'bool', flag: '--sourcemap-use-absolute-path', target: 'sourcemapUseAbsolutePath' },
@@ -81,6 +84,7 @@ export const FLAG_REGISTRY = [
81
84
  { kind: 'bool', flag: '--no-tree-shaking', target: 'treeShaking', value: false },
82
85
  { kind: 'bool', flag: '--no-scope-hoist', target: 'scopeHoist', value: false },
83
86
  { kind: 'bool', flag: '--no-emit-disk-sourcemap', target: 'emitDiskSourcemap', value: false },
87
+ { kind: 'bool', flag: '--no-react-refresh', target: 'reactRefresh', value: false },
84
88
  { kind: 'bool', flag: '--analyze', target: 'analyze', extra: { metafile: 'meta.json' } },
85
89
  { kind: 'bool', flag: '--flow', target: 'flow' },
86
90
  { kind: 'bool', flag: '--experimental-decorators', target: 'experimentalDecorators' },
@@ -116,6 +120,7 @@ export const FLAG_REGISTRY = [
116
120
  { kind: 'string', flag: '--entry-names', target: 'entryNames', forms: ['equal'] },
117
121
  { kind: 'string', flag: '--chunk-names', target: 'chunkNames', forms: ['equal'] },
118
122
  { kind: 'string', flag: '--asset-names', target: 'assetNames', forms: ['equal'] },
123
+ { kind: 'string', flag: '--css-names', target: 'cssNames', forms: ['equal'] },
119
124
  { kind: 'string', flag: '--quotes', target: 'quotes', forms: ['equal'] },
120
125
  { kind: 'string', flag: '--log-level', target: 'logLevel', forms: ['equal'] },
121
126
  { kind: 'string', flag: '--legal-comments', target: 'legalComments', forms: ['equal'] },
@@ -266,6 +271,9 @@ export const FLAG_REGISTRY = [
266
271
  { kind: 'string-bool', flag: '--emit-disk-sourcemap', target: 'emitDiskSourcemap' },
267
272
  { kind: 'string-bool', flag: '--use-define-for-class-fields', target: 'useDefineForClassFields' },
268
273
  { kind: 'string-bool', flag: '--tokenize', target: 'tokenize' },
274
+ // React Fast Refresh. `zntc dev` 는 기본 on(아래 dev 블록) — `--react-refresh=false`
275
+ // / `--no-react-refresh` 로 opt-out. NAPI BuildOptions.reactRefresh 와 동일 target.
276
+ { kind: 'string-bool', flag: '--react-refresh', target: 'reactRefresh' },
269
277
 
270
278
  // ─── `zntc verify` 전용. 다른 모드와 silent 충돌 방지를 위해 prefix 강제 ───
271
279
  { kind: 'int', flag: '--verify-timeout', target: 'verifyTimeout' },
@@ -91,6 +91,9 @@ export function buildRnBundleExtra(config, opts = {}) {
91
91
  fallback: resolver.extraNodeModules ?? undefined,
92
92
  metroResolveRequest: resolver.resolveRequest ?? undefined,
93
93
  babelTransformerPath: transformer.babelTransformerPath ?? undefined,
94
+ // HMR 위상 보존 게이트 명시 override (config top-level). 사용자가 "내 resolveRequest/
95
+ // transformer 는 결정적"임을 보장하면 true 로 보존 강제 — preset 의 보수적 자동판정을 덮어쓴다.
96
+ preserveSafePlugins: cfg.preserveSafePlugins ?? undefined,
94
97
  polyfills: getSerializerPolyfills(serializer, opts),
95
98
  extraVars: serializer.extraVars ?? undefined,
96
99
  prelude: serializer.prelude ?? undefined,
@@ -208,6 +211,9 @@ export function buildRnDevServerInput(opts, config) {
208
211
  opts.minifySyntax ||
209
212
  cfg.minify ||
210
213
  false,
214
+ // watch 디바운스(ms) — CLI `--watch-delay`. native NAPI watch 의 debounce_ms 로 전달
215
+ // (buildRnBundleOptions → watch → getObjectUint32("watchDelay")). 기본 16.
216
+ watchDelay: opts.watchDelay,
211
217
  extra: buildRnBundleExtra(cfg, opts),
212
218
  override: buildRnBundleOverride({ config: cfg, opts }),
213
219
  },