@bstage-sdk/host 0.14.0 → 0.14.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/dist/index.cjs CHANGED
@@ -44,7 +44,11 @@ function loadScript(url, timeoutMs = 1e4, crossOrigin) {
44
44
  const timer = setTimeout(() => {
45
45
  cleanup();
46
46
  cache.delete(url);
47
- reject(new Error(`Script load timed out after ${timeoutMs}ms: ${url}`));
47
+ reject(
48
+ new Error(
49
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC744 ${timeoutMs}ms \uC548\uC5D0 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${url}. \uB124\uD2B8\uC6CC\uD06C \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uAC70\uB098 timeout \uC635\uC158\uC744 \uB298\uB9AC\uC138\uC694.`
50
+ )
51
+ );
48
52
  }, timeoutMs);
49
53
  const cleanup = () => {
50
54
  clearTimeout(timer);
@@ -58,7 +62,11 @@ function loadScript(url, timeoutMs = 1e4, crossOrigin) {
58
62
  const onError = () => {
59
63
  cleanup();
60
64
  cache.delete(url);
61
- reject(new Error(`Failed to load script: ${url}`));
65
+ reject(
66
+ new Error(
67
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${url}. URL\uC774 \uB9DE\uB294\uC9C0, \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C \uC5F4\uB9AC\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694.`
68
+ )
69
+ );
62
70
  };
63
71
  script.addEventListener("load", onLoad);
64
72
  script.addEventListener("error", onError);
@@ -86,7 +94,9 @@ var TemplateHandle = class _TemplateHandle {
86
94
  */
87
95
  mount(container) {
88
96
  if (this.element) {
89
- throw new Error(`Template "${this.info.elementName}" is already mounted`);
97
+ throw new Error(
98
+ `[bstage-host] \uD15C\uD50C\uB9BF "${this.info.elementName}"\uC774(\uAC00) \uC774\uBBF8 \uB9C8\uC6B4\uD2B8\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uB9C8\uC6B4\uD2B8\uD558\uB824\uBA74 \uBA3C\uC800 unmount()\uB97C \uD638\uCD9C\uD558\uC138\uC694.`
99
+ );
90
100
  }
91
101
  this.container = container;
92
102
  this.element = document.createElement(this.info.elementName);
@@ -165,7 +175,9 @@ var TemplateHandle = class _TemplateHandle {
165
175
  */
166
176
  dispatch(type, payload) {
167
177
  if (!this.element) {
168
- throw new Error(`Template "${this.info.elementName}" is not mounted`);
178
+ throw new Error(
179
+ `[bstage-host] \uD15C\uD50C\uB9BF "${this.info.elementName}"\uC774(\uAC00) \uB9C8\uC6B4\uD2B8\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 mount()\uB97C \uD638\uCD9C\uD558\uC138\uC694.`
180
+ );
169
181
  }
170
182
  const eventType = `bstage:${type}`;
171
183
  if (!this._templateReady) {
@@ -189,7 +201,7 @@ async function loadTemplate(templateUrl, options) {
189
201
  const elementName = (0, import_core.lookupElementName)(templateUrl) ?? recoverLegacyElementName(templateUrl);
190
202
  if (!elementName) {
191
203
  throw new Error(
192
- `Template bundle registered no custom element: ${templateUrl}. Rebuild the template with a current @bstage-sdk/cli.`
204
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC774 Custom Element\uB97C \uB4F1\uB85D\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4: ${templateUrl}. \uCD5C\uC2E0 @bstage-sdk/cli\uB85C \uD15C\uD50C\uB9BF\uC744 \uB2E4\uC2DC \uBE4C\uB4DC\uD558\uC138\uC694.`
193
205
  );
194
206
  }
195
207
  return new TemplateHandle({ elementName });
@@ -218,7 +230,7 @@ async function loadTemplatesBySlots(customSlots, options) {
218
230
  const { slot } = tasks[i];
219
231
  const outcome = settled[i];
220
232
  if (outcome.status === "rejected") {
221
- console.warn(`[bstage-host] Failed to load template for slot "${slot}":`, outcome.reason);
233
+ console.warn(`[bstage-host] \uC2AC\uB86F "${slot}"\uC758 \uD15C\uD50C\uB9BF\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4:`, outcome.reason);
222
234
  continue;
223
235
  }
224
236
  const handles = result.get(slot) ?? [];
package/dist/index.js CHANGED
@@ -14,7 +14,11 @@ function loadScript(url, timeoutMs = 1e4, crossOrigin) {
14
14
  const timer = setTimeout(() => {
15
15
  cleanup();
16
16
  cache.delete(url);
17
- reject(new Error(`Script load timed out after ${timeoutMs}ms: ${url}`));
17
+ reject(
18
+ new Error(
19
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC744 ${timeoutMs}ms \uC548\uC5D0 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${url}. \uB124\uD2B8\uC6CC\uD06C \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uAC70\uB098 timeout \uC635\uC158\uC744 \uB298\uB9AC\uC138\uC694.`
20
+ )
21
+ );
18
22
  }, timeoutMs);
19
23
  const cleanup = () => {
20
24
  clearTimeout(timer);
@@ -28,7 +32,11 @@ function loadScript(url, timeoutMs = 1e4, crossOrigin) {
28
32
  const onError = () => {
29
33
  cleanup();
30
34
  cache.delete(url);
31
- reject(new Error(`Failed to load script: ${url}`));
35
+ reject(
36
+ new Error(
37
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${url}. URL\uC774 \uB9DE\uB294\uC9C0, \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C \uC5F4\uB9AC\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694.`
38
+ )
39
+ );
32
40
  };
33
41
  script.addEventListener("load", onLoad);
34
42
  script.addEventListener("error", onError);
@@ -56,7 +64,9 @@ var TemplateHandle = class _TemplateHandle {
56
64
  */
57
65
  mount(container) {
58
66
  if (this.element) {
59
- throw new Error(`Template "${this.info.elementName}" is already mounted`);
67
+ throw new Error(
68
+ `[bstage-host] \uD15C\uD50C\uB9BF "${this.info.elementName}"\uC774(\uAC00) \uC774\uBBF8 \uB9C8\uC6B4\uD2B8\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uB9C8\uC6B4\uD2B8\uD558\uB824\uBA74 \uBA3C\uC800 unmount()\uB97C \uD638\uCD9C\uD558\uC138\uC694.`
69
+ );
60
70
  }
61
71
  this.container = container;
62
72
  this.element = document.createElement(this.info.elementName);
@@ -135,7 +145,9 @@ var TemplateHandle = class _TemplateHandle {
135
145
  */
136
146
  dispatch(type, payload) {
137
147
  if (!this.element) {
138
- throw new Error(`Template "${this.info.elementName}" is not mounted`);
148
+ throw new Error(
149
+ `[bstage-host] \uD15C\uD50C\uB9BF "${this.info.elementName}"\uC774(\uAC00) \uB9C8\uC6B4\uD2B8\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 mount()\uB97C \uD638\uCD9C\uD558\uC138\uC694.`
150
+ );
139
151
  }
140
152
  const eventType = `bstage:${type}`;
141
153
  if (!this._templateReady) {
@@ -159,7 +171,7 @@ async function loadTemplate(templateUrl, options) {
159
171
  const elementName = lookupElementName(templateUrl) ?? recoverLegacyElementName(templateUrl);
160
172
  if (!elementName) {
161
173
  throw new Error(
162
- `Template bundle registered no custom element: ${templateUrl}. Rebuild the template with a current @bstage-sdk/cli.`
174
+ `[bstage-host] \uD15C\uD50C\uB9BF \uBC88\uB4E4\uC774 Custom Element\uB97C \uB4F1\uB85D\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4: ${templateUrl}. \uCD5C\uC2E0 @bstage-sdk/cli\uB85C \uD15C\uD50C\uB9BF\uC744 \uB2E4\uC2DC \uBE4C\uB4DC\uD558\uC138\uC694.`
163
175
  );
164
176
  }
165
177
  return new TemplateHandle({ elementName });
@@ -188,7 +200,7 @@ async function loadTemplatesBySlots(customSlots, options) {
188
200
  const { slot } = tasks[i];
189
201
  const outcome = settled[i];
190
202
  if (outcome.status === "rejected") {
191
- console.warn(`[bstage-host] Failed to load template for slot "${slot}":`, outcome.reason);
203
+ console.warn(`[bstage-host] \uC2AC\uB86F "${slot}"\uC758 \uD15C\uD50C\uB9BF\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4:`, outcome.reason);
192
204
  continue;
193
205
  }
194
206
  const handles = result.get(slot) ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bstage-sdk/host",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "bstage SDK host — load and manage template bundles on the platform side",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@bstage-sdk/core": "0.14.0"
33
+ "@bstage-sdk/core": "0.14.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "tsup": "^8.0.0",