@bstage-sdk/cli 0.1.0 → 0.3.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.
@@ -28,6 +28,25 @@ interface BstageDevPluginOptions {
28
28
  */
29
29
  declare function bstageDevPlugin(options?: BstageDevPluginOptions): Plugin;
30
30
 
31
+ /**
32
+ * 앱 키 환경변수의 새 이름(`VITE_BSTAGE_APP_KEY`)과 옛 이름(`VITE_BSTAGE_APP_SECRET`)을 서로 이어 붙이는
33
+ * `define` 항목을 만든다.
34
+ *
35
+ * 별칭 기간에는 소스와 `.env`가 다른 이름을 쓰는 조합이 실제로 생긴다 — 기존 프로젝트의 `client.ts`는
36
+ * 옛 이름을 읽는데 포털의 환경변수 입력은 새 이름을 넣고, 반대로 새 스캐폴드에 옛 `.env`를 복사해
37
+ * 오기도 한다. Vite는 `import.meta.env.X`를 빌드 시점에 문자열로 치환하므로 이 조합은 번들에
38
+ * undefined가 박혀 배포 뒤 401로만 드러난다. 한쪽만 있으면 다른 이름으로도 같은 값이 읽히게 한다.
39
+ *
40
+ * - 둘 다 있으면 손대지 않는다(각자 실제 값). 둘 다 없으면 아무것도 정의하지 않는다(UI 전용 템플릿).
41
+ * - 값은 `JSON.stringify`로 감싼다 — define은 코드 조각 치환이라 따옴표가 없으면 식별자가 된다.
42
+ */
43
+ declare function appKeyEnvDefine(env: Record<string, string | undefined>): Record<string, string>;
44
+ /**
45
+ * `appKeyEnvDefine`을 Vite 설정에 얹는 플러그인. `bstage build`(프리셋)와 `bstageDevPlugin`(dev 서버)이
46
+ * 함께 쓴다.
47
+ */
48
+ declare function appKeyEnvAliasPlugin(): Plugin;
49
+
31
50
  interface VitePresetOptions {
32
51
  /** Entry file path (default: 'src/index.tsx') */
33
52
  entry?: string;
@@ -40,7 +59,8 @@ interface VitePresetOptions {
40
59
  *
41
60
  * `<script>` 태그로 로드 가능한 IIFE 번들(`template.js`)을 출력.
42
61
  * React를 번들에 포함(외부화하지 않음). CSS는 Shadow DOM 주입을 위해 JS에 인라인.
62
+ * 앱 키 env 별칭(`appKeyEnvAliasPlugin`)을 얹어 옛 이름·새 이름 어느 쪽 `.env`든 번들에 실리게 한다.
43
63
  */
44
64
  declare function createViteConfig(options?: VitePresetOptions): UserConfig;
45
65
 
46
- export { type BstageDevPluginOptions, type VitePresetOptions, bstageDevPlugin, createViteConfig };
66
+ export { type BstageDevPluginOptions, type VitePresetOptions, appKeyEnvAliasPlugin, appKeyEnvDefine, bstageDevPlugin, createViteConfig };
@@ -1,8 +1,12 @@
1
1
  import {
2
+ appKeyEnvAliasPlugin,
3
+ appKeyEnvDefine,
2
4
  bstageDevPlugin,
3
5
  createViteConfig
4
- } from "../chunk-S6HGR2U3.js";
6
+ } from "../chunk-COUDGZIA.js";
5
7
  export {
8
+ appKeyEnvAliasPlugin,
9
+ appKeyEnvDefine,
6
10
  bstageDevPlugin,
7
11
  createViteConfig
8
12
  };
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@bstage-sdk/cli",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "bstage SDK CLI — build b.stage templates",
5
5
  "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
6
9
  "repository": {
7
10
  "type": "git",
8
11
  "url": "https://github.com/bstage-sdk/web-sdk.git",
@@ -28,18 +31,15 @@
28
31
  "commander": "^12.0.0",
29
32
  "picocolors": "^1.1.1",
30
33
  "vite": "^7.0.0",
31
- "@bstage-sdk/core": "0.1.0"
34
+ "@bstage-sdk/core": "0.3.0"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@types/node": "^25.5.0",
35
38
  "tsup": "^8.0.0",
36
39
  "typescript": "^5.5.0",
37
- "@bstage-sdk/design": "0.1.0"
40
+ "@bstage-sdk/design": "0.3.0"
38
41
  },
39
42
  "license": "MIT",
40
- "publishConfig": {
41
- "access": "public"
42
- },
43
43
  "scripts": {
44
44
  "build": "tsup && cp ../../docs/MIGRATION.md dist/MIGRATION.md",
45
45
  "typecheck": "tsc --noEmit"