@cedarjs/cli 8.0.0-canary.3317 → 8.0.0-canary.3322

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.
@@ -56,11 +56,17 @@ function addNetlifyPluginsToViteConfigTask() {
56
56
  const hasNetlifyCompat = content.includes(
57
57
  "@universal-deploy/netlify/vite"
58
58
  );
59
- if (hasNetlifyPlugin && hasNetlifyCompat && content.includes("netlifyCompat(")) {
59
+ const hasSkewProtectionImport = content.includes(
60
+ "cedarNetlifySkewProtectionPlugin"
61
+ );
62
+ const hasSkewProtectionCall = content.includes(
63
+ "cedarNetlifySkewProtectionPlugin("
64
+ );
65
+ if (hasNetlifyPlugin && hasNetlifyCompat && hasSkewProtectionImport && hasSkewProtectionCall && content.includes("netlifyCompat(")) {
60
66
  task.skip("Netlify plugins are already configured.");
61
67
  return;
62
68
  }
63
- if (!hasNetlifyPlugin || !hasNetlifyCompat) {
69
+ if (!hasNetlifyPlugin || !hasNetlifyCompat || !hasSkewProtectionImport) {
64
70
  const newContent = content.replace(
65
71
  /(import\s+\{[^}]*\}\s+from\s+['"]vite['"];?)/,
66
72
  (match) => {
@@ -71,6 +77,10 @@ ${result}`;
71
77
  }
72
78
  if (!hasNetlifyCompat) {
73
79
  result = `import netlifyCompat from '@universal-deploy/netlify/vite'
80
+ ${result}`;
81
+ }
82
+ if (!hasSkewProtectionImport) {
83
+ result = `import { cedarNetlifySkewProtectionPlugin } from '@cedarjs/vite'
74
84
  ${result}`;
75
85
  }
76
86
  return result;
@@ -84,6 +94,9 @@ ${result}`;
84
94
  if (!hasNetlifyCompat) {
85
95
  prepend += "import netlifyCompat from '@universal-deploy/netlify/vite'\n";
86
96
  }
97
+ if (!hasSkewProtectionImport) {
98
+ prepend += "import { cedarNetlifySkewProtectionPlugin } from '@cedarjs/vite'\n";
99
+ }
87
100
  content = prepend + content;
88
101
  } else {
89
102
  content = newContent;
@@ -94,12 +107,21 @@ ${result}`;
94
107
  content,
95
108
  pluginCodes: [
96
109
  "netlify({ build: { enabled: true } })",
97
- "netlifyCompat()"
110
+ "netlifyCompat()",
111
+ "cedarNetlifySkewProtectionPlugin()"
98
112
  ]
99
113
  });
100
114
  if (result) {
101
115
  content = result;
102
116
  }
117
+ } else if (!hasSkewProtectionCall) {
118
+ const result = insertPluginsBeforeCedar({
119
+ content,
120
+ pluginCodes: ["cedarNetlifySkewProtectionPlugin()"]
121
+ });
122
+ if (result) {
123
+ content = result;
124
+ }
103
125
  }
104
126
  fs.writeFileSync(viteConfigPath, content);
105
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "8.0.0-canary.3317",
3
+ "version": "8.0.0-canary.3322",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,17 +36,17 @@
36
36
  "@babel/preset-typescript": "7.29.7",
37
37
  "@babel/traverse": "7.29.8",
38
38
  "@babel/types": "7.29.8",
39
- "@cedarjs/api-server": "8.0.0-canary.3317",
40
- "@cedarjs/babel-config": "8.0.0-canary.3317",
41
- "@cedarjs/cli-helpers": "8.0.0-canary.3317",
42
- "@cedarjs/internal": "8.0.0-canary.3317",
43
- "@cedarjs/prerender": "8.0.0-canary.3317",
44
- "@cedarjs/project-config": "8.0.0-canary.3317",
45
- "@cedarjs/structure": "8.0.0-canary.3317",
46
- "@cedarjs/telemetry": "8.0.0-canary.3317",
47
- "@cedarjs/utils": "8.0.0-canary.3317",
48
- "@cedarjs/vite": "8.0.0-canary.3317",
49
- "@cedarjs/web-server": "8.0.0-canary.3317",
39
+ "@cedarjs/api-server": "8.0.0-canary.3322",
40
+ "@cedarjs/babel-config": "8.0.0-canary.3322",
41
+ "@cedarjs/cli-helpers": "8.0.0-canary.3322",
42
+ "@cedarjs/internal": "8.0.0-canary.3322",
43
+ "@cedarjs/prerender": "8.0.0-canary.3322",
44
+ "@cedarjs/project-config": "8.0.0-canary.3322",
45
+ "@cedarjs/structure": "8.0.0-canary.3322",
46
+ "@cedarjs/telemetry": "8.0.0-canary.3322",
47
+ "@cedarjs/utils": "8.0.0-canary.3322",
48
+ "@cedarjs/vite": "8.0.0-canary.3322",
49
+ "@cedarjs/web-server": "8.0.0-canary.3322",
50
50
  "@listr2/prompt-adapter-enquirer": "4.3.2",
51
51
  "@opentelemetry/api": "1.9.1",
52
52
  "@opentelemetry/core": "2.11.0",
@@ -94,7 +94,7 @@
94
94
  "yargs": "17.7.3"
95
95
  },
96
96
  "devDependencies": {
97
- "@cedarjs/framework-tools": "8.0.0-canary.3317",
97
+ "@cedarjs/framework-tools": "8.0.0-canary.3322",
98
98
  "@prisma/dmmf": "7.10.0",
99
99
  "@types/archiver": "^7.0.0",
100
100
  "memfs": "4.80.0",