@plasmicapp/cli 0.1.357 → 0.1.358
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/index.js +2 -3
- package/dist/lib.js +2 -3
- package/package.json +2 -2
- package/src/__tests__/envdetect.spec.ts +8 -19
- package/src/utils/envdetect.ts +1 -2
package/dist/index.js
CHANGED
|
@@ -487928,15 +487928,14 @@ function detectNextJsAppDir() {
|
|
|
487928
487928
|
return false;
|
|
487929
487929
|
}
|
|
487930
487930
|
function detectNextJsVersion() {
|
|
487931
|
-
var _a8
|
|
487931
|
+
var _a8;
|
|
487932
487932
|
try {
|
|
487933
487933
|
const packageJson = getParsedPackageJson();
|
|
487934
487934
|
const nextVersion = (_a8 = packageJson.dependencies) == null ? void 0 : _a8.next;
|
|
487935
487935
|
if (!nextVersion) {
|
|
487936
487936
|
return void 0;
|
|
487937
487937
|
}
|
|
487938
|
-
|
|
487939
|
-
return major2 != null ? String(major2) : void 0;
|
|
487938
|
+
return nextVersion;
|
|
487940
487939
|
} catch {
|
|
487941
487940
|
return void 0;
|
|
487942
487941
|
}
|
package/dist/lib.js
CHANGED
|
@@ -483233,15 +483233,14 @@ function detectNextJsAppDir() {
|
|
|
483233
483233
|
return false;
|
|
483234
483234
|
}
|
|
483235
483235
|
function detectNextJsVersion() {
|
|
483236
|
-
var _a8
|
|
483236
|
+
var _a8;
|
|
483237
483237
|
try {
|
|
483238
483238
|
const packageJson = getParsedPackageJson();
|
|
483239
483239
|
const nextVersion = (_a8 = packageJson.dependencies) == null ? void 0 : _a8.next;
|
|
483240
483240
|
if (!nextVersion) {
|
|
483241
483241
|
return void 0;
|
|
483242
483242
|
}
|
|
483243
|
-
|
|
483244
|
-
return major2 != null ? String(major2) : void 0;
|
|
483243
|
+
return nextVersion;
|
|
483245
483244
|
} catch {
|
|
483246
483245
|
return void 0;
|
|
483247
483246
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.358",
|
|
4
4
|
"description": "plasmic cli for syncing local code with Plasmic designs",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"wrap-ansi": "^7.0.0",
|
|
83
83
|
"yargs": "^15.4.1"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "064aacd2bf8e30c06c81f2ed2be115df60134652"
|
|
86
86
|
}
|
|
@@ -48,17 +48,6 @@ describe("detectNextJsAppDir", () => {
|
|
|
48
48
|
expect(detectNextJsAppDir()).toBe(false);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it("returns false with pages router only", () => {
|
|
52
|
-
fs.writeFileSync(
|
|
53
|
-
path.join(tempDir, "next.config.js"),
|
|
54
|
-
"module.exports = {};"
|
|
55
|
-
);
|
|
56
|
-
fs.mkdirSync(path.join(tempDir, "pages"));
|
|
57
|
-
fs.writeFileSync(path.join(tempDir, "pages/index.tsx"), "");
|
|
58
|
-
|
|
59
|
-
expect(detectNextJsAppDir()).toBe(false);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
51
|
it("returns true with app router only", () => {
|
|
63
52
|
fs.writeFileSync(
|
|
64
53
|
path.join(tempDir, "next.config.js"),
|
|
@@ -146,23 +135,23 @@ describe("detectNextJsVersion", () => {
|
|
|
146
135
|
expect(detectNextJsVersion()).toBeUndefined();
|
|
147
136
|
});
|
|
148
137
|
|
|
149
|
-
it("returns
|
|
138
|
+
it("returns exact next version", () => {
|
|
150
139
|
writePackageJson({ next: "14.2.3" });
|
|
151
|
-
expect(detectNextJsVersion()).toBe("14");
|
|
140
|
+
expect(detectNextJsVersion()).toBe("14.2.3");
|
|
152
141
|
});
|
|
153
142
|
|
|
154
|
-
it("returns
|
|
143
|
+
it("returns caret range next version", () => {
|
|
155
144
|
writePackageJson({ next: "^13.4.0" });
|
|
156
|
-
expect(detectNextJsVersion()).toBe("13");
|
|
145
|
+
expect(detectNextJsVersion()).toBe("^13.4.0");
|
|
157
146
|
});
|
|
158
147
|
|
|
159
|
-
it("returns
|
|
148
|
+
it("returns tilde range next version", () => {
|
|
160
149
|
writePackageJson({ next: "~12.1.0" });
|
|
161
|
-
expect(detectNextJsVersion()).toBe("12");
|
|
150
|
+
expect(detectNextJsVersion()).toBe("~12.1.0");
|
|
162
151
|
});
|
|
163
152
|
|
|
164
|
-
it("returns
|
|
153
|
+
it("returns prerelease next version", () => {
|
|
165
154
|
writePackageJson({ next: "15.0.0-canary.1" });
|
|
166
|
-
expect(detectNextJsVersion()).toBe("15");
|
|
155
|
+
expect(detectNextJsVersion()).toBe("15.0.0-canary.1");
|
|
167
156
|
});
|
|
168
157
|
});
|
package/src/utils/envdetect.ts
CHANGED
|
@@ -78,8 +78,7 @@ export function detectNextJsVersion(): string | undefined {
|
|
|
78
78
|
if (!nextVersion) {
|
|
79
79
|
return undefined;
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
return major != null ? String(major) : undefined;
|
|
81
|
+
return nextVersion;
|
|
83
82
|
} catch {
|
|
84
83
|
return undefined;
|
|
85
84
|
}
|