create-plasmic-app 0.0.132 → 0.0.133

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.
@@ -146,12 +146,17 @@ function generateWelcomePage(config, platform) {
146
146
  getPageSection: () => {
147
147
  const pageLinks = components
148
148
  .map((pc) => {
149
+ var _a;
149
150
  // Get the relative path on the filesystem
150
151
  const relativePath = path.relative(dir, pc.importSpec.modulePath);
151
152
  // Format as an absolute path without the extension name
152
153
  const relativeLink = "/" + stripExtension(relativePath);
153
154
  if (platform === "nextjs") {
154
- return `<li><Link href="${relativeLink}">${pc.name} - ${relativeLink}</Link></li>`;
155
+ // Replace [param] with dummy values to avoid
156
+ // Next.js App Router error: "Dynamic href found in <Link>"
157
+ // https://nextjs.org/docs/messages/app-dir-dynamic-href
158
+ const href = ((_a = pc.path) !== null && _a !== void 0 ? _a : relativeLink).replace(/\[(\w+)\]/g, "placeholder");
159
+ return `<li><Link href="${href}">${pc.name} - ${pc.path}</Link></li>`;
155
160
  }
156
161
  else {
157
162
  return `<li><a style={{ color: "blue" }} href="${relativeLink}">${pc.name} - ${relativeLink}</a></li>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.132",
3
+ "version": "0.0.133",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -47,5 +47,5 @@
47
47
  "validate-npm-package-name": "^3.0.0",
48
48
  "yargs": "^16.2.0"
49
49
  },
50
- "gitHead": "ba358f89358841e49fcd5fcf898852ebff750793"
50
+ "gitHead": "a18cd21936a28b372b3cbdd9f4a4c37b7d055eae"
51
51
  }
@@ -153,7 +153,14 @@ export function generateWelcomePage(
153
153
  // Format as an absolute path without the extension name
154
154
  const relativeLink = "/" + stripExtension(relativePath);
155
155
  if (platform === "nextjs") {
156
- return `<li><Link href="${relativeLink}">${pc.name} - ${relativeLink}</Link></li>`;
156
+ // Replace [param] with dummy values to avoid
157
+ // Next.js App Router error: "Dynamic href found in <Link>"
158
+ // https://nextjs.org/docs/messages/app-dir-dynamic-href
159
+ const href = (pc.path ?? relativeLink).replace(
160
+ /\[(\w+)\]/g,
161
+ "placeholder"
162
+ );
163
+ return `<li><Link href="${href}">${pc.name} - ${pc.path}</Link></li>`;
157
164
  } else {
158
165
  return `<li><a style={{ color: "blue" }} href="${relativeLink}">${pc.name} - ${relativeLink}</a></li>`;
159
166
  }