netlify-cli 14.0.0 → 14.2.0
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/npm-shrinkwrap.json +201 -66
- package/package.json +3 -1
- package/src/commands/dev/dev.mjs +6 -1
- package/src/lib/edge-functions/registry.mjs +13 -20
- package/src/utils/command-helpers.mjs +4 -1
- package/src/utils/detect-server-settings.mjs +94 -11
- package/src/utils/execa.mjs +4 -0
- package/src/utils/telemetry/index.mjs +1 -0
- package/src/utils/telemetry/report-error.mjs +48 -0
- package/src/utils/telemetry/request.mjs +13 -3
- package/src/utils/telemetry/telemetry.mjs +1 -7
- package/src/utils/telemetry/utils.mjs +7 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "14.
|
|
9
|
+
"version": "14.2.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@bugsnag/js": "^7.20.0",
|
|
13
14
|
"@fastify/static": "^6.6.0",
|
|
14
15
|
"@netlify/build": "^29.9.2",
|
|
16
|
+
"@netlify/build-info": "^7.0.0-pre-20230418.0",
|
|
15
17
|
"@netlify/config": "^20.3.7",
|
|
16
18
|
"@netlify/edge-bundler": "^8.13.2",
|
|
17
19
|
"@netlify/framework-info": "^9.8.5",
|
|
@@ -220,17 +222,17 @@
|
|
|
220
222
|
}
|
|
221
223
|
},
|
|
222
224
|
"node_modules/@bugsnag/browser": {
|
|
223
|
-
"version": "7.
|
|
224
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.
|
|
225
|
-
"integrity": "sha512-
|
|
225
|
+
"version": "7.20.0",
|
|
226
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.0.tgz",
|
|
227
|
+
"integrity": "sha512-LzZWI6q5cWYQSXvfJDcSl287d2xXESVn0L20lK+K5nwo/jXcK9IVZr9L+CYZ40HVXaC9jOmQbqZ18hsbO2QNIw==",
|
|
226
228
|
"dependencies": {
|
|
227
|
-
"@bugsnag/core": "^7.
|
|
229
|
+
"@bugsnag/core": "^7.19.0"
|
|
228
230
|
}
|
|
229
231
|
},
|
|
230
232
|
"node_modules/@bugsnag/core": {
|
|
231
|
-
"version": "7.
|
|
232
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.
|
|
233
|
-
"integrity": "sha512-
|
|
233
|
+
"version": "7.19.0",
|
|
234
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz",
|
|
235
|
+
"integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==",
|
|
234
236
|
"dependencies": {
|
|
235
237
|
"@bugsnag/cuid": "^3.0.0",
|
|
236
238
|
"@bugsnag/safe-json-stringify": "^6.0.0",
|
|
@@ -240,25 +242,25 @@
|
|
|
240
242
|
}
|
|
241
243
|
},
|
|
242
244
|
"node_modules/@bugsnag/cuid": {
|
|
243
|
-
"version": "3.0.
|
|
244
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.
|
|
245
|
-
"integrity": "sha512-
|
|
245
|
+
"version": "3.0.2",
|
|
246
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz",
|
|
247
|
+
"integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ=="
|
|
246
248
|
},
|
|
247
249
|
"node_modules/@bugsnag/js": {
|
|
248
|
-
"version": "7.
|
|
249
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.
|
|
250
|
-
"integrity": "sha512-
|
|
250
|
+
"version": "7.20.0",
|
|
251
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.0.tgz",
|
|
252
|
+
"integrity": "sha512-lhUUSOveE8fP10RagAINqBmuH+eoOpyUOiTN1WRkjHUevWG0LZjRRUWEGN3AA+ZyTphmC6ljd2qE3/64qfOSGQ==",
|
|
251
253
|
"dependencies": {
|
|
252
|
-
"@bugsnag/browser": "^7.
|
|
253
|
-
"@bugsnag/node": "^7.
|
|
254
|
+
"@bugsnag/browser": "^7.20.0",
|
|
255
|
+
"@bugsnag/node": "^7.19.0"
|
|
254
256
|
}
|
|
255
257
|
},
|
|
256
258
|
"node_modules/@bugsnag/node": {
|
|
257
|
-
"version": "7.
|
|
258
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.
|
|
259
|
-
"integrity": "sha512-
|
|
259
|
+
"version": "7.19.0",
|
|
260
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz",
|
|
261
|
+
"integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==",
|
|
260
262
|
"dependencies": {
|
|
261
|
-
"@bugsnag/core": "^7.
|
|
263
|
+
"@bugsnag/core": "^7.19.0",
|
|
262
264
|
"byline": "^5.0.0",
|
|
263
265
|
"error-stack-parser": "^2.0.2",
|
|
264
266
|
"iserror": "^0.0.2",
|
|
@@ -714,6 +716,85 @@
|
|
|
714
716
|
"node": "^14.16.0 || >=16.0.0"
|
|
715
717
|
}
|
|
716
718
|
},
|
|
719
|
+
"node_modules/@netlify/build-info": {
|
|
720
|
+
"version": "7.0.0-pre-20230418.0",
|
|
721
|
+
"resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.0.0-pre-20230418.0.tgz",
|
|
722
|
+
"integrity": "sha512-2SH071pIs6eufG5ZBFusZ2FVvpp1UKf6JDChOwNYWcQ86kaELqAkfE4fGE/5cXDEvp8ieid4HdD9i6DgwIIVxw==",
|
|
723
|
+
"dependencies": {
|
|
724
|
+
"@bugsnag/js": "^7.20.0",
|
|
725
|
+
"@netlify/framework-info": "^9.8.5",
|
|
726
|
+
"find-up": "^6.3.0",
|
|
727
|
+
"minimatch": "^6.2.0",
|
|
728
|
+
"read-pkg": "^7.1.0",
|
|
729
|
+
"semver": "^7.3.8",
|
|
730
|
+
"yaml": "^2.1.3",
|
|
731
|
+
"yargs": "^17.6.0"
|
|
732
|
+
},
|
|
733
|
+
"bin": {
|
|
734
|
+
"build-info": "bin.js"
|
|
735
|
+
},
|
|
736
|
+
"engines": {
|
|
737
|
+
"node": "^14.16.0 || >=16.0.0"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
"node_modules/@netlify/build-info/node_modules/brace-expansion": {
|
|
741
|
+
"version": "2.0.1",
|
|
742
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
|
743
|
+
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
|
744
|
+
"dependencies": {
|
|
745
|
+
"balanced-match": "^1.0.0"
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
"node_modules/@netlify/build-info/node_modules/minimatch": {
|
|
749
|
+
"version": "6.2.0",
|
|
750
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz",
|
|
751
|
+
"integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==",
|
|
752
|
+
"dependencies": {
|
|
753
|
+
"brace-expansion": "^2.0.1"
|
|
754
|
+
},
|
|
755
|
+
"engines": {
|
|
756
|
+
"node": ">=10"
|
|
757
|
+
},
|
|
758
|
+
"funding": {
|
|
759
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
"node_modules/@netlify/build-info/node_modules/read-pkg": {
|
|
763
|
+
"version": "7.1.0",
|
|
764
|
+
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz",
|
|
765
|
+
"integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==",
|
|
766
|
+
"dependencies": {
|
|
767
|
+
"@types/normalize-package-data": "^2.4.1",
|
|
768
|
+
"normalize-package-data": "^3.0.2",
|
|
769
|
+
"parse-json": "^5.2.0",
|
|
770
|
+
"type-fest": "^2.0.0"
|
|
771
|
+
},
|
|
772
|
+
"engines": {
|
|
773
|
+
"node": ">=12.20"
|
|
774
|
+
},
|
|
775
|
+
"funding": {
|
|
776
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
"node_modules/@netlify/build-info/node_modules/type-fest": {
|
|
780
|
+
"version": "2.19.0",
|
|
781
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
|
|
782
|
+
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
|
|
783
|
+
"engines": {
|
|
784
|
+
"node": ">=12.20"
|
|
785
|
+
},
|
|
786
|
+
"funding": {
|
|
787
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
"node_modules/@netlify/build-info/node_modules/yaml": {
|
|
791
|
+
"version": "2.2.1",
|
|
792
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz",
|
|
793
|
+
"integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==",
|
|
794
|
+
"engines": {
|
|
795
|
+
"node": ">= 14"
|
|
796
|
+
}
|
|
797
|
+
},
|
|
717
798
|
"node_modules/@netlify/build/node_modules/@sindresorhus/is": {
|
|
718
799
|
"version": "5.3.0",
|
|
719
800
|
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
|
|
@@ -5144,7 +5225,7 @@
|
|
|
5144
5225
|
"node_modules/byline": {
|
|
5145
5226
|
"version": "5.0.0",
|
|
5146
5227
|
"resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
|
|
5147
|
-
"integrity": "
|
|
5228
|
+
"integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==",
|
|
5148
5229
|
"engines": {
|
|
5149
5230
|
"node": ">=0.10.0"
|
|
5150
5231
|
}
|
|
@@ -7053,11 +7134,11 @@
|
|
|
7053
7134
|
}
|
|
7054
7135
|
},
|
|
7055
7136
|
"node_modules/error-stack-parser": {
|
|
7056
|
-
"version": "2.
|
|
7057
|
-
"resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.
|
|
7058
|
-
"integrity": "sha512-
|
|
7137
|
+
"version": "2.1.4",
|
|
7138
|
+
"resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
|
|
7139
|
+
"integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
|
|
7059
7140
|
"dependencies": {
|
|
7060
|
-
"stackframe": "^1.
|
|
7141
|
+
"stackframe": "^1.3.4"
|
|
7061
7142
|
}
|
|
7062
7143
|
},
|
|
7063
7144
|
"node_modules/es-module-lexer": {
|
|
@@ -9599,7 +9680,7 @@
|
|
|
9599
9680
|
"node_modules/iserror": {
|
|
9600
9681
|
"version": "0.0.2",
|
|
9601
9682
|
"resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz",
|
|
9602
|
-
"integrity": "
|
|
9683
|
+
"integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw=="
|
|
9603
9684
|
},
|
|
9604
9685
|
"node_modules/isexe": {
|
|
9605
9686
|
"version": "2.0.0",
|
|
@@ -13551,11 +13632,11 @@
|
|
|
13551
13632
|
}
|
|
13552
13633
|
},
|
|
13553
13634
|
"node_modules/stack-generator": {
|
|
13554
|
-
"version": "2.0.
|
|
13555
|
-
"resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.
|
|
13556
|
-
"integrity": "sha512
|
|
13635
|
+
"version": "2.0.10",
|
|
13636
|
+
"resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz",
|
|
13637
|
+
"integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==",
|
|
13557
13638
|
"dependencies": {
|
|
13558
|
-
"stackframe": "^1.
|
|
13639
|
+
"stackframe": "^1.3.4"
|
|
13559
13640
|
}
|
|
13560
13641
|
},
|
|
13561
13642
|
"node_modules/stack-trace": {
|
|
@@ -13567,9 +13648,9 @@
|
|
|
13567
13648
|
}
|
|
13568
13649
|
},
|
|
13569
13650
|
"node_modules/stackframe": {
|
|
13570
|
-
"version": "1.
|
|
13571
|
-
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.
|
|
13572
|
-
"integrity": "sha512-
|
|
13651
|
+
"version": "1.3.4",
|
|
13652
|
+
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
|
|
13653
|
+
"integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="
|
|
13573
13654
|
},
|
|
13574
13655
|
"node_modules/static-extend": {
|
|
13575
13656
|
"version": "0.1.2",
|
|
@@ -15523,17 +15604,17 @@
|
|
|
15523
15604
|
"integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ=="
|
|
15524
15605
|
},
|
|
15525
15606
|
"@bugsnag/browser": {
|
|
15526
|
-
"version": "7.
|
|
15527
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.
|
|
15528
|
-
"integrity": "sha512-
|
|
15607
|
+
"version": "7.20.0",
|
|
15608
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.0.tgz",
|
|
15609
|
+
"integrity": "sha512-LzZWI6q5cWYQSXvfJDcSl287d2xXESVn0L20lK+K5nwo/jXcK9IVZr9L+CYZ40HVXaC9jOmQbqZ18hsbO2QNIw==",
|
|
15529
15610
|
"requires": {
|
|
15530
|
-
"@bugsnag/core": "^7.
|
|
15611
|
+
"@bugsnag/core": "^7.19.0"
|
|
15531
15612
|
}
|
|
15532
15613
|
},
|
|
15533
15614
|
"@bugsnag/core": {
|
|
15534
|
-
"version": "7.
|
|
15535
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.
|
|
15536
|
-
"integrity": "sha512-
|
|
15615
|
+
"version": "7.19.0",
|
|
15616
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz",
|
|
15617
|
+
"integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==",
|
|
15537
15618
|
"requires": {
|
|
15538
15619
|
"@bugsnag/cuid": "^3.0.0",
|
|
15539
15620
|
"@bugsnag/safe-json-stringify": "^6.0.0",
|
|
@@ -15543,25 +15624,25 @@
|
|
|
15543
15624
|
}
|
|
15544
15625
|
},
|
|
15545
15626
|
"@bugsnag/cuid": {
|
|
15546
|
-
"version": "3.0.
|
|
15547
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.
|
|
15548
|
-
"integrity": "sha512-
|
|
15627
|
+
"version": "3.0.2",
|
|
15628
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz",
|
|
15629
|
+
"integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ=="
|
|
15549
15630
|
},
|
|
15550
15631
|
"@bugsnag/js": {
|
|
15551
|
-
"version": "7.
|
|
15552
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.
|
|
15553
|
-
"integrity": "sha512-
|
|
15632
|
+
"version": "7.20.0",
|
|
15633
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.0.tgz",
|
|
15634
|
+
"integrity": "sha512-lhUUSOveE8fP10RagAINqBmuH+eoOpyUOiTN1WRkjHUevWG0LZjRRUWEGN3AA+ZyTphmC6ljd2qE3/64qfOSGQ==",
|
|
15554
15635
|
"requires": {
|
|
15555
|
-
"@bugsnag/browser": "^7.
|
|
15556
|
-
"@bugsnag/node": "^7.
|
|
15636
|
+
"@bugsnag/browser": "^7.20.0",
|
|
15637
|
+
"@bugsnag/node": "^7.19.0"
|
|
15557
15638
|
}
|
|
15558
15639
|
},
|
|
15559
15640
|
"@bugsnag/node": {
|
|
15560
|
-
"version": "7.
|
|
15561
|
-
"resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.
|
|
15562
|
-
"integrity": "sha512-
|
|
15641
|
+
"version": "7.19.0",
|
|
15642
|
+
"resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz",
|
|
15643
|
+
"integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==",
|
|
15563
15644
|
"requires": {
|
|
15564
|
-
"@bugsnag/core": "^7.
|
|
15645
|
+
"@bugsnag/core": "^7.19.0",
|
|
15565
15646
|
"byline": "^5.0.0",
|
|
15566
15647
|
"error-stack-parser": "^2.0.2",
|
|
15567
15648
|
"iserror": "^0.0.2",
|
|
@@ -16210,6 +16291,60 @@
|
|
|
16210
16291
|
}
|
|
16211
16292
|
}
|
|
16212
16293
|
},
|
|
16294
|
+
"@netlify/build-info": {
|
|
16295
|
+
"version": "7.0.0-pre-20230418.0",
|
|
16296
|
+
"resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.0.0-pre-20230418.0.tgz",
|
|
16297
|
+
"integrity": "sha512-2SH071pIs6eufG5ZBFusZ2FVvpp1UKf6JDChOwNYWcQ86kaELqAkfE4fGE/5cXDEvp8ieid4HdD9i6DgwIIVxw==",
|
|
16298
|
+
"requires": {
|
|
16299
|
+
"@bugsnag/js": "^7.20.0",
|
|
16300
|
+
"@netlify/framework-info": "^9.8.5",
|
|
16301
|
+
"find-up": "^6.3.0",
|
|
16302
|
+
"minimatch": "^6.2.0",
|
|
16303
|
+
"read-pkg": "^7.1.0",
|
|
16304
|
+
"semver": "^7.3.8",
|
|
16305
|
+
"yaml": "^2.1.3",
|
|
16306
|
+
"yargs": "^17.6.0"
|
|
16307
|
+
},
|
|
16308
|
+
"dependencies": {
|
|
16309
|
+
"brace-expansion": {
|
|
16310
|
+
"version": "2.0.1",
|
|
16311
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
|
16312
|
+
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
|
16313
|
+
"requires": {
|
|
16314
|
+
"balanced-match": "^1.0.0"
|
|
16315
|
+
}
|
|
16316
|
+
},
|
|
16317
|
+
"minimatch": {
|
|
16318
|
+
"version": "6.2.0",
|
|
16319
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz",
|
|
16320
|
+
"integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==",
|
|
16321
|
+
"requires": {
|
|
16322
|
+
"brace-expansion": "^2.0.1"
|
|
16323
|
+
}
|
|
16324
|
+
},
|
|
16325
|
+
"read-pkg": {
|
|
16326
|
+
"version": "7.1.0",
|
|
16327
|
+
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz",
|
|
16328
|
+
"integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==",
|
|
16329
|
+
"requires": {
|
|
16330
|
+
"@types/normalize-package-data": "^2.4.1",
|
|
16331
|
+
"normalize-package-data": "^3.0.2",
|
|
16332
|
+
"parse-json": "^5.2.0",
|
|
16333
|
+
"type-fest": "^2.0.0"
|
|
16334
|
+
}
|
|
16335
|
+
},
|
|
16336
|
+
"type-fest": {
|
|
16337
|
+
"version": "2.19.0",
|
|
16338
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
|
|
16339
|
+
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
|
|
16340
|
+
},
|
|
16341
|
+
"yaml": {
|
|
16342
|
+
"version": "2.2.1",
|
|
16343
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz",
|
|
16344
|
+
"integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw=="
|
|
16345
|
+
}
|
|
16346
|
+
}
|
|
16347
|
+
},
|
|
16213
16348
|
"@netlify/cache-utils": {
|
|
16214
16349
|
"version": "5.1.3",
|
|
16215
16350
|
"resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.3.tgz",
|
|
@@ -18956,7 +19091,7 @@
|
|
|
18956
19091
|
"byline": {
|
|
18957
19092
|
"version": "5.0.0",
|
|
18958
19093
|
"resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
|
|
18959
|
-
"integrity": "
|
|
19094
|
+
"integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q=="
|
|
18960
19095
|
},
|
|
18961
19096
|
"bytes": {
|
|
18962
19097
|
"version": "3.1.2",
|
|
@@ -20425,11 +20560,11 @@
|
|
|
20425
20560
|
}
|
|
20426
20561
|
},
|
|
20427
20562
|
"error-stack-parser": {
|
|
20428
|
-
"version": "2.
|
|
20429
|
-
"resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.
|
|
20430
|
-
"integrity": "sha512-
|
|
20563
|
+
"version": "2.1.4",
|
|
20564
|
+
"resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
|
|
20565
|
+
"integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
|
|
20431
20566
|
"requires": {
|
|
20432
|
-
"stackframe": "^1.
|
|
20567
|
+
"stackframe": "^1.3.4"
|
|
20433
20568
|
}
|
|
20434
20569
|
},
|
|
20435
20570
|
"es-module-lexer": {
|
|
@@ -22292,7 +22427,7 @@
|
|
|
22292
22427
|
"iserror": {
|
|
22293
22428
|
"version": "0.0.2",
|
|
22294
22429
|
"resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz",
|
|
22295
|
-
"integrity": "
|
|
22430
|
+
"integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw=="
|
|
22296
22431
|
},
|
|
22297
22432
|
"isexe": {
|
|
22298
22433
|
"version": "2.0.0",
|
|
@@ -25198,11 +25333,11 @@
|
|
|
25198
25333
|
}
|
|
25199
25334
|
},
|
|
25200
25335
|
"stack-generator": {
|
|
25201
|
-
"version": "2.0.
|
|
25202
|
-
"resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.
|
|
25203
|
-
"integrity": "sha512
|
|
25336
|
+
"version": "2.0.10",
|
|
25337
|
+
"resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz",
|
|
25338
|
+
"integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==",
|
|
25204
25339
|
"requires": {
|
|
25205
|
-
"stackframe": "^1.
|
|
25340
|
+
"stackframe": "^1.3.4"
|
|
25206
25341
|
}
|
|
25207
25342
|
},
|
|
25208
25343
|
"stack-trace": {
|
|
@@ -25211,9 +25346,9 @@
|
|
|
25211
25346
|
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
|
25212
25347
|
},
|
|
25213
25348
|
"stackframe": {
|
|
25214
|
-
"version": "1.
|
|
25215
|
-
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.
|
|
25216
|
-
"integrity": "sha512-
|
|
25349
|
+
"version": "1.3.4",
|
|
25350
|
+
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
|
|
25351
|
+
"integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="
|
|
25217
25352
|
},
|
|
25218
25353
|
"static-extend": {
|
|
25219
25354
|
"version": "0.1.2",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.2.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -42,8 +42,10 @@
|
|
|
42
42
|
"prepublishOnly": "node ./scripts/prepare-for-publish.mjs"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
+
"@bugsnag/js": "^7.20.0",
|
|
45
46
|
"@fastify/static": "^6.6.0",
|
|
46
47
|
"@netlify/build": "^29.9.2",
|
|
48
|
+
"@netlify/build-info": "^7.0.0-pre-20230418.0",
|
|
47
49
|
"@netlify/config": "^20.3.7",
|
|
48
50
|
"@netlify/edge-bundler": "^8.13.2",
|
|
49
51
|
"@netlify/framework-info": "^9.8.5",
|
package/src/commands/dev/dev.mjs
CHANGED
|
@@ -111,7 +111,12 @@ const dev = async (options, command) => {
|
|
|
111
111
|
/** @type {Partial<import('../../utils/types').ServerSettings>} */
|
|
112
112
|
let settings = {}
|
|
113
113
|
try {
|
|
114
|
-
settings = await detectServerSettings(devConfig, options, site.root
|
|
114
|
+
settings = await detectServerSettings(devConfig, options, site.root, {
|
|
115
|
+
site: {
|
|
116
|
+
id: site.id,
|
|
117
|
+
url: siteUrl,
|
|
118
|
+
},
|
|
119
|
+
})
|
|
115
120
|
|
|
116
121
|
cachedConfig.config = getConfigWithPlugins(cachedConfig.config, settings)
|
|
117
122
|
} catch (error_) {
|
|
@@ -122,12 +122,7 @@ export class EdgeFunctionsRegistry {
|
|
|
122
122
|
* @returns {Promise<void>}
|
|
123
123
|
*/
|
|
124
124
|
async #doInitialScan() {
|
|
125
|
-
|
|
126
|
-
this.#scanForFunctions(this.#internalDirectories),
|
|
127
|
-
this.#scanForFunctions(this.#directories),
|
|
128
|
-
])
|
|
129
|
-
this.#internalFunctions = internalFunctions.all
|
|
130
|
-
this.#userFunctions = userFunctions.all
|
|
125
|
+
await this.#scanForFunctions()
|
|
131
126
|
|
|
132
127
|
this.#functions.forEach((func) => {
|
|
133
128
|
this.#logAddedFunction(func)
|
|
@@ -190,16 +185,7 @@ export class EdgeFunctionsRegistry {
|
|
|
190
185
|
* @returns {Promise<void>}
|
|
191
186
|
*/
|
|
192
187
|
async #checkForAddedOrDeletedFunctions() {
|
|
193
|
-
const
|
|
194
|
-
this.#scanForFunctions(this.#internalDirectories),
|
|
195
|
-
this.#scanForFunctions(this.#directories),
|
|
196
|
-
])
|
|
197
|
-
|
|
198
|
-
this.#internalFunctions = internalFunctions.all
|
|
199
|
-
this.#userFunctions = userFunctions.all
|
|
200
|
-
|
|
201
|
-
const newFunctions = [...internalFunctions.new, ...userFunctions.new]
|
|
202
|
-
const deletedFunctions = [...internalFunctions.deleted, ...userFunctions.deleted]
|
|
188
|
+
const { deleted: deletedFunctions, new: newFunctions } = await this.#scanForFunctions()
|
|
203
189
|
|
|
204
190
|
if (newFunctions.length === 0 && deletedFunctions.length === 0) {
|
|
205
191
|
return
|
|
@@ -446,12 +432,16 @@ export class EdgeFunctionsRegistry {
|
|
|
446
432
|
}
|
|
447
433
|
|
|
448
434
|
/**
|
|
449
|
-
*
|
|
450
|
-
* @param {string[]} directories
|
|
451
435
|
* @returns {Promise<{all: EdgeFunction[], new: EdgeFunction[], deleted: EdgeFunction[]}>}
|
|
452
436
|
*/
|
|
453
|
-
async #scanForFunctions(
|
|
454
|
-
const
|
|
437
|
+
async #scanForFunctions() {
|
|
438
|
+
const [internalFunctions, userFunctions] = await Promise.all([
|
|
439
|
+
this.#bundler.find(this.#internalDirectories),
|
|
440
|
+
this.#bundler.find(this.#directories),
|
|
441
|
+
])
|
|
442
|
+
|
|
443
|
+
const functions = [...internalFunctions, ...userFunctions]
|
|
444
|
+
|
|
455
445
|
const newFunctions = functions.filter((func) => {
|
|
456
446
|
const functionExists = this.#functions.some(
|
|
457
447
|
(existingFunc) => func.name === existingFunc.name && func.path === existingFunc.path,
|
|
@@ -467,6 +457,9 @@ export class EdgeFunctionsRegistry {
|
|
|
467
457
|
return !functionExists
|
|
468
458
|
})
|
|
469
459
|
|
|
460
|
+
this.#internalFunctions = internalFunctions
|
|
461
|
+
this.#userFunctions = userFunctions
|
|
462
|
+
|
|
470
463
|
return { all: functions, new: newFunctions, deleted: deletedFunctions }
|
|
471
464
|
}
|
|
472
465
|
|
|
@@ -16,6 +16,7 @@ import { clearSpinner, startSpinner } from '../lib/spinner.mjs'
|
|
|
16
16
|
|
|
17
17
|
import getGlobalConfig from './get-global-config.mjs'
|
|
18
18
|
import getPackageJson from './get-package-json.mjs'
|
|
19
|
+
import { reportError } from './telemetry/report-error.mjs'
|
|
19
20
|
|
|
20
21
|
/** The parsed process argv without the binary only arguments and flags */
|
|
21
22
|
const argv = process.argv.slice(2)
|
|
@@ -179,14 +180,16 @@ export const warn = (message = '') => {
|
|
|
179
180
|
*/
|
|
180
181
|
export const error = (message = '', options = {}) => {
|
|
181
182
|
const err = message instanceof Error ? message : new Error(message)
|
|
183
|
+
|
|
182
184
|
if (options.exit === false) {
|
|
183
185
|
const bang = chalk.red(BANG)
|
|
184
186
|
if (process.env.DEBUG) {
|
|
185
|
-
process.stderr.write(` ${bang} Warning: ${err.stack
|
|
187
|
+
process.stderr.write(` ${bang} Warning: ${err.stack?.split('\n').join(`\n ${bang} `)}\n`)
|
|
186
188
|
} else {
|
|
187
189
|
process.stderr.write(` ${bang} ${chalk.red(`${err.name}:`)} ${err.message}\n`)
|
|
188
190
|
}
|
|
189
191
|
} else {
|
|
192
|
+
reportError(err, { severity: 'error' })
|
|
190
193
|
throw err
|
|
191
194
|
}
|
|
192
195
|
}
|
|
@@ -4,6 +4,9 @@ import { EOL } from 'os'
|
|
|
4
4
|
import path from 'path'
|
|
5
5
|
import process from 'process'
|
|
6
6
|
|
|
7
|
+
import { Project } from '@netlify/build-info'
|
|
8
|
+
// eslint-disable-next-line import/extensions, n/no-missing-import
|
|
9
|
+
import { NodeFS } from '@netlify/build-info/node'
|
|
7
10
|
import { getFramework, listFrameworks } from '@netlify/framework-info'
|
|
8
11
|
import fuzzy from 'fuzzy'
|
|
9
12
|
import getPort from 'get-port'
|
|
@@ -12,6 +15,7 @@ import isPlainObject from 'is-plain-obj'
|
|
|
12
15
|
import { NETLIFYDEVWARN, chalk, log } from './command-helpers.mjs'
|
|
13
16
|
import { acquirePort } from './dev.mjs'
|
|
14
17
|
import { getInternalFunctionsDir } from './functions/functions.mjs'
|
|
18
|
+
import { reportError } from './telemetry/report-error.mjs'
|
|
15
19
|
|
|
16
20
|
const formatProperty = (str) => chalk.magenta(`'${str}'`)
|
|
17
21
|
const formatValue = (str) => chalk.green(`'${str}'`)
|
|
@@ -112,10 +116,10 @@ const getStaticServerPort = async ({ devConfig }) => {
|
|
|
112
116
|
/**
|
|
113
117
|
*
|
|
114
118
|
* @param {object} param0
|
|
115
|
-
* @param {import('../commands/dev/types').DevConfig} param0.devConfig
|
|
119
|
+
* @param {import('../commands/dev/types.js').DevConfig} param0.devConfig
|
|
116
120
|
* @param {import('commander').OptionValues} param0.options
|
|
117
121
|
* @param {string} param0.projectDir
|
|
118
|
-
* @returns {Promise<import('./types').BaseServerSettings>}
|
|
122
|
+
* @returns {Promise<import('./types.js').BaseServerSettings>}
|
|
119
123
|
*/
|
|
120
124
|
const handleStaticServer = async ({ devConfig, options, projectDir }) => {
|
|
121
125
|
validateNumberProperty({ devConfig, property: 'staticServerPort' })
|
|
@@ -152,8 +156,8 @@ const handleStaticServer = async ({ devConfig, options, projectDir }) => {
|
|
|
152
156
|
|
|
153
157
|
/**
|
|
154
158
|
* Retrieves the settings from a framework
|
|
155
|
-
* @param {import('./types').FrameworkInfo} framework
|
|
156
|
-
* @returns {import('./types').BaseServerSettings}
|
|
159
|
+
* @param {import('./types.js').FrameworkInfo} framework
|
|
160
|
+
* @returns {import('./types.js').BaseServerSettings}
|
|
157
161
|
*/
|
|
158
162
|
const getSettingsFromFramework = (framework) => {
|
|
159
163
|
const {
|
|
@@ -182,6 +186,71 @@ const getSettingsFromFramework = (framework) => {
|
|
|
182
186
|
|
|
183
187
|
const hasDevCommand = (framework) => Array.isArray(framework.dev.commands) && framework.dev.commands.length !== 0
|
|
184
188
|
|
|
189
|
+
/**
|
|
190
|
+
* The new build setting detection with build systems and frameworks combined
|
|
191
|
+
* @param {string} projectDir
|
|
192
|
+
*/
|
|
193
|
+
const detectSettings = async (projectDir) => {
|
|
194
|
+
const fs = new NodeFS()
|
|
195
|
+
const project = new Project(fs, projectDir)
|
|
196
|
+
|
|
197
|
+
return await project.getBuildSettings()
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @param {import('./types.js').BaseServerSettings | undefined} frameworkSettings
|
|
203
|
+
* @param {import('@netlify/build-info').Settings[]} newSettings
|
|
204
|
+
* @param {Record<string, Record<string, any>>} [metadata]
|
|
205
|
+
*/
|
|
206
|
+
const detectChangesInNewSettings = (frameworkSettings, newSettings, metadata) => {
|
|
207
|
+
/** @type {string[]} */
|
|
208
|
+
const message = ['']
|
|
209
|
+
const [setting] = newSettings
|
|
210
|
+
|
|
211
|
+
if (frameworkSettings?.framework !== setting?.framework) {
|
|
212
|
+
message.push(
|
|
213
|
+
`- Framework does not match:`,
|
|
214
|
+
` [old]: ${frameworkSettings?.framework}`,
|
|
215
|
+
` [new]: ${setting?.framework}`,
|
|
216
|
+
'',
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (frameworkSettings?.command !== setting?.devCommand) {
|
|
221
|
+
message.push(
|
|
222
|
+
`- command does not match:`,
|
|
223
|
+
` [old]: ${frameworkSettings?.command}`,
|
|
224
|
+
` [new]: ${setting?.devCommand}`,
|
|
225
|
+
'',
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (frameworkSettings?.dist !== setting?.dist) {
|
|
230
|
+
message.push(`- dist does not match:`, ` [old]: ${frameworkSettings?.dist}`, ` [new]: ${setting?.dist}`, '')
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (frameworkSettings?.frameworkPort !== setting?.frameworkPort) {
|
|
234
|
+
message.push(
|
|
235
|
+
`- frameworkPort does not match:`,
|
|
236
|
+
` [old]: ${frameworkSettings?.frameworkPort}`,
|
|
237
|
+
` [new]: ${setting?.frameworkPort}`,
|
|
238
|
+
'',
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (message.length !== 0) {
|
|
243
|
+
reportError(
|
|
244
|
+
{
|
|
245
|
+
name: 'NewSettingsDetectionMismatch',
|
|
246
|
+
errorMessage: 'New Settings detection does not match old one',
|
|
247
|
+
message: message.join('\n'),
|
|
248
|
+
},
|
|
249
|
+
{ severity: 'info', metadata },
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
185
254
|
const detectFrameworkSettings = async ({ projectDir }) => {
|
|
186
255
|
const projectFrameworks = await listFrameworks({ projectDir })
|
|
187
256
|
const frameworks = projectFrameworks.filter((framework) => hasDevCommand(framework))
|
|
@@ -224,7 +293,7 @@ const hasCommandAndTargetPort = ({ devConfig }) => devConfig.command && devConfi
|
|
|
224
293
|
/**
|
|
225
294
|
* Creates settings for the custom framework
|
|
226
295
|
* @param {*} param0
|
|
227
|
-
* @returns {import('./types').BaseServerSettings}
|
|
296
|
+
* @returns {import('./types.js').BaseServerSettings}
|
|
228
297
|
*/
|
|
229
298
|
const handleCustomFramework = ({ devConfig }) => {
|
|
230
299
|
if (!hasCommandAndTargetPort({ devConfig })) {
|
|
@@ -271,7 +340,7 @@ const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
|
|
|
271
340
|
/**
|
|
272
341
|
* Handles a forced framework and retrieves the settings for it
|
|
273
342
|
* @param {*} param0
|
|
274
|
-
* @returns {Promise<import('./types').BaseServerSettings>}
|
|
343
|
+
* @returns {Promise<import('./types.js').BaseServerSettings>}
|
|
275
344
|
*/
|
|
276
345
|
const handleForcedFramework = async ({ devConfig, projectDir }) => {
|
|
277
346
|
// this throws if `devConfig.framework` is not a supported framework
|
|
@@ -281,15 +350,16 @@ const handleForcedFramework = async ({ devConfig, projectDir }) => {
|
|
|
281
350
|
|
|
282
351
|
/**
|
|
283
352
|
* Get the server settings based on the flags and the devConfig
|
|
284
|
-
* @param {import('../commands/dev/types').DevConfig} devConfig
|
|
353
|
+
* @param {import('../commands/dev/types.js').DevConfig} devConfig
|
|
285
354
|
* @param {import('commander').OptionValues} options
|
|
286
355
|
* @param {string} projectDir
|
|
287
|
-
* @
|
|
356
|
+
* @param {Record<string, Record<string, any>>} [metadata]
|
|
357
|
+
* @returns {Promise<import('./types.js').ServerSettings>}
|
|
288
358
|
*/
|
|
289
|
-
const detectServerSettings = async (devConfig, options, projectDir) => {
|
|
359
|
+
const detectServerSettings = async (devConfig, options, projectDir, metadata) => {
|
|
290
360
|
validateStringProperty({ devConfig, property: 'framework' })
|
|
291
361
|
|
|
292
|
-
/** @type {Partial<import('./types').BaseServerSettings>} */
|
|
362
|
+
/** @type {Partial<import('./types.js').BaseServerSettings>} */
|
|
293
363
|
let settings = {}
|
|
294
364
|
|
|
295
365
|
if (options.dir || devConfig.framework === '#static') {
|
|
@@ -300,6 +370,19 @@ const detectServerSettings = async (devConfig, options, projectDir) => {
|
|
|
300
370
|
|
|
301
371
|
const runDetection = !hasCommandAndTargetPort({ devConfig })
|
|
302
372
|
const frameworkSettings = runDetection ? await detectFrameworkSettings({ projectDir }) : undefined
|
|
373
|
+
const newSettings = runDetection ? await detectSettings(projectDir) : undefined
|
|
374
|
+
|
|
375
|
+
// just report differences in the settings
|
|
376
|
+
detectChangesInNewSettings(frameworkSettings, newSettings || [], {
|
|
377
|
+
...metadata,
|
|
378
|
+
settings: {
|
|
379
|
+
projectDir,
|
|
380
|
+
devConfig,
|
|
381
|
+
options,
|
|
382
|
+
old: frameworkSettings,
|
|
383
|
+
settings: newSettings,
|
|
384
|
+
},
|
|
385
|
+
})
|
|
303
386
|
|
|
304
387
|
if (frameworkSettings === undefined && runDetection) {
|
|
305
388
|
log(`${NETLIFYDEVWARN} No app server detected. Using simple static server`)
|
|
@@ -368,7 +451,7 @@ const formatSettingsArrForInquirer = function (frameworks) {
|
|
|
368
451
|
* Returns a copy of the provided config with any plugins provided by the
|
|
369
452
|
* server settings
|
|
370
453
|
* @param {*} config
|
|
371
|
-
* @param {Partial<import('./types').ServerSettings>} settings
|
|
454
|
+
* @param {Partial<import('./types.js').ServerSettings>} settings
|
|
372
455
|
* @returns {*} Modified config
|
|
373
456
|
*/
|
|
374
457
|
export const getConfigWithPlugins = (config, settings) => {
|
package/src/utils/execa.mjs
CHANGED
|
@@ -2,6 +2,10 @@ import { env } from 'process'
|
|
|
2
2
|
// This is a thin layer on top of `execa` that allows consumers to provide an
|
|
3
3
|
// alternative path to the module location, making it easier to mock its logic
|
|
4
4
|
// in tests (see `tests/utils/mock-execa.js`).
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @type {import('execa')}
|
|
8
|
+
*/
|
|
5
9
|
// eslint-disable-next-line import/no-mutable-exports
|
|
6
10
|
let execa
|
|
7
11
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import os from 'os'
|
|
2
|
+
import { dirname, join } from 'path'
|
|
3
|
+
import process, { version as nodejsVersion } from 'process'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
import execa from '../execa.mjs'
|
|
7
|
+
import getGlobalConfig from '../get-global-config.mjs'
|
|
8
|
+
|
|
9
|
+
import { cliVersion } from './utils.mjs'
|
|
10
|
+
|
|
11
|
+
const dirPath = dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {import('@bugsnag/js').NotifiableError} error
|
|
16
|
+
* @param {object} config
|
|
17
|
+
* @param {import('@bugsnag/js').Event['severity']} config.severity
|
|
18
|
+
* @param {Record<string, Record<string, any>>} [config.metadata]
|
|
19
|
+
* @returns {Promise<void>}
|
|
20
|
+
*/
|
|
21
|
+
export const reportError = async function (error, config = {}) {
|
|
22
|
+
const globalConfig = await getGlobalConfig()
|
|
23
|
+
|
|
24
|
+
const options = JSON.stringify({
|
|
25
|
+
type: 'error',
|
|
26
|
+
data: {
|
|
27
|
+
message: error.message,
|
|
28
|
+
name: error.name,
|
|
29
|
+
stack: error.stack,
|
|
30
|
+
cause: error.cause,
|
|
31
|
+
severity: config.severity,
|
|
32
|
+
user: {
|
|
33
|
+
id: globalConfig.get('userId'),
|
|
34
|
+
},
|
|
35
|
+
metadata: config.metadata,
|
|
36
|
+
osName: `${os.platform()}-${os.arch()}`,
|
|
37
|
+
cliVersion,
|
|
38
|
+
nodejsVersion,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// spawn detached child process to handle send and wait for the http request to finish
|
|
43
|
+
// otherwise it can get canceled
|
|
44
|
+
await execa(process.execPath, [join(dirPath, 'request.mjs'), options], {
|
|
45
|
+
detached: true,
|
|
46
|
+
stdio: 'ignore',
|
|
47
|
+
})
|
|
48
|
+
}
|
|
@@ -14,13 +14,23 @@ const options = JSON.parse(process.argv[2])
|
|
|
14
14
|
const CLIENT_ID = 'NETLIFY_CLI'
|
|
15
15
|
const TRACK_URL = process.env.NETLIFY_TEST_TRACK_URL || 'https://cli.netlify.com/telemetry/track'
|
|
16
16
|
const IDENTIFY_URL = process.env.NETLIFY_TEST_IDENTIFY_URL || 'https://cli.netlify.com/telemetry/identify'
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const REPORT_ERROR_URL = process.env.NETLIFY_TEST_ERROR_REPORT_URL || 'https://cli.netlify.com/report-error'
|
|
18
|
+
|
|
19
|
+
const getApiUrl = () => {
|
|
20
|
+
switch (options.type) {
|
|
21
|
+
case 'track':
|
|
22
|
+
return TRACK_URL
|
|
23
|
+
case 'error':
|
|
24
|
+
return REPORT_ERROR_URL
|
|
25
|
+
default:
|
|
26
|
+
return IDENTIFY_URL
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
|
|
20
30
|
// Make telemetry call
|
|
21
31
|
const makeRequest = async function () {
|
|
22
32
|
try {
|
|
23
|
-
await fetch(
|
|
33
|
+
await fetch(getApiUrl(), {
|
|
24
34
|
method: 'POST',
|
|
25
35
|
headers: {
|
|
26
36
|
'Content-Type': 'application/json',
|
|
@@ -7,16 +7,10 @@ import { isCI } from 'ci-info'
|
|
|
7
7
|
|
|
8
8
|
import execa from '../execa.mjs'
|
|
9
9
|
import getGlobalConfig from '../get-global-config.mjs'
|
|
10
|
-
import getPackageJson from '../get-package-json.mjs'
|
|
11
10
|
|
|
11
|
+
import { isTelemetryDisabled, cliVersion } from './utils.mjs'
|
|
12
12
|
import isValidEventName from './validation.mjs'
|
|
13
13
|
|
|
14
|
-
const { version: cliVersion } = await getPackageJson()
|
|
15
|
-
|
|
16
|
-
const isTelemetryDisabled = function (config) {
|
|
17
|
-
return config.get('telemetryDisabled')
|
|
18
|
-
}
|
|
19
|
-
|
|
20
14
|
const dirPath = dirname(fileURLToPath(import.meta.url))
|
|
21
15
|
|
|
22
16
|
const send = function (type, payload) {
|