@cedarjs/cli 5.0.0-canary.2377 → 5.0.0-canary.2379

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.
@@ -118,7 +118,7 @@ const handler = async ({ force, ud }) => {
118
118
  const tasks = new Listr(
119
119
  [
120
120
  ud && verifyUDSetupTask(),
121
- ud && installNetlifyPackagesTask(),
121
+ ud && await installNetlifyPackagesTask(),
122
122
  ud && addNetlifyPluginsToViteConfigTask(),
123
123
  !ud && updateApiURLTask("/.netlify/functions"),
124
124
  addFilesTask({ files: ud ? filesUd : files, force }),
@@ -20,7 +20,7 @@ const notes = [
20
20
  ` ${c.highlight("yarn cedar setup deploy netlify --ud")}`,
21
21
  ` ${c.highlight("yarn cedar setup deploy vercel --ud")}`,
22
22
  "",
23
- "See: https://cedarjs.com/docs/deploy#universal-deploy"
23
+ "See: https://cedarjs.com/docs/deploy/universal-deploy"
24
24
  ];
25
25
  async function handler() {
26
26
  recordTelemetryAttributes({
@@ -19,7 +19,7 @@ async function handler({ force, ud }) {
19
19
  const tasks = new Listr(
20
20
  [
21
21
  ud && verifyUDSetupTask(),
22
- ud && installVercelPackagesTask(),
22
+ ud && await installVercelPackagesTask(),
23
23
  ud && addVercelPluginToViteConfigTask(),
24
24
  !ud && updateApiURLTask("/api"),
25
25
  ud ? writeVercelUDConfigTask({ overwriteExisting: force }) : writeVercelConfigTask({ overwriteExisting: force }),
@@ -50,29 +50,34 @@ function addVercelPluginToViteConfigTask() {
50
50
  return;
51
51
  }
52
52
  let content = fs.readFileSync(viteConfigPath, "utf-8");
53
- if (content.includes("vite-plugin-vercel") && content.includes("vercel(")) {
53
+ const hasVercelPlugin = content.includes("vite-plugin-vercel");
54
+ if (hasVercelPlugin && content.includes("vercel(")) {
54
55
  task.skip("Vercel plugin is already configured.");
55
56
  return;
56
57
  }
57
- const newContent = content.replace(
58
- /(import\s+\{[^}]*\}\s+from\s+['"]vite['"];?)/,
59
- "import { vercel } from 'vite-plugin-vercel/vite'\n$1"
60
- );
61
- if (newContent === content) {
62
- content = "import { vercel } from 'vite-plugin-vercel/vite'\n" + content;
63
- } else {
64
- content = newContent;
58
+ if (!hasVercelPlugin) {
59
+ const newContent = content.replace(
60
+ /(import\s+\{[^}]*\}\s+from\s+['"]vite['"];?)/,
61
+ "import { vercel } from 'vite-plugin-vercel/vite'\n$1"
62
+ );
63
+ if (newContent === content) {
64
+ content = "import { vercel } from 'vite-plugin-vercel/vite'\n" + content;
65
+ } else {
66
+ content = newContent;
67
+ }
65
68
  }
66
- content = content.replace(
67
- /(\s*)(plugins:\s*\[)([\s\S]*?)(cedar\s*\()/,
68
- (_match, leadingWs, prefix, beforeCedar, cedarCall) => {
69
- const indent = beforeCedar.includes("\n") ? beforeCedar.match(/\n(\s*)$/)?.[1] || leadingWs + " " : leadingWs + " ";
70
- const before = beforeCedar.replace(/\s*$/, "");
71
- return `${leadingWs}${prefix}
69
+ if (!content.includes("vercel(")) {
70
+ content = content.replace(
71
+ /(\s*)(plugins:\s*\[)([\s\S]*?)(cedar\s*\()/,
72
+ (_match, leadingWs, prefix, beforeCedar, cedarCall) => {
73
+ const indent = beforeCedar.includes("\n") ? beforeCedar.match(/\n(\s*)$/)?.[1] || leadingWs + " " : leadingWs + " ";
74
+ const before = beforeCedar.replace(/\s*$/, "");
75
+ return `${leadingWs}${prefix}
72
76
  ${indent}vercel(),${before}
73
77
  ${indent}${cedarCall}`;
74
- }
75
- );
78
+ }
79
+ );
80
+ }
76
81
  fs.writeFileSync(viteConfigPath, content);
77
82
  }
78
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "5.0.0-canary.2377",
3
+ "version": "5.0.0-canary.2379",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,17 +33,17 @@
33
33
  "dependencies": {
34
34
  "@babel/parser": "7.29.3",
35
35
  "@babel/preset-typescript": "7.28.5",
36
- "@cedarjs/api-server": "5.0.0-canary.2377",
37
- "@cedarjs/cli-helpers": "5.0.0-canary.2377",
38
- "@cedarjs/fastify-web": "5.0.0-canary.2377",
39
- "@cedarjs/internal": "5.0.0-canary.2377",
40
- "@cedarjs/prerender": "5.0.0-canary.2377",
41
- "@cedarjs/project-config": "5.0.0-canary.2377",
42
- "@cedarjs/structure": "5.0.0-canary.2377",
43
- "@cedarjs/telemetry": "5.0.0-canary.2377",
44
- "@cedarjs/utils": "5.0.0-canary.2377",
45
- "@cedarjs/vite": "5.0.0-canary.2377",
46
- "@cedarjs/web-server": "5.0.0-canary.2377",
36
+ "@cedarjs/api-server": "5.0.0-canary.2379",
37
+ "@cedarjs/cli-helpers": "5.0.0-canary.2379",
38
+ "@cedarjs/fastify-web": "5.0.0-canary.2379",
39
+ "@cedarjs/internal": "5.0.0-canary.2379",
40
+ "@cedarjs/prerender": "5.0.0-canary.2379",
41
+ "@cedarjs/project-config": "5.0.0-canary.2379",
42
+ "@cedarjs/structure": "5.0.0-canary.2379",
43
+ "@cedarjs/telemetry": "5.0.0-canary.2379",
44
+ "@cedarjs/utils": "5.0.0-canary.2379",
45
+ "@cedarjs/vite": "5.0.0-canary.2379",
46
+ "@cedarjs/web-server": "5.0.0-canary.2379",
47
47
  "@listr2/prompt-adapter-enquirer": "4.2.1",
48
48
  "@opentelemetry/api": "1.9.0",
49
49
  "@opentelemetry/core": "1.30.1",