netlify-cli 12.11.0 → 12.12.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "12.11.0",
3
+ "version": "12.12.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "12.11.0",
9
+ "version": "12.12.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -30,6 +30,7 @@
30
30
  "ci-info": "^3.0.0",
31
31
  "clean-deep": "^3.0.2",
32
32
  "commander": "^9.2.0",
33
+ "comment-json": "^4.2.3",
33
34
  "concordance": "^5.0.0",
34
35
  "configstore": "^5.0.0",
35
36
  "content-type": "^1.0.4",
@@ -6558,6 +6559,11 @@
6558
6559
  "url": "https://github.com/sponsors/ljharb"
6559
6560
  }
6560
6561
  },
6562
+ "node_modules/array-timsort": {
6563
+ "version": "1.0.3",
6564
+ "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz",
6565
+ "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ=="
6566
+ },
6561
6567
  "node_modules/array-union": {
6562
6568
  "version": "2.1.0",
6563
6569
  "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
@@ -8393,6 +8399,26 @@
8393
8399
  "node": "^12.20.0 || >=14"
8394
8400
  }
8395
8401
  },
8402
+ "node_modules/comment-json": {
8403
+ "version": "4.2.3",
8404
+ "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz",
8405
+ "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==",
8406
+ "dependencies": {
8407
+ "array-timsort": "^1.0.3",
8408
+ "core-util-is": "^1.0.3",
8409
+ "esprima": "^4.0.1",
8410
+ "has-own-prop": "^2.0.0",
8411
+ "repeat-string": "^1.6.1"
8412
+ },
8413
+ "engines": {
8414
+ "node": ">= 6"
8415
+ }
8416
+ },
8417
+ "node_modules/comment-json/node_modules/core-util-is": {
8418
+ "version": "1.0.3",
8419
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
8420
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
8421
+ },
8396
8422
  "node_modules/common-path-prefix": {
8397
8423
  "version": "3.0.0",
8398
8424
  "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
@@ -13443,6 +13469,14 @@
13443
13469
  "node": ">=0.10.0"
13444
13470
  }
13445
13471
  },
13472
+ "node_modules/has-own-prop": {
13473
+ "version": "2.0.0",
13474
+ "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz",
13475
+ "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==",
13476
+ "engines": {
13477
+ "node": ">=8"
13478
+ }
13479
+ },
13446
13480
  "node_modules/has-symbol-support-x": {
13447
13481
  "version": "1.4.2",
13448
13482
  "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
@@ -27964,6 +27998,11 @@
27964
27998
  "is-string": "^1.0.7"
27965
27999
  }
27966
28000
  },
28001
+ "array-timsort": {
28002
+ "version": "1.0.3",
28003
+ "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz",
28004
+ "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ=="
28005
+ },
27967
28006
  "array-union": {
27968
28007
  "version": "2.1.0",
27969
28008
  "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
@@ -29333,6 +29372,25 @@
29333
29372
  "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
29334
29373
  "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ=="
29335
29374
  },
29375
+ "comment-json": {
29376
+ "version": "4.2.3",
29377
+ "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz",
29378
+ "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==",
29379
+ "requires": {
29380
+ "array-timsort": "^1.0.3",
29381
+ "core-util-is": "^1.0.3",
29382
+ "esprima": "^4.0.1",
29383
+ "has-own-prop": "^2.0.0",
29384
+ "repeat-string": "^1.6.1"
29385
+ },
29386
+ "dependencies": {
29387
+ "core-util-is": {
29388
+ "version": "1.0.3",
29389
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
29390
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
29391
+ }
29392
+ }
29393
+ },
29336
29394
  "common-path-prefix": {
29337
29395
  "version": "3.0.0",
29338
29396
  "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
@@ -33249,6 +33307,11 @@
33249
33307
  }
33250
33308
  }
33251
33309
  },
33310
+ "has-own-prop": {
33311
+ "version": "2.0.0",
33312
+ "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz",
33313
+ "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ=="
33314
+ },
33252
33315
  "has-symbol-support-x": {
33253
33316
  "version": "1.4.2",
33254
33317
  "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "12.11.0",
4
+ "version": "12.12.0",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -95,6 +95,7 @@
95
95
  "ci-info": "^3.0.0",
96
96
  "clean-deep": "^3.0.2",
97
97
  "commander": "^9.2.0",
98
+ "comment-json": "^4.2.3",
98
99
  "concordance": "^5.0.0",
99
100
  "configstore": "^5.0.0",
100
101
  "content-type": "^1.0.4",
@@ -1,17 +1,18 @@
1
1
  import { mkdir, readFile, stat, writeFile } from 'fs/promises'
2
2
  import { dirname, relative } from 'path'
3
3
 
4
+ // eslint-disable-next-line import/no-namespace
5
+ import * as JSONC from 'comment-json'
4
6
  import unixify from 'unixify'
5
7
 
6
8
  export const applySettings = (existingSettings, { denoBinary, edgeFunctionsPath, repositoryRoot }) => {
7
9
  const relativeEdgeFunctionsPath = unixify(relative(repositoryRoot, edgeFunctionsPath))
8
- const settings = {
9
- ...existingSettings,
10
+ const settings = JSONC.assign(existingSettings, {
10
11
  'deno.enable': true,
11
12
  'deno.enablePaths': existingSettings['deno.enablePaths'] || [],
12
13
  'deno.unstable': true,
13
14
  'deno.importMap': '.netlify/edge-functions-import-map.json',
14
- }
15
+ })
15
16
 
16
17
  // If the Edge Functions path isn't already in `deno.enabledPaths`, let's add
17
18
  // it.
@@ -38,11 +39,11 @@ export const getSettings = async (settingsPath) => {
38
39
  throw new Error(`${settingsPath} is not a valid file.`)
39
40
  }
40
41
 
41
- const file = await readFile(settingsPath)
42
+ const file = await readFile(settingsPath, 'utf8')
42
43
 
43
44
  return {
44
45
  fileExists: true,
45
- settings: JSON.parse(file),
46
+ settings: JSONC.parse(file),
46
47
  }
47
48
  } catch (error) {
48
49
  if (error.code !== 'ENOENT') {
@@ -57,7 +58,7 @@ export const getSettings = async (settingsPath) => {
57
58
  }
58
59
 
59
60
  export const writeSettings = async ({ settings, settingsPath }) => {
60
- const serializedSettings = JSON.stringify(settings, null, 2)
61
+ const serializedSettings = JSONC.stringify(settings, null, 2)
61
62
 
62
63
  await mkdir(dirname(settingsPath), { recursive: true })
63
64
  await writeFile(settingsPath, serializedSettings)