@jogak/core 0.1.0-alpha.4 → 0.1.0-alpha.6
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/dist/index.js +1 -1
- package/dist/index.mjs +200 -158
- package/dist/registry.d.ts +3 -0
- package/dist/types.d.ts +54 -0
- package/dist/vite/detect-global-css.d.ts +33 -0
- package/dist/vite/index.js +14 -9
- package/dist/vite/index.mjs +201 -163
- package/dist/vite/virtual-ids.d.ts +3 -0
- package/package.json +5 -2
package/dist/vite/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { resolve as
|
|
2
|
-
import { existsSync as
|
|
3
|
-
import { stat as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { resolve as y, join as $, dirname as K } from "node:path";
|
|
2
|
+
import { existsSync as b, readFileSync as W } from "node:fs";
|
|
3
|
+
import { stat as M, rm as X, readdir as Y, readFile as L } from "node:fs/promises";
|
|
4
|
+
import { c as N } from "../extractor-client-CReBed7x.js";
|
|
5
|
+
const q = [
|
|
6
6
|
"@jogak/core",
|
|
7
7
|
"@jogak/react",
|
|
8
8
|
"@jogak/web-components",
|
|
@@ -10,175 +10,202 @@ const W = [
|
|
|
10
10
|
];
|
|
11
11
|
async function P(t) {
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
return
|
|
13
|
+
const n = await M(t);
|
|
14
|
+
if (!n.isDirectory())
|
|
15
|
+
return n.mtimeMs;
|
|
16
16
|
} catch {
|
|
17
17
|
return 0;
|
|
18
18
|
}
|
|
19
|
-
let
|
|
19
|
+
let r = 0, s;
|
|
20
20
|
try {
|
|
21
|
-
|
|
21
|
+
s = await Y(t);
|
|
22
22
|
} catch {
|
|
23
23
|
return 0;
|
|
24
24
|
}
|
|
25
|
-
for (const
|
|
26
|
-
const
|
|
25
|
+
for (const n of s) {
|
|
26
|
+
const g = $(t, n);
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const p = await P(
|
|
31
|
-
p >
|
|
32
|
-
} else
|
|
28
|
+
const l = await M(g);
|
|
29
|
+
if (l.isDirectory()) {
|
|
30
|
+
const p = await P(g);
|
|
31
|
+
p > r && (r = p);
|
|
32
|
+
} else l.mtimeMs > r && (r = l.mtimeMs);
|
|
33
33
|
} catch {
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return r;
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
39
|
+
async function H(t) {
|
|
40
|
+
const r = y(t.root, "node_modules/.vite/deps");
|
|
41
|
+
if (!b(r))
|
|
42
42
|
return { purged: !1 };
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const s = $(r, "_metadata.json");
|
|
44
|
+
if (!b(s))
|
|
45
45
|
return { purged: !1 };
|
|
46
|
-
let
|
|
46
|
+
let n;
|
|
47
47
|
try {
|
|
48
|
-
|
|
49
|
-
} catch (
|
|
48
|
+
n = (await M(s)).mtimeMs;
|
|
49
|
+
} catch (l) {
|
|
50
50
|
return t.logger.warn(
|
|
51
|
-
`[jogak] cache validation: failed to stat _metadata.json (${
|
|
51
|
+
`[jogak] cache validation: failed to stat _metadata.json (${l.message})`
|
|
52
52
|
), { purged: !1 };
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
for (const
|
|
56
|
-
const p =
|
|
57
|
-
if (!
|
|
58
|
-
let
|
|
54
|
+
const g = t.packages ?? q;
|
|
55
|
+
for (const l of g) {
|
|
56
|
+
const p = y(t.root, "node_modules", l, "dist");
|
|
57
|
+
if (!b(p)) continue;
|
|
58
|
+
let h;
|
|
59
59
|
try {
|
|
60
|
-
|
|
61
|
-
} catch (
|
|
60
|
+
h = await P(p);
|
|
61
|
+
} catch (a) {
|
|
62
62
|
t.logger.warn(
|
|
63
|
-
`[jogak] cache validation: failed to walk ${
|
|
63
|
+
`[jogak] cache validation: failed to walk ${l}/dist (${a.message})`
|
|
64
64
|
);
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (h > n + 1e3)
|
|
68
68
|
try {
|
|
69
|
-
return await
|
|
70
|
-
`[jogak] vite deps cache invalidated (stale): ${
|
|
71
|
-
), { purged: !0, reason:
|
|
72
|
-
} catch (
|
|
69
|
+
return await X(r, { recursive: !0, force: !0 }), t.logger.info(
|
|
70
|
+
`[jogak] vite deps cache invalidated (stale): ${l} dist newer than cache`
|
|
71
|
+
), { purged: !0, reason: l };
|
|
72
|
+
} catch (a) {
|
|
73
73
|
return t.logger.warn(
|
|
74
|
-
`[jogak] cache validation: failed to purge ${
|
|
74
|
+
`[jogak] cache validation: failed to purge ${r} (${a.message})`
|
|
75
75
|
), { purged: !1 };
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return { purged: !1 };
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
const z = [
|
|
81
|
+
"src/index.css",
|
|
82
|
+
"src/main.css",
|
|
83
|
+
"src/styles.css",
|
|
84
|
+
"src/styles/globals.css",
|
|
85
|
+
"src/styles/index.css",
|
|
86
|
+
"src/app/globals.css",
|
|
87
|
+
"src/global.css",
|
|
88
|
+
"src/app.css"
|
|
89
|
+
];
|
|
90
|
+
function Q(t) {
|
|
91
|
+
for (const r of z) {
|
|
92
|
+
const s = y(t, r);
|
|
93
|
+
if (b(s)) return [s];
|
|
94
|
+
}
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
function Z(t, r) {
|
|
98
|
+
if (t === void 0 || t === !1) return [];
|
|
99
|
+
if (t === !0) return Q(r);
|
|
100
|
+
if (typeof t == "string")
|
|
101
|
+
return t.length > 0 ? [y(r, t)] : [];
|
|
102
|
+
const s = [];
|
|
103
|
+
for (const n of t)
|
|
104
|
+
typeof n == "string" && n.length > 0 && s.push(y(r, n));
|
|
105
|
+
return s;
|
|
106
|
+
}
|
|
107
|
+
function tt(t) {
|
|
81
108
|
return t.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/.*$/gm, "");
|
|
82
109
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
110
|
+
function et(t) {
|
|
111
|
+
if (b(t))
|
|
85
112
|
try {
|
|
86
|
-
const
|
|
87
|
-
return JSON.parse(
|
|
113
|
+
const r = W(t, "utf8");
|
|
114
|
+
return JSON.parse(tt(r));
|
|
88
115
|
} catch {
|
|
89
116
|
return;
|
|
90
117
|
}
|
|
91
118
|
}
|
|
92
|
-
function
|
|
93
|
-
if (!t.endsWith("/*") || !
|
|
94
|
-
const
|
|
95
|
-
return [
|
|
119
|
+
function rt(t, r, s) {
|
|
120
|
+
if (!t.endsWith("/*") || !r.endsWith("/*")) return;
|
|
121
|
+
const n = t.slice(0, -2), g = y(s, r.slice(0, -2));
|
|
122
|
+
return [n, g];
|
|
96
123
|
}
|
|
97
|
-
function
|
|
98
|
-
var
|
|
99
|
-
const
|
|
124
|
+
function ot(t, r) {
|
|
125
|
+
var g, l;
|
|
126
|
+
const s = {}, n = /* @__PURE__ */ new Set([
|
|
100
127
|
t,
|
|
101
|
-
|
|
128
|
+
y(r, "tsconfig.app.json")
|
|
102
129
|
]);
|
|
103
|
-
for (const p of
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
for (const [_,
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const [
|
|
115
|
-
|
|
130
|
+
for (const p of n) {
|
|
131
|
+
const h = et(p);
|
|
132
|
+
if (h === void 0) continue;
|
|
133
|
+
const a = (g = h.compilerOptions) == null ? void 0 : g.paths;
|
|
134
|
+
if (a === void 0) continue;
|
|
135
|
+
const m = ((l = h.compilerOptions) == null ? void 0 : l.baseUrl) ?? ".", j = y(K(p), m);
|
|
136
|
+
for (const [_, C] of Object.entries(a)) {
|
|
137
|
+
const k = C[0];
|
|
138
|
+
if (k === void 0) continue;
|
|
139
|
+
const T = rt(_, k, j);
|
|
140
|
+
if (T === void 0) continue;
|
|
141
|
+
const [e, u] = T;
|
|
142
|
+
s[e] === void 0 && (s[e] = u);
|
|
116
143
|
}
|
|
117
144
|
}
|
|
118
|
-
return
|
|
145
|
+
return s;
|
|
119
146
|
}
|
|
120
|
-
const
|
|
121
|
-
function
|
|
147
|
+
const F = "virtual:jogak", x = "\0" + F, G = "virtual:jogak/entry/", I = "\0" + G, U = "virtual:jogak/global-css", R = "\0" + U;
|
|
148
|
+
function st(t) {
|
|
122
149
|
return Buffer.from(t, "utf8").toString("base64url");
|
|
123
150
|
}
|
|
124
|
-
function
|
|
151
|
+
function at(t) {
|
|
125
152
|
return Buffer.from(t, "base64url").toString("utf8");
|
|
126
153
|
}
|
|
127
|
-
function
|
|
154
|
+
function D(t) {
|
|
128
155
|
return {
|
|
129
156
|
title: t.title,
|
|
130
157
|
jogakNamesKey: [...t.jogakNames].sort().join("|")
|
|
131
158
|
};
|
|
132
159
|
}
|
|
133
|
-
function
|
|
134
|
-
return t !== void 0 && t.title ===
|
|
160
|
+
function nt(t, r) {
|
|
161
|
+
return t !== void 0 && t.title === r.title && t.jogakNamesKey === r.jogakNamesKey;
|
|
135
162
|
}
|
|
136
|
-
function
|
|
163
|
+
function ft(t = {}) {
|
|
137
164
|
const {
|
|
138
|
-
patterns:
|
|
139
|
-
codeTheme:
|
|
140
|
-
} = t,
|
|
141
|
-
let
|
|
142
|
-
const
|
|
143
|
-
async function
|
|
144
|
-
const { glob: e } = await import("glob"),
|
|
145
|
-
|
|
146
|
-
for (const
|
|
147
|
-
let
|
|
165
|
+
patterns: r = ["src/**/*.jogak.ts", "src/**/*.jogak.tsx"],
|
|
166
|
+
codeTheme: s = "vsDark"
|
|
167
|
+
} = t, n = t.cwd, g = t.tsConfigFilePath, l = t.disableCacheValidation === !0, p = t.resolveAlias, h = t.globalCss;
|
|
168
|
+
let a, m, j;
|
|
169
|
+
const _ = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
|
|
170
|
+
async function T() {
|
|
171
|
+
const { glob: e } = await import("glob"), u = j ?? process.cwd(), o = (await e(r, { cwd: u, absolute: !0 })).sort(), d = [];
|
|
172
|
+
_.clear(), C.clear();
|
|
173
|
+
for (const i of o) {
|
|
174
|
+
let v = "";
|
|
148
175
|
try {
|
|
149
|
-
|
|
176
|
+
v = await L(i, "utf8");
|
|
150
177
|
} catch {
|
|
151
178
|
continue;
|
|
152
179
|
}
|
|
153
|
-
let
|
|
154
|
-
if (
|
|
180
|
+
let w = {}, c = null;
|
|
181
|
+
if (m !== void 0) {
|
|
155
182
|
try {
|
|
156
|
-
|
|
183
|
+
w = await m.extract(i);
|
|
157
184
|
} catch {
|
|
158
|
-
|
|
185
|
+
w = {};
|
|
159
186
|
}
|
|
160
187
|
try {
|
|
161
|
-
|
|
188
|
+
c = await m.extractMeta(i);
|
|
162
189
|
} catch {
|
|
163
|
-
|
|
190
|
+
c = null;
|
|
164
191
|
}
|
|
165
192
|
}
|
|
166
|
-
if (
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
id:
|
|
171
|
-
title:
|
|
172
|
-
jogakNames:
|
|
173
|
-
autoArgTypes:
|
|
174
|
-
userArgTypes:
|
|
175
|
-
source:
|
|
176
|
-
filePath:
|
|
177
|
-
metaExtras:
|
|
193
|
+
if (c === null) continue;
|
|
194
|
+
const f = c.title;
|
|
195
|
+
_.set(f, i), C.set(i, f);
|
|
196
|
+
const S = {
|
|
197
|
+
id: f,
|
|
198
|
+
title: c.title,
|
|
199
|
+
jogakNames: c.jogakNames,
|
|
200
|
+
autoArgTypes: w,
|
|
201
|
+
userArgTypes: c.userArgTypes,
|
|
202
|
+
source: v,
|
|
203
|
+
filePath: i,
|
|
204
|
+
metaExtras: c.metaExtras
|
|
178
205
|
};
|
|
179
|
-
|
|
206
|
+
k.set(i, D(S)), d.push({ id: f, filePath: i, meta: S });
|
|
180
207
|
}
|
|
181
|
-
return
|
|
208
|
+
return d;
|
|
182
209
|
}
|
|
183
210
|
return {
|
|
184
211
|
name: "vite-plugin-jogak",
|
|
@@ -193,65 +220,76 @@ function it(t = {}) {
|
|
|
193
220
|
* 우선순위: `options.resolveAlias` (명시) > tsconfig 자동 추출.
|
|
194
221
|
*/
|
|
195
222
|
config() {
|
|
196
|
-
const e =
|
|
223
|
+
const e = n ?? process.cwd(), u = g ?? y(e, "tsconfig.json"), o = ot(u, e), d = {};
|
|
197
224
|
if (p !== void 0)
|
|
198
|
-
for (const [
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
if (Object.keys(
|
|
225
|
+
for (const [v, w] of Object.entries(p))
|
|
226
|
+
d[v] = y(e, w);
|
|
227
|
+
const i = { ...o, ...d };
|
|
228
|
+
if (Object.keys(i).length !== 0)
|
|
202
229
|
return {
|
|
203
|
-
resolve: { alias:
|
|
230
|
+
resolve: { alias: i }
|
|
204
231
|
};
|
|
205
232
|
},
|
|
206
233
|
async configResolved(e) {
|
|
207
|
-
|
|
234
|
+
j = n ?? e.root, e.command === "serve" && !l && await H({
|
|
208
235
|
root: e.root,
|
|
209
236
|
logger: {
|
|
210
|
-
info: (
|
|
211
|
-
warn: (
|
|
237
|
+
info: (o) => e.logger.info(o),
|
|
238
|
+
warn: (o) => e.logger.warn(o)
|
|
212
239
|
}
|
|
213
240
|
});
|
|
214
|
-
const
|
|
215
|
-
|
|
241
|
+
const u = g ?? y(j, "tsconfig.json");
|
|
242
|
+
m = b(u) ? N({ tsConfigFilePath: u }) : N();
|
|
216
243
|
},
|
|
217
244
|
configureServer(e) {
|
|
218
|
-
|
|
245
|
+
a = e;
|
|
219
246
|
},
|
|
220
247
|
buildEnd() {
|
|
221
|
-
|
|
248
|
+
m == null || m.releaseCache();
|
|
222
249
|
},
|
|
223
250
|
resolveId(e) {
|
|
224
|
-
if (e ===
|
|
251
|
+
if (e === F)
|
|
225
252
|
return x;
|
|
226
|
-
if (e
|
|
253
|
+
if (e === U)
|
|
254
|
+
return R;
|
|
255
|
+
if (e.startsWith(G))
|
|
227
256
|
return "\0" + e;
|
|
228
257
|
},
|
|
229
258
|
async load(e) {
|
|
259
|
+
if (e === R) {
|
|
260
|
+
const u = j ?? process.cwd(), o = Z(h, u);
|
|
261
|
+
return o.length === 0 ? `// [jogak] globalCss not configured or no candidates found.
|
|
262
|
+
export {}
|
|
263
|
+
` : `${o.map((i) => `import ${JSON.stringify(i)}`).join(`
|
|
264
|
+
`)}
|
|
265
|
+
export {}
|
|
266
|
+
`;
|
|
267
|
+
}
|
|
230
268
|
if (e === x) {
|
|
231
|
-
const
|
|
269
|
+
const o = (await T()).map((d) => d.meta);
|
|
232
270
|
return `import { defaultRegistry } from '@jogak/core'
|
|
233
271
|
|
|
234
272
|
const _entryLoader = (slug) =>
|
|
235
273
|
import(/* @vite-ignore */ '/@id/__x00__virtual:jogak/entry/' + slug)
|
|
236
274
|
defaultRegistry.setEntryLoader((id) => {
|
|
237
|
-
const slug = ${
|
|
275
|
+
const slug = ${it()}
|
|
238
276
|
return _entryLoader(slug(id))
|
|
239
277
|
})
|
|
240
278
|
|
|
241
|
-
const _metas = ${JSON.stringify(
|
|
279
|
+
const _metas = ${JSON.stringify(o)}
|
|
242
280
|
|
|
243
281
|
for (const m of _metas) defaultRegistry.registerMeta(m)
|
|
244
282
|
|
|
245
|
-
export const _jogakCodeTheme = ${JSON.stringify(
|
|
283
|
+
export const _jogakCodeTheme = ${JSON.stringify(s)}
|
|
246
284
|
export const _jogakMetas = _metas
|
|
247
285
|
`;
|
|
248
286
|
}
|
|
249
|
-
if (e.startsWith(
|
|
250
|
-
const
|
|
251
|
-
let
|
|
252
|
-
return
|
|
287
|
+
if (e.startsWith(I)) {
|
|
288
|
+
const u = e.slice(I.length), o = at(u);
|
|
289
|
+
let d = _.get(o);
|
|
290
|
+
return d === void 0 && (await T(), d = _.get(o)), d === void 0 ? `// [jogak] unknown entry id: ${JSON.stringify(o)}
|
|
253
291
|
export {}
|
|
254
|
-
` : `import * as _user from ${JSON.stringify(
|
|
292
|
+
` : `import * as _user from ${JSON.stringify(d)}
|
|
255
293
|
import { defaultRegistry } from '@jogak/core'
|
|
256
294
|
|
|
257
295
|
const _meta = _user.default
|
|
@@ -260,7 +298,7 @@ delete _named.default
|
|
|
260
298
|
const _jogaks = Object.values(_named).filter(
|
|
261
299
|
(v) => v !== null && typeof v === 'object' && typeof v.name === 'string'
|
|
262
300
|
)
|
|
263
|
-
defaultRegistry.hydrateEntry(${JSON.stringify(
|
|
301
|
+
defaultRegistry.hydrateEntry(${JSON.stringify(o)}, _jogaks, _meta?.component)
|
|
264
302
|
|
|
265
303
|
if (import.meta.hot) {
|
|
266
304
|
import.meta.hot.accept()
|
|
@@ -270,60 +308,60 @@ export {}
|
|
|
270
308
|
`;
|
|
271
309
|
}
|
|
272
310
|
},
|
|
273
|
-
async handleHotUpdate({ file: e, modules:
|
|
274
|
-
const
|
|
275
|
-
if (!
|
|
276
|
-
const
|
|
311
|
+
async handleHotUpdate({ file: e, modules: u }) {
|
|
312
|
+
const o = /\.jogak\.(tsx?|jsx?)$/.test(e), d = /\.(tsx?|jsx?)$/.test(e) && !o;
|
|
313
|
+
if (!o && !d || a === void 0 || !o) return;
|
|
314
|
+
const i = a.moduleGraph.getModuleById(
|
|
277
315
|
x
|
|
278
|
-
),
|
|
279
|
-
let
|
|
280
|
-
if (
|
|
316
|
+
), v = C.get(e), w = v !== void 0 ? I + st(v) : void 0, c = w !== void 0 ? a.moduleGraph.getModuleById(w) : void 0;
|
|
317
|
+
let f = null, S = {}, A = "";
|
|
318
|
+
if (m !== void 0) {
|
|
281
319
|
try {
|
|
282
|
-
|
|
320
|
+
f = await m.extractMeta(e);
|
|
283
321
|
} catch {
|
|
284
|
-
|
|
322
|
+
f = null;
|
|
285
323
|
}
|
|
286
324
|
try {
|
|
287
|
-
|
|
325
|
+
S = await m.extract(e);
|
|
288
326
|
} catch {
|
|
289
|
-
|
|
327
|
+
S = {};
|
|
290
328
|
}
|
|
291
329
|
try {
|
|
292
|
-
|
|
330
|
+
A = await L(e, "utf8");
|
|
293
331
|
} catch {
|
|
294
|
-
|
|
332
|
+
A = "";
|
|
295
333
|
}
|
|
296
334
|
}
|
|
297
|
-
if (
|
|
298
|
-
|
|
335
|
+
if (f === null) {
|
|
336
|
+
i !== void 0 && a.moduleGraph.invalidateModule(i), c !== void 0 && a.moduleGraph.invalidateModule(c), a.ws.send({ type: "full-reload" });
|
|
299
337
|
return;
|
|
300
338
|
}
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
|
|
339
|
+
const O = D(f), V = k.get(e), B = nt(V, O);
|
|
340
|
+
if (k.set(e, O), !B || v === void 0) {
|
|
341
|
+
i !== void 0 && a.moduleGraph.invalidateModule(i), c !== void 0 && a.moduleGraph.invalidateModule(c), a.ws.send({ type: "full-reload" });
|
|
304
342
|
return;
|
|
305
343
|
}
|
|
306
|
-
const
|
|
307
|
-
id:
|
|
308
|
-
title:
|
|
309
|
-
jogakNames:
|
|
310
|
-
autoArgTypes:
|
|
311
|
-
userArgTypes:
|
|
312
|
-
source:
|
|
344
|
+
const J = {
|
|
345
|
+
id: v,
|
|
346
|
+
title: f.title,
|
|
347
|
+
jogakNames: f.jogakNames,
|
|
348
|
+
autoArgTypes: S,
|
|
349
|
+
userArgTypes: f.userArgTypes,
|
|
350
|
+
source: A,
|
|
313
351
|
filePath: e,
|
|
314
|
-
metaExtras:
|
|
352
|
+
metaExtras: f.metaExtras
|
|
315
353
|
};
|
|
316
|
-
|
|
354
|
+
c !== void 0 && a.moduleGraph.invalidateModule(c), a.ws.send({
|
|
317
355
|
type: "custom",
|
|
318
356
|
event: "jogak:meta-update",
|
|
319
|
-
data: { id:
|
|
357
|
+
data: { id: v, meta: J }
|
|
320
358
|
});
|
|
321
|
-
const
|
|
322
|
-
return
|
|
359
|
+
const E = [...u];
|
|
360
|
+
return c !== void 0 && !E.includes(c) && E.push(c), E;
|
|
323
361
|
}
|
|
324
362
|
};
|
|
325
363
|
}
|
|
326
|
-
function
|
|
364
|
+
function it() {
|
|
327
365
|
return `(rawId) => {
|
|
328
366
|
if (typeof Buffer !== 'undefined') return Buffer.from(rawId, 'utf8').toString('base64url')
|
|
329
367
|
// 브라우저 폴백: btoa는 binary string 기준이라 UTF-8을 한번 인코딩해야 한다.
|
|
@@ -334,5 +372,5 @@ function et() {
|
|
|
334
372
|
}`;
|
|
335
373
|
}
|
|
336
374
|
export {
|
|
337
|
-
|
|
375
|
+
ft as jogak
|
|
338
376
|
};
|
|
@@ -15,5 +15,8 @@ export declare const RESOLVED_VIRTUAL_INDEX_ID: string;
|
|
|
15
15
|
/** Entry 모듈 prefix — 뒤에 base64url(id)이 붙는다. */
|
|
16
16
|
export declare const VIRTUAL_ENTRY_PREFIX = "virtual:jogak/entry/";
|
|
17
17
|
export declare const RESOLVED_VIRTUAL_ENTRY_PREFIX: string;
|
|
18
|
+
/** Global css 모듈 — 사용자 globalCss를 import한다 (알파.6, opt-in). */
|
|
19
|
+
export declare const VIRTUAL_GLOBAL_CSS_ID = "virtual:jogak/global-css";
|
|
20
|
+
export declare const RESOLVED_VIRTUAL_GLOBAL_CSS_ID: string;
|
|
18
21
|
export declare function idToSlug(id: string): string;
|
|
19
22
|
export declare function slugToId(slug: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jogak/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"description": "Core types, registry, and Vite plugin for Jogak — a lightweight Storybook alternative.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jogak",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"vite": "^6.0.0",
|
|
65
65
|
"vite-plugin-dts": "^4.0.0",
|
|
66
|
+
"vitest": "^2.0.0",
|
|
66
67
|
"typescript": "^5.5.0",
|
|
67
68
|
"@types/node": "^20.14.0"
|
|
68
69
|
},
|
|
@@ -77,6 +78,8 @@
|
|
|
77
78
|
"scripts": {
|
|
78
79
|
"build": "vite build",
|
|
79
80
|
"dev": "vite build --watch",
|
|
80
|
-
"typecheck": "tsc --noEmit"
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"test": "vitest run",
|
|
83
|
+
"test:watch": "vitest"
|
|
81
84
|
}
|
|
82
85
|
}
|