skuba 14.0.0-migrate-to-inquirer-20251031055743 → 14.0.0-node-24-20251204121724
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/lib/cli/adapter/eslint.js +3 -3
- package/lib/cli/adapter/eslint.js.map +3 -3
- package/lib/cli/build/assets.d.ts +3 -2
- package/lib/cli/build/assets.js +2 -2
- package/lib/cli/build/assets.js.map +3 -3
- package/lib/cli/build/index.js +3 -13
- package/lib/cli/build/index.js.map +3 -3
- package/lib/cli/build/tsc.js +1 -2
- package/lib/cli/build/tsc.js.map +2 -2
- package/lib/cli/configure/analysis/diff.js +3 -13
- package/lib/cli/configure/analysis/diff.js.map +3 -3
- package/lib/cli/configure/ensureTemplateCompletion.js +5 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
- package/lib/cli/configure/getEntryPoint.js +3 -3
- package/lib/cli/configure/getEntryPoint.js.map +3 -3
- package/lib/cli/configure/index.js +3 -3
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/format/index.js +4 -14
- package/lib/cli/format/index.js.map +3 -3
- package/lib/cli/init/getConfig.js +22 -25
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/prompts.d.ts +4 -4
- package/lib/cli/init/prompts.js +8 -8
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/lint/eslint.js +2 -2
- package/lib/cli/lint/eslint.js.map +3 -3
- package/lib/cli/lint/index.js +1 -3
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.js +6 -14
- package/lib/cli/lint/internal.js.map +3 -3
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +1 -3
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +1 -3
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +1 -3
- package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +14 -11
- package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.js +2 -5
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +0 -5
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/prettier.js +2 -2
- package/lib/cli/lint/prettier.js.map +3 -3
- package/lib/cli/migrate/index.d.ts +5 -0
- package/lib/cli/migrate/index.js +38 -6
- package/lib/cli/migrate/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
- package/lib/cli/migrate/nodeVersion/checks.js +24 -133
- package/lib/cli/migrate/nodeVersion/checks.js.map +3 -3
- package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
- package/lib/cli/migrate/nodeVersion/index.js +187 -47
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js +144 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
- package/lib/utils/exec.d.ts +3 -2
- package/lib/utils/exec.js +1 -1
- package/lib/utils/exec.js.map +2 -2
- package/lib/utils/fs.js +1 -1
- package/lib/utils/fs.js.map +2 -2
- package/lib/utils/logging.d.ts +9 -10
- package/lib/utils/logging.js +9 -19
- package/lib/utils/logging.js.map +3 -3
- package/lib/utils/logo.js +11 -18
- package/lib/utils/logo.js.map +3 -3
- package/lib/utils/worker.d.ts +3 -3
- package/lib/wrapper/http.d.ts +0 -6
- package/lib/wrapper/http.js +4 -12
- package/lib/wrapper/http.js.map +2 -2
- package/lib/wrapper/requestListener.js +3 -2
- package/lib/wrapper/requestListener.js.map +2 -2
- package/lib/wrapper/server.d.ts +7 -0
- package/lib/wrapper/server.js +35 -0
- package/lib/wrapper/server.js.map +7 -0
- package/package.json +16 -26
- package/template/base/_pnpm-workspace.yaml +2 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/package.json +6 -6
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/package.json +4 -4
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/package.json +6 -6
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -4
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
- package/template/lambda-sqs-worker-cdk/package.json +5 -4
- package/template/lambda-sqs-worker-cdk/skuba.template.js +12 -0
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -1
- package/template/private-npm-package/skuba.template.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
- package/lib/eslint.d.js +0 -2
- package/lib/eslint.d.js.map +0 -7
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@opentelemetry/api": "^1.9.0",
|
|
23
23
|
"@opentelemetry/core": "^2.0.0",
|
|
24
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
25
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
26
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
24
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.208.0",
|
|
25
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.64.0",
|
|
26
|
+
"@opentelemetry/instrumentation-http": "^0.208.0",
|
|
27
27
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
28
|
-
"@opentelemetry/sdk-node": "^0.
|
|
28
|
+
"@opentelemetry/sdk-node": "^0.208.0",
|
|
29
29
|
"@seek/logger": "^11.1.0",
|
|
30
30
|
"express": "^5.0.0",
|
|
31
31
|
"hot-shots": "^11.0.0",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"skuba": "*",
|
|
41
41
|
"supertest": "^7.0.0"
|
|
42
42
|
},
|
|
43
|
-
"packageManager": "pnpm@10.
|
|
43
|
+
"packageManager": "pnpm@10.24.0",
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
45
|
+
"node": ">=24"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/template/greeter/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"test:watch": "skuba test --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"skuba-dive": "
|
|
22
|
+
"skuba-dive": "4.0.0-node-24-20251204121724"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.13.10",
|
|
26
|
-
"skuba": "14.0.0-
|
|
26
|
+
"skuba": "14.0.0-node-24-20251204121724"
|
|
27
27
|
},
|
|
28
|
-
"packageManager": "pnpm@10.
|
|
28
|
+
"packageManager": "pnpm@10.24.0",
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=24"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"@koa/router": "^14.0.0",
|
|
24
24
|
"@opentelemetry/api": "^1.9.0",
|
|
25
25
|
"@opentelemetry/core": "^2.0.0",
|
|
26
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
27
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
28
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
26
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.208.0",
|
|
27
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.64.0",
|
|
28
|
+
"@opentelemetry/instrumentation-http": "^0.208.0",
|
|
29
29
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
30
|
-
"@opentelemetry/sdk-node": "^0.
|
|
30
|
+
"@opentelemetry/sdk-node": "^0.208.0",
|
|
31
31
|
"@seek/logger": "^11.1.0",
|
|
32
32
|
"hot-shots": "^11.0.0",
|
|
33
33
|
"koa": "^3.0.1",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"skuba": "*",
|
|
50
50
|
"supertest": "^7.0.0"
|
|
51
51
|
},
|
|
52
|
-
"packageManager": "pnpm@10.
|
|
52
|
+
"packageManager": "pnpm@10.24.0",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=24"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -23,7 +23,7 @@ configs:
|
|
|
23
23
|
concurrency: 1
|
|
24
24
|
plugins:
|
|
25
25
|
- *docker-ecr-cache
|
|
26
|
-
- docker-compose#v5.
|
|
26
|
+
- docker-compose#v5.12.1:
|
|
27
27
|
dependencies: false
|
|
28
28
|
environment:
|
|
29
29
|
- GITHUB_API_TOKEN
|
|
@@ -53,7 +53,7 @@ steps:
|
|
|
53
53
|
GET_NPM_TOKEN: please
|
|
54
54
|
plugins:
|
|
55
55
|
- *docker-ecr-cache
|
|
56
|
-
- docker-compose#v5.
|
|
56
|
+
- docker-compose#v5.12.1:
|
|
57
57
|
run: app
|
|
58
58
|
environment:
|
|
59
59
|
- GITHUB_API_TOKEN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -184,7 +184,6 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
184
184
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
185
185
|
"DD_LOGS_INJECTION": "false",
|
|
186
186
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
187
|
-
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
188
187
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
189
188
|
"DD_SERVICE": "serviceName",
|
|
190
189
|
"DD_SITE": "datadoghq.com",
|
|
@@ -920,14 +919,13 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
920
919
|
},
|
|
921
920
|
"Environment": {
|
|
922
921
|
"Variables": {
|
|
923
|
-
"DD_API_KEY_SECRET_ARN": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:
|
|
922
|
+
"DD_API_KEY_SECRET_ARN": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key",
|
|
924
923
|
"DD_CAPTURE_LAMBDA_PAYLOAD": "false",
|
|
925
924
|
"DD_ENV": "production",
|
|
926
925
|
"DD_FLUSH_TO_LOG": "false",
|
|
927
926
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
928
927
|
"DD_LOGS_INJECTION": "false",
|
|
929
928
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
930
|
-
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
931
929
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
932
930
|
"DD_SERVICE": "serviceName",
|
|
933
931
|
"DD_SITE": "datadoghq.com",
|
|
@@ -1384,7 +1382,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1384
1382
|
"secretsmanager:DescribeSecret",
|
|
1385
1383
|
],
|
|
1386
1384
|
"Effect": "Allow",
|
|
1387
|
-
"Resource": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:
|
|
1385
|
+
"Resource": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key-??????",
|
|
1388
1386
|
},
|
|
1389
1387
|
{
|
|
1390
1388
|
"Action": [
|
|
@@ -19,7 +19,7 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
|
|
|
19
19
|
import { config } from './config.js';
|
|
20
20
|
|
|
21
21
|
// Updated by https://github.com/seek-oss/rynovate
|
|
22
|
-
const DATADOG_EXTENSION_LAYER_VERSION =
|
|
22
|
+
const DATADOG_EXTENSION_LAYER_VERSION = 90;
|
|
23
23
|
|
|
24
24
|
// Updated by https://github.com/seek-oss/rynovate
|
|
25
25
|
const DATADOG_NODE_LAYER_VERSION = 126;
|
|
@@ -40,8 +40,7 @@ const configs: Record<Deployment, Config> = {
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
-
datadogApiKeySecretArn:
|
|
44
|
-
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
43
|
+
datadogApiKeySecretArn: '<%- devDataDogApiKeySecretArn %>',
|
|
45
44
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
46
45
|
},
|
|
47
46
|
prod: {
|
|
@@ -57,8 +56,7 @@ const configs: Record<Deployment, Config> = {
|
|
|
57
56
|
},
|
|
58
57
|
},
|
|
59
58
|
|
|
60
|
-
datadogApiKeySecretArn:
|
|
61
|
-
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
59
|
+
datadogApiKeySecretArn: '<%- prodDataDogApiKeySecretArn %>',
|
|
62
60
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
63
61
|
},
|
|
64
62
|
};
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-sdk/client-codedeploy": "^3.363.0",
|
|
22
22
|
"@aws-sdk/client-lambda": "^3.363.0",
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "^3.363.0",
|
|
23
24
|
"@aws-sdk/client-sns": "^3.363.0",
|
|
24
25
|
"@seek/aws-codedeploy-hooks": "^2.0.0",
|
|
25
26
|
"@seek/logger": "^11.1.0",
|
|
26
|
-
"skuba-dive": "
|
|
27
|
+
"skuba-dive": "4.0.0-node-24-20251204121724",
|
|
27
28
|
"zod": "^4.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
@@ -41,10 +42,10 @@
|
|
|
41
42
|
"datadog-lambda-js": "^12.0.0",
|
|
42
43
|
"dd-trace": "^5.0.0",
|
|
43
44
|
"pino-pretty": "^13.0.0",
|
|
44
|
-
"skuba": "14.0.0-
|
|
45
|
+
"skuba": "14.0.0-node-24-20251204121724"
|
|
45
46
|
},
|
|
46
|
-
"packageManager": "pnpm@10.
|
|
47
|
+
"packageManager": "pnpm@10.24.0",
|
|
47
48
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
49
|
+
"node": ">=24"
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -22,6 +22,18 @@ module.exports = {
|
|
|
22
22
|
initial: 'my-team-aws-account-prod:cicd',
|
|
23
23
|
validate: (value) => /^.+:.+$/.test(value),
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
name: 'devDataDogApiKeySecretArn',
|
|
27
|
+
message: 'Dev DataDog API Key Secret ARN',
|
|
28
|
+
initial:
|
|
29
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'prodDataDogApiKeySecretArn',
|
|
33
|
+
message: 'Prod DataDog API Key Secret ARN',
|
|
34
|
+
initial:
|
|
35
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
|
|
36
|
+
},
|
|
25
37
|
],
|
|
26
38
|
packageManager: 'pnpm',
|
|
27
39
|
type: 'application',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24
|
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
|
10
10
|
message: 'Module name',
|
|
11
11
|
initial: '@seek/my-first-module',
|
|
12
12
|
validate: (value) =>
|
|
13
|
-
/^@seek\/.+$/.test(value) || '
|
|
13
|
+
/^@seek\/.+$/.test(value) || 'Must start with @seek/ scope',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
name: 'description',
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var upgradeESLint_exports = {};
|
|
30
|
-
__export(upgradeESLint_exports, {
|
|
31
|
-
tryUpgradeESLint: () => tryUpgradeESLint
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(upgradeESLint_exports);
|
|
34
|
-
var fsp = __toESM(require("fs/promises"));
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
|
-
var import_util = require("util");
|
|
37
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
38
|
-
var import_exec = require("../../../../../../utils/exec.js");
|
|
39
|
-
var import_logging = require("../../../../../../utils/logging.js");
|
|
40
|
-
var import_project = require("../../../../../configure/analysis/project.js");
|
|
41
|
-
var import_configFile = require("../../../../../configure/processing/configFile.js");
|
|
42
|
-
var import_prettier = require("../../../../../configure/processing/prettier.js");
|
|
43
|
-
const IGNORE_FILE = ".eslintignore";
|
|
44
|
-
const OLD_CONFIG_FILE = ".eslintrc.js";
|
|
45
|
-
const NEW_CONFIG_FILE_CJS = "eslint.config.cjs";
|
|
46
|
-
const NEW_CONFIG_FILE_JS = "eslint.config.js";
|
|
47
|
-
const upgradeESLint = async ({
|
|
48
|
-
mode,
|
|
49
|
-
dir: cwd = process.cwd()
|
|
50
|
-
}) => {
|
|
51
|
-
const readFile = (0, import_project.createDestinationFileReader)(cwd);
|
|
52
|
-
const [ignoreFileContents, oldConfig] = await Promise.all([
|
|
53
|
-
readFile(IGNORE_FILE),
|
|
54
|
-
readFile(OLD_CONFIG_FILE)
|
|
55
|
-
]);
|
|
56
|
-
if (oldConfig === void 0) {
|
|
57
|
-
return {
|
|
58
|
-
result: "skip",
|
|
59
|
-
reason: `no ${OLD_CONFIG_FILE} - have you already migrated?`
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (mode === "lint") {
|
|
63
|
-
return { result: "apply" };
|
|
64
|
-
}
|
|
65
|
-
const ignoreContentsWithoutSkubaManaged = (0, import_configFile.mergeWithConfigFile)(
|
|
66
|
-
"",
|
|
67
|
-
"ignore"
|
|
68
|
-
)(ignoreFileContents);
|
|
69
|
-
const exec = (0, import_exec.createExec)({
|
|
70
|
-
cwd: process.cwd(),
|
|
71
|
-
stdio: "ignore"
|
|
72
|
-
});
|
|
73
|
-
const dir = await writeTemporaryFiles({
|
|
74
|
-
[OLD_CONFIG_FILE]: oldConfig,
|
|
75
|
-
...ignoreContentsWithoutSkubaManaged.trim().length > 0 ? { [IGNORE_FILE]: ignoreContentsWithoutSkubaManaged } : {}
|
|
76
|
-
});
|
|
77
|
-
try {
|
|
78
|
-
await exec(
|
|
79
|
-
"eslint-migrate-config",
|
|
80
|
-
import_path.default.join(dir, OLD_CONFIG_FILE),
|
|
81
|
-
"--commonjs"
|
|
82
|
-
);
|
|
83
|
-
const output = fiddleWithOutput(
|
|
84
|
-
await fsp.readFile(import_path.default.join(dir, NEW_CONFIG_FILE_CJS), "utf-8")
|
|
85
|
-
);
|
|
86
|
-
await import_fs_extra.default.promises.writeFile(
|
|
87
|
-
NEW_CONFIG_FILE_JS,
|
|
88
|
-
await (0, import_prettier.formatPrettier)(output, { filepath: NEW_CONFIG_FILE_JS })
|
|
89
|
-
);
|
|
90
|
-
await Promise.all([
|
|
91
|
-
ignoreFileContents === void 0 ? Promise.resolve() : import_fs_extra.default.promises.rm(IGNORE_FILE),
|
|
92
|
-
import_fs_extra.default.promises.rm(OLD_CONFIG_FILE)
|
|
93
|
-
]);
|
|
94
|
-
return { result: "apply" };
|
|
95
|
-
} finally {
|
|
96
|
-
await fsp.rm(dir, { recursive: true });
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const writeTemporaryFiles = async (contents) => {
|
|
100
|
-
const dir = await fsp.mkdtemp("eslint-migrate-config");
|
|
101
|
-
await Promise.all(
|
|
102
|
-
Object.entries(contents).map(
|
|
103
|
-
async ([file, content]) => fsp.writeFile(import_path.default.join(dir, file), content)
|
|
104
|
-
)
|
|
105
|
-
);
|
|
106
|
-
return dir;
|
|
107
|
-
};
|
|
108
|
-
const fiddleWithOutput = (input) => {
|
|
109
|
-
let output = input.replace(/compat.extends\(["']skuba["']\)/, "skuba");
|
|
110
|
-
if (!output.includes("eslint-config-skuba")) {
|
|
111
|
-
output = `const skuba = require('eslint-config-skuba');
|
|
112
|
-
|
|
113
|
-
${output}`;
|
|
114
|
-
}
|
|
115
|
-
if (!output.includes("compat.")) {
|
|
116
|
-
output = output.replace(/const compat = new FlatCompat\(\{[^}]+\}\);/m, "");
|
|
117
|
-
output = output.replace(
|
|
118
|
-
/const \{\s*FlatCompat,?\s*\}\s*=\s*require\(["']@eslint\/eslintrc["']\);/m,
|
|
119
|
-
""
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
if (!output.includes("js.")) {
|
|
123
|
-
output = output.replace(/const js = require\(['"]@eslint\/js['"]\);/, "");
|
|
124
|
-
}
|
|
125
|
-
output = output.replace(
|
|
126
|
-
/^const skuba = require\('eslint-config-skuba'\);\s*module.exports = \[...skuba\];$/m,
|
|
127
|
-
"module.exports = require('eslint-config-skuba');"
|
|
128
|
-
);
|
|
129
|
-
return output;
|
|
130
|
-
};
|
|
131
|
-
const tryUpgradeESLint = async (config) => {
|
|
132
|
-
try {
|
|
133
|
-
return await upgradeESLint(config);
|
|
134
|
-
} catch (err) {
|
|
135
|
-
import_logging.log.warn("Failed to upgrade ESLint to flat config.");
|
|
136
|
-
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
137
|
-
return { result: "skip", reason: "due to an error" };
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
141
|
-
0 && (module.exports = {
|
|
142
|
-
tryUpgradeESLint
|
|
143
|
-
});
|
|
144
|
-
//# sourceMappingURL=upgradeESLint.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.ts"],
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line no-restricted-imports -- fs-extra is mocked\nimport * as fsp from 'fs/promises';\nimport path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport { createExec } from '../../../../../../utils/exec.js';\nimport { log } from '../../../../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project.js';\nimport { mergeWithConfigFile } from '../../../../../configure/processing/configFile.js';\nimport { formatPrettier } from '../../../../../configure/processing/prettier.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst IGNORE_FILE = '.eslintignore';\nconst OLD_CONFIG_FILE = '.eslintrc.js';\nconst NEW_CONFIG_FILE_CJS = 'eslint.config.cjs';\nconst NEW_CONFIG_FILE_JS = 'eslint.config.js';\n\nconst upgradeESLint: PatchFunction = async ({\n mode,\n dir: cwd = process.cwd(),\n}): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(cwd);\n const [ignoreFileContents, oldConfig] = await Promise.all([\n readFile(IGNORE_FILE),\n readFile(OLD_CONFIG_FILE),\n ]);\n\n if (oldConfig === undefined) {\n return {\n result: 'skip',\n reason: `no ${OLD_CONFIG_FILE} - have you already migrated?`,\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n const ignoreContentsWithoutSkubaManaged = mergeWithConfigFile(\n '',\n 'ignore',\n )(ignoreFileContents);\n\n const exec = createExec({\n cwd: process.cwd(),\n stdio: 'ignore',\n });\n\n // eslint-migrate-config require()s the file, so for testability, put it in a temporary location\n const dir = await writeTemporaryFiles({\n [OLD_CONFIG_FILE]: oldConfig,\n ...(ignoreContentsWithoutSkubaManaged.trim().length > 0\n ? { [IGNORE_FILE]: ignoreContentsWithoutSkubaManaged }\n : {}),\n });\n try {\n await exec(\n 'eslint-migrate-config',\n path.join(dir, OLD_CONFIG_FILE),\n '--commonjs',\n );\n\n const output = fiddleWithOutput(\n await fsp.readFile(path.join(dir, NEW_CONFIG_FILE_CJS), 'utf-8'),\n );\n await fs.promises.writeFile(\n NEW_CONFIG_FILE_JS,\n await formatPrettier(output, { filepath: NEW_CONFIG_FILE_JS }),\n );\n\n await Promise.all([\n ignoreFileContents === undefined\n ? Promise.resolve()\n : fs.promises.rm(IGNORE_FILE),\n fs.promises.rm(OLD_CONFIG_FILE),\n ]);\n\n return { result: 'apply' };\n } finally {\n await fsp.rm(dir, { recursive: true });\n }\n};\n\nconst writeTemporaryFiles = async (contents: Record<string, string>) => {\n const dir = await fsp.mkdtemp('eslint-migrate-config');\n\n await Promise.all(\n Object.entries(contents).map(async ([file, content]) =>\n fsp.writeFile(path.join(dir, file), content),\n ),\n );\n\n return dir;\n};\n\nconst fiddleWithOutput = (input: string) => {\n let output = input.replace(/compat.extends\\([\"']skuba[\"']\\)/, 'skuba');\n\n if (!output.includes('eslint-config-skuba')) {\n output = `const skuba = require('eslint-config-skuba');\\n\\n${output}`;\n }\n\n if (!output.includes('compat.')) {\n output = output.replace(/const compat = new FlatCompat\\(\\{[^}]+\\}\\);/m, '');\n output = output.replace(\n /const \\{\\s*FlatCompat,?\\s*\\}\\s*=\\s*require\\([\"']@eslint\\/eslintrc[\"']\\);/m,\n '',\n );\n }\n\n if (!output.includes('js.')) {\n output = output.replace(/const js = require\\(['\"]@eslint\\/js['\"]\\);/, '');\n }\n\n output = output.replace(\n /^const skuba = require\\('eslint-config-skuba'\\);\\s*module.exports = \\[...skuba\\];$/m,\n \"module.exports = require('eslint-config-skuba');\",\n );\n\n return output;\n};\n\nexport const tryUpgradeESLint: PatchFunction = async (config) => {\n try {\n return await upgradeESLint(config);\n } catch (err) {\n log.warn('Failed to upgrade ESLint to flat config.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["path", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { nodeVersionMigration } from '../../../../../migrate/nodeVersion/index.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst upgradeNode: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n if (process.env.SKIP_NODE_UPGRADE) {\n return {\n result: 'skip',\n reason: 'SKIP_NODE_UPGRADE environment variable set',\n };\n }\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await nodeVersionMigration({\n nodeVersion: 22,\n ECMAScriptVersion: 'ES2024',\n });\n\n return { result: 'apply' };\n};\n\nexport const tryUpgradeNode: PatchFunction = async (config) => {\n try {\n return await upgradeNode(config);\n } catch (err) {\n log.warn('Failed to upgrade node version');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,qBAAoB;AACpB,yBAAqC;AAGrC,MAAM,cAA6B,OAAO;AAAA,EACxC;AACF,MAAgC;AAC9B,MAAI,QAAQ,IAAI,mBAAmB;AACjC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AACA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,YAAM,yCAAqB;AAAA,IACzB,aAAa;AAAA,IACb,mBAAmB;AAAA,EACrB,CAAC;AAED,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,iBAAgC,OAAO,WAAW;AAC7D,MAAI;AACF,WAAO,MAAM,YAAY,MAAM;AAAA,EACjC,SAAS,KAAK;AACZ,uBAAI,KAAK,gCAAgC;AACzC,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/lib/eslint.d.js
DELETED
package/lib/eslint.d.js.map
DELETED
|
File without changes
|
|
File without changes
|