skuba 12.0.0-enforce-file-extensions-20250618112549 → 12.0.0-subpath-imports-20250710010820
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/config/tsconfig.json +4 -3
- package/jest/transform.js +1 -15
- package/jest-preset.js +4 -7
- package/lib/cli/buildPackage/index.js +2 -2
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
- package/lib/cli/configure/processing/prettier.d.ts +1 -1
- package/lib/cli/configure/processing/prettier.js +8 -6
- package/lib/cli/configure/processing/prettier.js.map +3 -3
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +7 -5
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/prompts.d.ts +5 -5
- package/lib/cli/init/prompts.js +5 -4
- package/lib/cli/init/prompts.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js +35 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.d.ts +6 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js +104 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js.map +7 -0
- package/lib/cli/migrate/nodeVersion/index.js +18 -18
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/package.json +33 -26
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +2 -0
- package/template/base/jest.config.ts +17 -3
- package/template/base/jest.setup.ts +0 -2
- package/template/base/tsconfig.json +3 -3
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/package.json +8 -1
- package/template/express-rest-api/src/app.ts +0 -2
- package/template/express-rest-api/src/framework/logging.ts +1 -1
- package/template/express-rest-api/src/framework/metrics.ts +2 -2
- package/template/express-rest-api/src/listen.ts +0 -2
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/package.json +10 -3
- package/template/greeter/src/app.ts +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/package.json +14 -7
- package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
- package/template/koa-rest-api/src/api/jobs/index.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +4 -4
- package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
- package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
- package/template/koa-rest-api/src/app.test.ts +2 -2
- package/template/koa-rest-api/src/app.ts +0 -2
- package/template/koa-rest-api/src/config.ts +1 -1
- package/template/koa-rest-api/src/framework/logging.ts +22 -13
- package/template/koa-rest-api/src/framework/metrics.ts +2 -2
- package/template/koa-rest-api/src/framework/server.test.ts +95 -64
- package/template/koa-rest-api/src/framework/server.ts +3 -3
- package/template/koa-rest-api/src/framework/validation.test.ts +36 -36
- package/template/koa-rest-api/src/framework/validation.ts +15 -22
- package/template/koa-rest-api/src/listen.ts +0 -2
- package/template/koa-rest-api/src/register.ts +0 -1
- package/template/koa-rest-api/src/storage/jobs.ts +1 -1
- package/template/koa-rest-api/src/testing/metrics.ts +1 -1
- package/template/koa-rest-api/src/testing/server.ts +1 -1
- package/template/koa-rest-api/src/testing/types.ts +2 -2
- package/template/koa-rest-api/src/types/jobs.ts +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +6 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +13 -6
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +81 -22
- package/template/lambda-sqs-worker-cdk/src/app.ts +7 -9
- package/template/lambda-sqs-worker-cdk/src/config.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +38 -18
- package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -12
- package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +9 -12
- package/template/lambda-sqs-worker-cdk/src/framework/validation.ts +3 -7
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +7 -6
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/types/jobScorer.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/types/pipelineEvents.ts +1 -1
- package/template/lambda-sqs-worker-cdk/tsconfig.json +3 -3
- package/template/oss-npm-package/_package.json +8 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/tsconfig.json +3 -0
- package/template/private-npm-package/_package.json +7 -0
- package/lib/cli/test/reporters/prettier/index.d.ts +0 -4
- package/lib/cli/test/reporters/prettier/index.js +0 -67
- package/lib/cli/test/reporters/prettier/index.js.map +0 -7
- package/template/express-rest-api/src/register.ts +0 -1
- package/template/koa-rest-api/src/testing/logging.ts +0 -16
- package/template/koa-rest-api/tsconfig.json +0 -18
- package/template/lambda-sqs-worker-cdk/src/testing/logging.ts +0 -19
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
"name": "<%- moduleName %>",
|
|
3
3
|
"version": "0.0.0-semantically-released",
|
|
4
4
|
"description": "<%- description %>",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": {
|
|
7
|
+
"types": "./src/*",
|
|
8
|
+
"import": "./lib/*",
|
|
9
|
+
"require": "./lib/*"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
5
12
|
"repository": {
|
|
6
13
|
"type": "git",
|
|
7
14
|
"url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
|
|
@@ -1,67 +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 prettier_exports = {};
|
|
30
|
-
__export(prettier_exports, {
|
|
31
|
-
default: () => SnapshotPrettifier
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(prettier_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_prettier = require("prettier");
|
|
36
|
-
var import_prettier2 = require("../../../../cli/adapter/prettier.js");
|
|
37
|
-
class SnapshotPrettifier {
|
|
38
|
-
async onTestFileResult(...[test, testResult]) {
|
|
39
|
-
if (!testResult.snapshot.added && !testResult.snapshot.updated) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const filepath = test.path;
|
|
43
|
-
try {
|
|
44
|
-
const [config, data] = await Promise.all([
|
|
45
|
-
(0, import_prettier.resolveConfig)(filepath),
|
|
46
|
-
import_fs_extra.default.promises.readFile(filepath, "utf-8")
|
|
47
|
-
]);
|
|
48
|
-
const formatted = await (0, import_prettier2.formatOrLintFile)(
|
|
49
|
-
{
|
|
50
|
-
data,
|
|
51
|
-
filepath,
|
|
52
|
-
options: {
|
|
53
|
-
...config,
|
|
54
|
-
filepath
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"format",
|
|
58
|
-
null
|
|
59
|
-
);
|
|
60
|
-
if (typeof formatted === "string") {
|
|
61
|
-
await import_fs_extra.default.promises.writeFile(filepath, formatted);
|
|
62
|
-
}
|
|
63
|
-
} catch {
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/cli/test/reporters/prettier/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Reporter } from '@jest/reporters';\nimport fs from 'fs-extra';\nimport { resolveConfig } from 'prettier';\n\nimport { formatOrLintFile } from '../../../../cli/adapter/prettier.js';\n\nexport default class SnapshotPrettifier\n implements Pick<Reporter, 'onTestFileResult'>\n{\n async onTestFileResult(\n ...[test, testResult]: Parameters<NonNullable<Reporter['onTestFileResult']>>\n ): Promise<void> {\n if (!testResult.snapshot.added && !testResult.snapshot.updated) {\n return;\n }\n\n const filepath = test.path;\n\n // This is a best-effort workaround to automatically format code.\n // Don't pollute console output if it fails for whatever reason.\n try {\n const [config, data] = await Promise.all([\n resolveConfig(filepath),\n fs.promises.readFile(filepath, 'utf-8'),\n ]);\n\n const formatted = await formatOrLintFile(\n {\n data,\n filepath,\n options: {\n ...config,\n filepath,\n },\n },\n 'format',\n null,\n );\n\n if (typeof formatted === 'string') {\n await fs.promises.writeFile(filepath, formatted);\n }\n } catch {}\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAe;AACf,sBAA8B;AAE9B,IAAAA,mBAAiC;AAEjC,MAAO,mBAEP;AAAA,EACE,MAAM,oBACD,CAAC,MAAM,UAAU,GACL;AACf,QAAI,CAAC,WAAW,SAAS,SAAS,CAAC,WAAW,SAAS,SAAS;AAC9D;AAAA,IACF;AAEA,UAAM,WAAW,KAAK;AAItB,QAAI;AACF,YAAM,CAAC,QAAQ,IAAI,IAAI,MAAM,QAAQ,IAAI;AAAA,YACvC,+BAAc,QAAQ;AAAA,QACtB,gBAAAC,QAAG,SAAS,SAAS,UAAU,OAAO;AAAA,MACxC,CAAC;AAED,YAAM,YAAY,UAAM;AAAA,QACtB;AAAA,UACE;AAAA,UACA;AAAA,UACA,SAAS;AAAA,YACP,GAAG;AAAA,YACH;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,UAAI,OAAO,cAAc,UAAU;AACjC,cAAM,gBAAAA,QAAG,SAAS,UAAU,UAAU,SAAS;AAAA,MACjD;AAAA,IACF,QAAQ;AAAA,IAAC;AAAA,EACX;AACF;",
|
|
6
|
-
"names": ["import_prettier", "fs"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'skuba-dive/register';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as logging from 'src/framework/logging.js';
|
|
2
|
-
|
|
3
|
-
export const logger = {
|
|
4
|
-
error: jest.fn(),
|
|
5
|
-
info: jest.fn(),
|
|
6
|
-
|
|
7
|
-
clear: () => {
|
|
8
|
-
logger.error.mockClear();
|
|
9
|
-
logger.info.mockClear();
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
spy: () => {
|
|
13
|
-
jest.spyOn(logging.logger, 'error').mockImplementation(logger.error);
|
|
14
|
-
jest.spyOn(logging.logger, 'info').mockImplementation(logger.info);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"baseUrl": ".",
|
|
4
|
-
"lib": [
|
|
5
|
-
// open-telemetry/opentelemetry-js#3580
|
|
6
|
-
"DOM",
|
|
7
|
-
|
|
8
|
-
"ES2024"
|
|
9
|
-
],
|
|
10
|
-
"outDir": "lib",
|
|
11
|
-
"paths": {
|
|
12
|
-
"src": ["src"]
|
|
13
|
-
},
|
|
14
|
-
"target": "ES2024"
|
|
15
|
-
},
|
|
16
|
-
"exclude": ["lib*/**/*"],
|
|
17
|
-
"extends": "skuba/config/tsconfig.json"
|
|
18
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as logging from 'src/framework/logging.js';
|
|
2
|
-
|
|
3
|
-
export const logger = {
|
|
4
|
-
error: jest.fn(),
|
|
5
|
-
info: jest.fn(),
|
|
6
|
-
debug: jest.fn(),
|
|
7
|
-
|
|
8
|
-
clear: () => {
|
|
9
|
-
logger.error.mockClear();
|
|
10
|
-
logger.info.mockClear();
|
|
11
|
-
logger.debug.mockClear();
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
spy: () => {
|
|
15
|
-
jest.spyOn(logging.logger, 'error').mockImplementation(logger.error);
|
|
16
|
-
jest.spyOn(logging.logger, 'info').mockImplementation(logger.info);
|
|
17
|
-
jest.spyOn(logging.logger, 'debug').mockImplementation(logger.debug);
|
|
18
|
-
},
|
|
19
|
-
};
|