@zntc/init 0.1.1 → 0.1.3

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 (2) hide show
  1. package/README.md +46 -44
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,45 +1,64 @@
1
1
  # @zntc/init
2
2
 
3
- ZNTC project initializer. 기존 프로젝트에 ZNTC 를 얹거나 (overlay), 새 web 프로젝트를 스캐폴딩 (scaffold) 한다.
3
+ English · **[한국어](./README_KO.md)**
4
+
5
+ > Scaffold a new ZNTC project, or overlay ZNTC onto an existing React Native CLI / Vite / Rspack app.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@zntc/init.svg)](https://www.npmjs.com/package/@zntc/init)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ohah/zntc/blob/main/LICENSE)
9
+
10
+ `@zntc/init` is the project initializer for [ZNTC](https://github.com/ohah/zntc), a transpiler and bundler for JavaScript / TypeScript / Flow written in Zig. Run it with `npx` — no install step required. It can either **overlay** ZNTC onto an existing project (rewriting `package.json` and build-tool config to delegate transforms to ZNTC) or **scaffold** a standalone ZNTC web project into an empty directory.
11
+
12
+ ## Usage
4
13
 
5
14
  ```bash
6
15
  npx @zntc/init <mode> [options]
7
16
  ```
8
17
 
9
- ## Modes
18
+ ### Modes
10
19
 
11
- | Mode | 동작 | 대상 |
12
- | -------------- | -------- | ------------------------------------------------------- |
13
- | `react-native` | overlay | 기존 React Native CLI 프로젝트 |
14
- | `vite` | overlay | 기존 Vite 프로젝트 (`@zntc/vite-plugin`) |
15
- | `rspack` | overlay | 기존 Rspack / Webpack 프로젝트 (`@zntc/rspack-loader`) |
16
- | `web` | scaffold | 디렉토리에 ZNTC 단독 web 프로젝트 (Vite/Rspack 없이) |
20
+ | Mode | Action | Target |
21
+ | -------------- | -------- | -------------------------------------------------------------------- |
22
+ | `react-native` | overlay | Existing React Native CLI project |
23
+ | `vite` | overlay | Existing Vite project (`@zntc/vite-plugin`) |
24
+ | `rspack` | overlay | Existing Rspack / Webpack project (`@zntc/rspack-loader`) |
25
+ | `web` | scaffold | Standalone ZNTC web project in an empty directory (no Vite / Rspack) |
17
26
 
18
27
  ```bash
19
- npx @zntc/init react-native # RN overlay (mode 생략 시에도 동일하게 react-native)
20
- npx @zntc/init vite # Vite plugin 추가
21
- npx @zntc/init rspack # rspack-loader 추가 (webpack 자동 감지)
22
- npx @zntc/init web --framework react # react 프로젝트 스캐폴딩
28
+ npx @zntc/init react-native # RN overlay (also the default when the mode is omitted)
29
+ npx @zntc/init vite # Add the Vite plugin
30
+ npx @zntc/init rspack # Add rspack-loader (webpack is auto-detected too)
31
+ npx @zntc/init web --framework react # Scaffold a new React project
23
32
  ```
24
33
 
25
- ## Help
34
+ ### Overlay vs scaffold
26
35
 
27
- ```text
28
- Usage: zntc-init <mode> [options]
36
+ - **Overlay** (`react-native` / `vite` / `rspack`) — touches your existing `package.json` and build-tool config to delegate transforms to ZNTC.
37
+ - Adds `@zntc/core` plus the mode-specific package to `devDependencies`.
38
+ - If no build-tool config exists, a ZNTC default template is generated.
39
+ - If a build-tool config already exists, it is **not** overwritten — a manual snippet is printed for you to merge yourself. Use `--force` to overwrite.
40
+ - **Scaffold** (`web`) — creates a fresh project (`package.json`, `tsconfig.json`, `zntc.config.ts`, `index.html`, `src/*`) in an empty directory.
41
+ - Refuses to run if a `package.json` already exists. Use `--force` to overwrite.
42
+
43
+ Every mode supports `--dry-run`, which prints the planned changes without writing any files.
44
+
45
+ ### Mode details
46
+
47
+ - **`react-native`** — overlays the ZNTC dev server / bundler onto an existing React Native CLI project. Metro fallback scripts (`start:metro`, `bundle:metro:*`) are added by default. Expo is intentionally unsupported.
48
+ - **`vite`** — registers [`@zntc/vite-plugin`](https://github.com/ohah/zntc/tree/main/packages/vite-plugin) (with `esbuild: false`). Vite's dev server / HMR / plugin ecosystem stays as-is.
49
+ - **`rspack`** — registers [`@zntc/rspack-loader`](https://github.com/ohah/zntc/tree/main/packages/rspack-loader). The bundler is auto-detected from `@rspack/core` or `webpack` in `package.json`; override it with `--bundler rspack|webpack`.
50
+ - **`web`** — builds a web project that runs on the ZNTC dev server (`@zntc/web`) + bundler alone, without Vite or Rspack. React / vanilla templates are provided, and `dev` / `build` / `preview` scripts map to `zntc dev` / `zntc build` / `zntc preview`.
29
51
 
30
- Modes:
31
- react-native Overlay ZNTC onto an existing React Native CLI project
32
- vite Overlay ZNTC onto an existing Vite project (@zntc/vite-plugin)
33
- rspack Overlay ZNTC onto an existing Rspack/Webpack project (@zntc/rspack-loader)
34
- web Scaffold a standalone ZNTC web project (no Vite/Rspack)
52
+ ### Options
35
53
 
54
+ ```text
36
55
  Common options:
37
56
  --root <dir> Project root (default: cwd)
38
57
  --zntc-version <range> Version range for @zntc packages (default: latest)
39
58
  --package-manager <pm> Install command hint: bun, npm, pnpm, or yarn
40
59
  --force Overwrite existing files where the mode allows
41
60
  --dry-run Print planned changes without writing files
42
- --help, -h Show this help message
61
+ --help, -h Show the help message
43
62
 
44
63
  react-native options:
45
64
  --platform <ios|android> Default platform for the start script (default: ios)
@@ -53,29 +72,12 @@ web options:
53
72
  --framework <react|vanilla> Starter template (default: react)
54
73
  ```
55
74
 
56
- ## Overlay vs scaffold
57
-
58
- - **Overlay** (`react-native` / `vite` / `rspack`): 기존 `package.json` 과 빌드 도구 config 를 손대서 ZNTC 로 transform 을 위임한다.
59
- - `package.json` 에 `@zntc/core` + 모드별 패키지를 `devDependencies` 로 추가
60
- - 빌드 도구 config 가 **존재하지 않으면** ZNTC 기본 템플릿 생성
61
- - 빌드 도구 config 가 **이미 존재하면** 덮어쓰지 않고 `manual` 안내 스니펫을 출력 (사용자가 직접 합치도록). `--force` 로 덮어쓰기.
62
- - **Scaffold** (`web`): 빈 디렉토리에 `package.json` / `tsconfig.json` / `zntc.config.ts` / `index.html` / `src/*` 까지 새로 만든다.
63
- - `package.json` 이 이미 있으면 거부. `--force` 로 덮어쓰기.
64
-
65
- 모든 모드 공통으로 `--dry-run` 은 파일 변경 없이 plan 만 출력한다.
66
-
67
- ## react-native 모드
68
-
69
- 기존 React Native CLI 프로젝트에 ZNTC dev server / bundler 를 얹는다. Metro fallback scripts (`start:metro`, `bundle:metro:*`) 기본 추가. Expo 는 의도적으로 미지원.
70
-
71
- ## vite 모드
72
-
73
- 기존 Vite 프로젝트에 [`@zntc/vite-plugin`](../vite-plugin) 을 등록한다 (`esbuild: false`). Vite 의 dev server / HMR / plugin 생태계는 그대로 유지.
74
-
75
- ## rspack 모드
75
+ ## Documentation
76
76
 
77
- 기존 Rspack / Webpack 프로젝트에 [`@zntc/rspack-loader`](../rspack-loader) 등록한다. `package.json` 에 `@rspack/core` 또는 `webpack` 이 있으면 자동 감지. 명시는 `--bundler rspack|webpack` 으로.
77
+ - Monorepo: <https://github.com/ohah/zntc>
78
+ - Official docs: <https://ohah.github.io/zntc>
79
+ - React Native guide: <https://ohah.github.io/zntc/guides/react-native/>
78
80
 
79
- ## web 모드
81
+ ## License
80
82
 
81
- Vite / Rspack 없이 ZNTC 자체 dev server (`@zntc/web`) + bundler 만으로 동작하는 web 프로젝트를 만든다. React / vanilla 템플릿 제공. `bun run dev` → `zntc dev`, `bun run build` → `zntc build`, `bun run preview` → `zntc preview`.
83
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zntc/init",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "ZNTC project initializer and React Native CLI overlay",
5
5
  "keywords": [
6
6
  "create",