create-cloudflare 2.21.5 → 2.21.6
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/cli.js +39 -10
- package/package.json +2 -2
- package/templates/nuxt/c3.ts +5 -6
- package/templates/solid/c3.ts +7 -5
package/dist/cli.js
CHANGED
|
@@ -3902,7 +3902,7 @@ var init_args = __esm({
|
|
|
3902
3902
|
var version;
|
|
3903
3903
|
var init_package = __esm({
|
|
3904
3904
|
"package.json"() {
|
|
3905
|
-
version = "2.21.
|
|
3905
|
+
version = "2.21.6";
|
|
3906
3906
|
}
|
|
3907
3907
|
});
|
|
3908
3908
|
|
|
@@ -24803,7 +24803,7 @@ var init_frameworks = __esm({
|
|
|
24803
24803
|
var version2;
|
|
24804
24804
|
var init_package3 = __esm({
|
|
24805
24805
|
"../wrangler/package.json"() {
|
|
24806
|
-
version2 = "3.60.
|
|
24806
|
+
version2 = "3.60.1";
|
|
24807
24807
|
}
|
|
24808
24808
|
});
|
|
24809
24809
|
|
|
@@ -70808,7 +70808,7 @@ var require_typescript2 = __commonJS({
|
|
|
70808
70808
|
});
|
|
70809
70809
|
|
|
70810
70810
|
// src/helpers/codemod.ts
|
|
70811
|
-
var import_fs11, import_path12, recast, esprimaParser, typescriptParser, parseFile, transformFile, loadSnippets, loadTemplateSnippets;
|
|
70811
|
+
var import_fs11, import_path12, recast, esprimaParser, typescriptParser, parseFile, transformFile, loadSnippets, loadTemplateSnippets, mergeObjectProperties, getPropertyName;
|
|
70812
70812
|
var init_codemod = __esm({
|
|
70813
70813
|
"src/helpers/codemod.ts"() {
|
|
70814
70814
|
import_fs11 = require("fs");
|
|
@@ -70860,6 +70860,33 @@ var init_codemod = __esm({
|
|
|
70860
70860
|
loadTemplateSnippets = (ctx) => {
|
|
70861
70861
|
return loadSnippets(getTemplatePath(ctx));
|
|
70862
70862
|
};
|
|
70863
|
+
mergeObjectProperties = (sourceObject, newProperties) => {
|
|
70864
|
+
newProperties.forEach((newProp) => {
|
|
70865
|
+
const newPropName = getPropertyName(newProp);
|
|
70866
|
+
if (!newPropName) {
|
|
70867
|
+
return false;
|
|
70868
|
+
}
|
|
70869
|
+
const indexOfExisting = sourceObject.properties.findIndex(
|
|
70870
|
+
(p2) => p2.type === "ObjectProperty" && getPropertyName(p2) === newPropName
|
|
70871
|
+
);
|
|
70872
|
+
const existing = sourceObject.properties[indexOfExisting];
|
|
70873
|
+
if (!existing) {
|
|
70874
|
+
sourceObject.properties.push(newProp);
|
|
70875
|
+
return;
|
|
70876
|
+
}
|
|
70877
|
+
if (existing.type === "ObjectProperty" && existing.value.type === "ObjectExpression" && newProp.value.type === "ObjectExpression") {
|
|
70878
|
+
mergeObjectProperties(
|
|
70879
|
+
existing.value,
|
|
70880
|
+
newProp.value.properties
|
|
70881
|
+
);
|
|
70882
|
+
return;
|
|
70883
|
+
}
|
|
70884
|
+
sourceObject.properties[indexOfExisting] = newProp;
|
|
70885
|
+
});
|
|
70886
|
+
};
|
|
70887
|
+
getPropertyName = (newProp) => {
|
|
70888
|
+
return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
|
|
70889
|
+
};
|
|
70863
70890
|
}
|
|
70864
70891
|
});
|
|
70865
70892
|
|
|
@@ -71604,9 +71631,10 @@ var init_c38 = __esm({
|
|
|
71604
71631
|
visitCallExpression: function(n2) {
|
|
71605
71632
|
const callee = n2.node.callee;
|
|
71606
71633
|
if (callee.name === "defineNuxtConfig") {
|
|
71607
|
-
|
|
71608
|
-
|
|
71609
|
-
|
|
71634
|
+
mergeObjectProperties(
|
|
71635
|
+
n2.node.arguments[0],
|
|
71636
|
+
[presetDef, moduleDef]
|
|
71637
|
+
);
|
|
71610
71638
|
}
|
|
71611
71639
|
return this.traverse(n2);
|
|
71612
71640
|
}
|
|
@@ -71891,8 +71919,9 @@ var init_c312 = __esm({
|
|
|
71891
71919
|
return this.traverse(n2);
|
|
71892
71920
|
}
|
|
71893
71921
|
const b2 = recast6.types.builders;
|
|
71894
|
-
|
|
71895
|
-
|
|
71922
|
+
mergeObjectProperties(
|
|
71923
|
+
n2.node.arguments[0],
|
|
71924
|
+
[
|
|
71896
71925
|
b2.objectProperty(
|
|
71897
71926
|
b2.identifier("server"),
|
|
71898
71927
|
b2.objectExpression([
|
|
@@ -71911,8 +71940,8 @@ var init_c312 = __esm({
|
|
|
71911
71940
|
)
|
|
71912
71941
|
])
|
|
71913
71942
|
)
|
|
71914
|
-
]
|
|
71915
|
-
|
|
71943
|
+
]
|
|
71944
|
+
);
|
|
71916
71945
|
return false;
|
|
71917
71946
|
}
|
|
71918
71947
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.6",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@cloudflare/cli": "1.1.1",
|
|
68
68
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
69
69
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
70
|
-
"wrangler": "3.60.
|
|
70
|
+
"wrangler": "3.60.1"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=18.14.1"
|
package/templates/nuxt/c3.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { logRaw } from "@cloudflare/cli";
|
|
|
2
2
|
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
3
3
|
import { spinner } from "@cloudflare/cli/interactive";
|
|
4
4
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
5
|
-
import { transformFile } from "helpers/codemod";
|
|
5
|
+
import { mergeObjectProperties, transformFile } from "helpers/codemod";
|
|
6
6
|
import { getLatestTypesEntrypoint } from "helpers/compatDate";
|
|
7
7
|
import { readFile, writeFile } from "helpers/files";
|
|
8
8
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
@@ -96,11 +96,10 @@ const updateNuxtConfig = () => {
|
|
|
96
96
|
visitCallExpression: function (n) {
|
|
97
97
|
const callee = n.node.callee as recast.types.namedTypes.Identifier;
|
|
98
98
|
if (callee.name === "defineNuxtConfig") {
|
|
99
|
-
|
|
100
|
-
.arguments[0] as recast.types.namedTypes.ObjectExpression
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
obj.properties.push(moduleDef);
|
|
99
|
+
mergeObjectProperties(
|
|
100
|
+
n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
|
|
101
|
+
[presetDef, moduleDef],
|
|
102
|
+
);
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
return this.traverse(n);
|
package/templates/solid/c3.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
2
2
|
import { blue } from "@cloudflare/cli/colors";
|
|
3
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
|
-
import { transformFile } from "helpers/codemod";
|
|
4
|
+
import { mergeObjectProperties, transformFile } from "helpers/codemod";
|
|
5
5
|
import { usesTypescript } from "helpers/files";
|
|
6
6
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
7
7
|
import * as recast from "recast";
|
|
@@ -32,8 +32,10 @@ const configure = async (ctx: C3Context) => {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const b = recast.types.builders;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
|
|
36
|
+
mergeObjectProperties(
|
|
37
|
+
n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
|
|
38
|
+
[
|
|
37
39
|
b.objectProperty(
|
|
38
40
|
b.identifier("server"),
|
|
39
41
|
b.objectExpression([
|
|
@@ -52,8 +54,8 @@ const configure = async (ctx: C3Context) => {
|
|
|
52
54
|
),
|
|
53
55
|
]),
|
|
54
56
|
),
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
+
],
|
|
58
|
+
);
|
|
57
59
|
|
|
58
60
|
return false;
|
|
59
61
|
},
|