@playcademy/vite-plugin 0.3.3-beta.2 → 0.3.3-beta.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.
- package/dist/hooks/shell-sdk.d.ts +12 -0
- package/dist/index.js +19 -14
- package/package.json +5 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual module for the dev shell's SDK import
|
|
3
|
+
*
|
|
4
|
+
* The dev shell (shell.html) needs MessageEvents and messaging from
|
|
5
|
+
* @playcademy/sdk. Rather than loading the SDK from a remote CDN via
|
|
6
|
+
* an importmap, we serve a virtual module that re-exports the needed
|
|
7
|
+
* symbols. Vite resolves @playcademy/sdk through normal node resolution,
|
|
8
|
+
* so the shell always uses the locally installed SDK — whether that's a
|
|
9
|
+
* workspace link or an npm-installed version.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveShellSdkId(id: string): string | undefined;
|
|
12
|
+
export declare function loadShellSdk(id: string): string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -23746,7 +23746,7 @@ import path from "node:path";
|
|
|
23746
23746
|
// package.json
|
|
23747
23747
|
var package_default = {
|
|
23748
23748
|
name: "@playcademy/vite-plugin",
|
|
23749
|
-
version: "0.3.3-beta.
|
|
23749
|
+
version: "0.3.3-beta.3",
|
|
23750
23750
|
type: "module",
|
|
23751
23751
|
exports: {
|
|
23752
23752
|
".": {
|
|
@@ -23779,6 +23779,7 @@ var package_default = {
|
|
|
23779
23779
|
"@types/bun": "1.3.5"
|
|
23780
23780
|
},
|
|
23781
23781
|
peerDependencies: {
|
|
23782
|
+
"@playcademy/sdk": ">=0.10.0",
|
|
23782
23783
|
typescript: "^5",
|
|
23783
23784
|
vite: "^5 || ^6"
|
|
23784
23785
|
}
|
|
@@ -25190,7 +25191,7 @@ var package_default2;
|
|
|
25190
25191
|
var init_package = __esm(() => {
|
|
25191
25192
|
package_default2 = {
|
|
25192
25193
|
name: "@playcademy/sandbox",
|
|
25193
|
-
version: "0.4.1-beta.
|
|
25194
|
+
version: "0.4.1-beta.3",
|
|
25194
25195
|
description: "Local development server for Playcademy game development",
|
|
25195
25196
|
type: "module",
|
|
25196
25197
|
exports: {
|
|
@@ -123470,14 +123471,6 @@ var shell_default = `<!doctype html>
|
|
|
123470
123471
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
123471
123472
|
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet" />
|
|
123472
123473
|
<script type="module" src="/@vite/client"></script>
|
|
123473
|
-
<script type="importmap">
|
|
123474
|
-
{
|
|
123475
|
-
"imports": {
|
|
123476
|
-
"@playcademy/sdk": "https://esm.sh/@playcademy/sdk@latest",
|
|
123477
|
-
"@playcademy/sdk-fallback": "https://cdn.playcademy.net/sdk/latest/index.js"
|
|
123478
|
-
}
|
|
123479
|
-
}
|
|
123480
|
-
</script>
|
|
123481
123474
|
<style>
|
|
123482
123475
|
* {
|
|
123483
123476
|
margin: 0;
|
|
@@ -123523,10 +123516,7 @@ var shell_default = `<!doctype html>
|
|
|
123523
123516
|
<iframe id="frame" class="hidden"></iframe>
|
|
123524
123517
|
|
|
123525
123518
|
<script type="module">
|
|
123526
|
-
const { MessageEvents, messaging } = await
|
|
123527
|
-
import('@playcademy/sdk'),
|
|
123528
|
-
import('@playcademy/sdk-fallback'),
|
|
123529
|
-
])
|
|
123519
|
+
const { MessageEvents, messaging } = await import('/@playcademy/shell-sdk')
|
|
123530
123520
|
|
|
123531
123521
|
const CONFIG = {
|
|
123532
123522
|
sandboxUrl: '{{SANDBOX_URL}}',
|
|
@@ -124144,6 +124134,19 @@ async function configureServerHook(server, context) {
|
|
|
124144
124134
|
}
|
|
124145
124135
|
}
|
|
124146
124136
|
|
|
124137
|
+
// src/hooks/shell-sdk.ts
|
|
124138
|
+
var SHELL_SDK_ID = "/@playcademy/shell-sdk";
|
|
124139
|
+
function resolveShellSdkId(id) {
|
|
124140
|
+
if (id === SHELL_SDK_ID) {
|
|
124141
|
+
return SHELL_SDK_ID;
|
|
124142
|
+
}
|
|
124143
|
+
}
|
|
124144
|
+
function loadShellSdk(id) {
|
|
124145
|
+
if (id === SHELL_SDK_ID) {
|
|
124146
|
+
return `export { MessageEvents, messaging } from '@playcademy/sdk'`;
|
|
124147
|
+
}
|
|
124148
|
+
}
|
|
124149
|
+
|
|
124147
124150
|
// src/hooks/transform-index-html.ts
|
|
124148
124151
|
var SERVER_TIMING_PATCH = '!function(){function p(P){var o=P.prototype.toJSON;if(o){P.prototype.toJSON=function(){var r=o.call(this);delete r.serverTiming;return r}}}if(typeof PerformanceResourceTiming!=="undefined")p(PerformanceResourceTiming);if(typeof PerformanceNavigationTiming!=="undefined")p(PerformanceNavigationTiming)}();';
|
|
124149
124152
|
var POSTHOG_LOADER = '!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug getPageViewId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);';
|
|
@@ -124234,6 +124237,8 @@ function playcademy(options = {}) {
|
|
|
124234
124237
|
config: (userConfig) => configHook(userConfig, context),
|
|
124235
124238
|
configResolved: (resolvedConfig) => configResolvedHook(resolvedConfig, context),
|
|
124236
124239
|
configureServer: (server) => configureServerHook(server, context),
|
|
124240
|
+
resolveId: (id) => resolveShellSdkId(id),
|
|
124241
|
+
load: (id) => loadShellSdk(id),
|
|
124237
124242
|
transformIndexHtml: () => transformIndexHtmlHook(context),
|
|
124238
124243
|
writeBundle: () => writeBundleHook(context),
|
|
124239
124244
|
closeBundle: () => closeBundleHook(context)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcademy/vite-plugin",
|
|
3
|
-
"version": "0.3.3-beta.
|
|
3
|
+
"version": "0.3.3-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -19,20 +19,21 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"archiver": "^7.0.1",
|
|
21
21
|
"picocolors": "^1.1.1",
|
|
22
|
-
"playcademy": "0.
|
|
22
|
+
"playcademy": "0.23.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@electric-sql/pglite": "^0.3.16",
|
|
26
26
|
"@inquirer/prompts": "^7.8.6",
|
|
27
27
|
"@playcademy/constants": "0.0.1",
|
|
28
|
-
"@playcademy/sandbox": "0.4.
|
|
29
|
-
"@playcademy/sdk": "0.
|
|
28
|
+
"@playcademy/sandbox": "0.4.1",
|
|
29
|
+
"@playcademy/sdk": "0.11.0",
|
|
30
30
|
"@playcademy/types": "0.0.1",
|
|
31
31
|
"@playcademy/utils": "0.0.1",
|
|
32
32
|
"@types/archiver": "^6.0.3",
|
|
33
33
|
"@types/bun": "1.3.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
+
"@playcademy/sdk": ">=0.10.0",
|
|
36
37
|
"typescript": "^5",
|
|
37
38
|
"vite": "^5 || ^6"
|
|
38
39
|
}
|