playcademy 0.11.9 → 0.11.11

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/dist/index.js +12 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5139,15 +5139,17 @@ async function bundleBackend(config, options = {}) {
5139
5139
  customRoutes: customRouteData
5140
5140
  };
5141
5141
  const entryCode = generateEntryCode(customRouteData);
5142
- const distDir = new URL(".", import.meta.url).pathname;
5143
- const embeddedEdgeSrc = join3(distDir, "edge-play", "src");
5144
- const monorepoEdgeSrc = join3(distDir, "../../../../edge-play/src");
5142
+ const currentDir2 = new URL(".", import.meta.url).pathname;
5143
+ const embeddedEdgeSrc = join3(currentDir2, "edge-play", "src");
5144
+ const monorepoEdgeSrc = join3(currentDir2, "../../../edge-play/src");
5145
5145
  const isBuiltPackage = existsSync3(embeddedEdgeSrc);
5146
5146
  const edgePlaySrc = isBuiltPackage ? embeddedEdgeSrc : monorepoEdgeSrc;
5147
- const cliPackageRoot = isBuiltPackage ? join3(distDir, "../..") : join3(distDir, "../../..");
5147
+ const cliPackageRoot = isBuiltPackage ? join3(currentDir2, "..") : join3(currentDir2, "../../..");
5148
5148
  const nodeModulesRoot = isBuiltPackage ? cliPackageRoot : getMonorepoRoot();
5149
- const embeddedConstantsSrc = join3(distDir, "../../@playcademy/constants/src");
5150
- const monorepoConstantsSrc = join3(distDir, "../../../../constants/src");
5149
+ const embeddedConstantsSrcA = join3(currentDir2, "@playcademy/constants/src");
5150
+ const embeddedConstantsSrcB = join3(currentDir2, "node_modules/@playcademy/constants/src");
5151
+ const embeddedConstantsSrc = existsSync3(embeddedConstantsSrcA) ? embeddedConstantsSrcA : embeddedConstantsSrcB;
5152
+ const monorepoConstantsSrc = join3(currentDir2, "../../../constants/src");
5151
5153
  const constantsSrc = isBuiltPackage ? embeddedConstantsSrc : monorepoConstantsSrc;
5152
5154
  const result = await esbuild.build({
5153
5155
  stdin: {
@@ -5183,12 +5185,11 @@ async function bundleBackend(config, options = {}) {
5183
5185
  /**
5184
5186
  * @playcademy/constants alias for edge-play sources
5185
5187
  *
5186
- * Edge-play sources import from @playcademy/constants. When bundling,
5187
- * we need to resolve this to the actual source location:
5188
- * - In built package: embedded in dist/node_modules/@playcademy/constants
5189
- * - In development: monorepo packages/constants
5188
+ * Map the bare import to the package entry file, and also support
5189
+ * subpath imports if they are added in the future.
5190
5190
  */
5191
- "@playcademy/constants": constantsSrc,
5191
+ "@playcademy/constants": join3(constantsSrc, "index.ts"),
5192
+ "@playcademy/constants/*": join3(constantsSrc, "*"),
5192
5193
  /**
5193
5194
  * Node.js module polyfills for Cloudflare Workers environment
5194
5195
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.11.9",
3
+ "version": "0.11.11",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "exports": {