skuba 12.0.0-enable-js-extensions-20250704134302 → 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.
Files changed (73) hide show
  1. package/config/tsconfig.json +4 -3
  2. package/lib/cli/buildPackage/index.js +2 -2
  3. package/lib/cli/buildPackage/index.js.map +1 -1
  4. package/lib/cli/configure/ensureTemplateCompletion.js +1 -1
  5. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  6. package/lib/cli/init/getConfig.d.ts +1 -1
  7. package/lib/cli/init/getConfig.js +7 -5
  8. package/lib/cli/init/getConfig.js.map +3 -3
  9. package/lib/cli/init/prompts.d.ts +5 -5
  10. package/lib/cli/init/prompts.js +5 -4
  11. package/lib/cli/init/prompts.js.map +3 -3
  12. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.d.ts +2 -0
  13. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js +35 -0
  14. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js.map +7 -0
  15. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.d.ts +6 -0
  16. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js +104 -0
  17. package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js.map +7 -0
  18. package/package.json +11 -4
  19. package/template/base/_.prettierrc.js +1 -1
  20. package/template/base/_eslint.config.js +1 -1
  21. package/template/base/_pnpm-workspace.yaml +2 -0
  22. package/template/base/jest.config.ts +17 -3
  23. package/template/base/jest.setup.ts +0 -2
  24. package/template/base/tsconfig.json +3 -3
  25. package/template/express-rest-api/package.json +7 -0
  26. package/template/express-rest-api/src/app.ts +0 -2
  27. package/template/express-rest-api/src/framework/logging.ts +1 -1
  28. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  29. package/template/express-rest-api/src/listen.ts +0 -2
  30. package/template/greeter/package.json +9 -2
  31. package/template/greeter/src/app.ts +2 -2
  32. package/template/koa-rest-api/package.json +7 -0
  33. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  34. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  35. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  36. package/template/koa-rest-api/src/api/jobs/index.ts +2 -2
  37. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -3
  38. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  39. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  40. package/template/koa-rest-api/src/app.test.ts +2 -2
  41. package/template/koa-rest-api/src/app.ts +0 -2
  42. package/template/koa-rest-api/src/framework/logging.ts +1 -1
  43. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  44. package/template/koa-rest-api/src/framework/server.test.ts +5 -5
  45. package/template/koa-rest-api/src/framework/server.ts +3 -3
  46. package/template/koa-rest-api/src/framework/validation.test.ts +5 -5
  47. package/template/koa-rest-api/src/framework/validation.ts +1 -1
  48. package/template/koa-rest-api/src/listen.ts +0 -2
  49. package/template/koa-rest-api/src/register.ts +0 -1
  50. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  51. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  52. package/template/koa-rest-api/src/testing/server.ts +1 -1
  53. package/template/koa-rest-api/src/testing/types.ts +1 -1
  54. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +1 -1
  55. package/template/lambda-sqs-worker-cdk/package.json +9 -2
  56. package/template/lambda-sqs-worker-cdk/src/app.test.ts +5 -5
  57. package/template/lambda-sqs-worker-cdk/src/app.ts +7 -9
  58. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +3 -3
  59. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  60. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +1 -1
  61. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  62. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +3 -3
  63. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  64. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +7 -6
  65. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  66. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  67. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  68. package/template/lambda-sqs-worker-cdk/tsconfig.json +3 -3
  69. package/template/oss-npm-package/_package.json +8 -0
  70. package/template/oss-npm-package/skuba.template.js +1 -1
  71. package/template/oss-npm-package/tsconfig.json +3 -0
  72. package/template/private-npm-package/_package.json +7 -0
  73. package/template/express-rest-api/src/register.ts +0 -1
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import express from 'express';
4
2
 
5
3
  import { healthCheckHandler } from './api/healthCheck.js';
@@ -1,6 +1,6 @@
1
1
  import createLogger from '@seek/logger';
2
2
 
3
- import { config } from 'src/config.js';
3
+ import { config } from '#src/config.js';
4
4
 
5
5
  export const logger = createLogger({
6
6
  base: {
@@ -1,10 +1,10 @@
1
1
  import { StatsD } from 'hot-shots';
2
2
  import { createStatsDClient } from 'seek-datadog-custom-metrics';
3
3
 
4
- import { config } from 'src/config.js';
5
-
6
4
  import { logger } from './logging.js';
7
5
 
6
+ import { config } from '#src/config.js';
7
+
8
8
  /* istanbul ignore next: StatsD client is not our responsibility */
9
9
  export const metricsClient = createStatsDClient(StatsD, config, (err) =>
10
10
  logger.error({ err }, 'StatsD error'),
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import app from './app.js';
4
2
  import { config } from './config.js';
5
3
  import { logger } from './framework/logging.js';
@@ -2,6 +2,13 @@
2
2
  "name": "@seek/greeter",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "types": "./src/*",
8
+ "import": "./lib/*",
9
+ "require": "./lib/*"
10
+ }
11
+ },
5
12
  "scripts": {
6
13
  "build": "skuba build",
7
14
  "format": "skuba format",
@@ -13,11 +20,11 @@
13
20
  "test:watch": "skuba test --watch"
14
21
  },
15
22
  "dependencies": {
16
- "skuba-dive": "^2.0.0"
23
+ "skuba-dive": "2.1.0-subpath-imports-20250710010820"
17
24
  },
18
25
  "devDependencies": {
19
26
  "@types/node": "^22.13.10",
20
- "skuba": "12.0.0-enable-js-extensions-20250704134302"
27
+ "skuba": "12.0.0-subpath-imports-20250710010820"
21
28
  },
22
29
  "packageManager": "pnpm@10.12.4",
23
30
  "engines": {
@@ -1,4 +1,4 @@
1
- import 'skuba-dive/register';
2
-
3
1
  /* eslint-disable-next-line no-console */
4
2
  console.log('Hello world');
3
+
4
+ export {};
@@ -2,6 +2,13 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "types": "./src/*",
8
+ "import": "./lib/*",
9
+ "require": "./lib/*"
10
+ }
11
+ },
5
12
  "scripts": {
6
13
  "build": "skuba build",
7
14
  "format": "skuba format",
@@ -1,4 +1,4 @@
1
- import type { Middleware } from 'src/types/koa.js';
1
+ import type { Middleware } from '#src/types/koa.js';
2
2
 
3
3
  /**
4
4
  * Signifies that the API is available to serve requests.
@@ -1,7 +1,7 @@
1
- import { agentFromRouter } from 'src/testing/server.js';
2
-
3
1
  import { jobRouter } from './index.js';
4
2
 
3
+ import { agentFromRouter } from '#src/testing/server.js';
4
+
5
5
  const agent = agentFromRouter(jobRouter);
6
6
 
7
7
  describe('getJobsHandler', () => {
@@ -1,7 +1,7 @@
1
- import { logger } from 'src/framework/logging.js';
2
- import { metricsClient } from 'src/framework/metrics.js';
3
- import * as storage from 'src/storage/jobs.js';
4
- import type { Middleware } from 'src/types/koa.js';
1
+ import { logger } from '#src/framework/logging.js';
2
+ import { metricsClient } from '#src/framework/metrics.js';
3
+ import * as storage from '#src/storage/jobs.js';
4
+ import type { Middleware } from '#src/types/koa.js';
5
5
 
6
6
  export const getJobsHandler: Middleware = async (ctx) => {
7
7
  const jobs = await storage.readJobs();
@@ -1,10 +1,10 @@
1
1
  import Router from '@koa/router';
2
2
 
3
- import { jsonBodyParser } from 'src/framework/bodyParser.js';
4
-
5
3
  import { getJobsHandler } from './getJobs.js';
6
4
  import { postJobHandler } from './postJob.js';
7
5
 
6
+ import { jsonBodyParser } from '#src/framework/bodyParser.js';
7
+
8
8
  export const jobRouter = new Router()
9
9
  .get('/', getJobsHandler)
10
10
  .post('/', jsonBodyParser, postJobHandler);
@@ -1,8 +1,8 @@
1
- import { agentFromRouter } from 'src/testing/server.js';
2
- import { mockJobInput } from 'src/testing/types.js';
3
-
4
1
  import { jobRouter } from './index.js';
5
2
 
3
+ import { agentFromRouter } from '#src/testing/server.js';
4
+ import { mockJobInput } from '#src/testing/types.js';
5
+
6
6
  const agent = agentFromRouter(jobRouter);
7
7
 
8
8
  describe('postJobHandler', () => {
@@ -1,9 +1,9 @@
1
- import { logger } from 'src/framework/logging.js';
2
- import { metricsClient } from 'src/framework/metrics.js';
3
- import { validateRequestBody } from 'src/framework/validation.js';
4
- import * as storage from 'src/storage/jobs.js';
5
- import { JobInputSchema } from 'src/types/jobs.js';
6
- import type { Middleware } from 'src/types/koa.js';
1
+ import { logger } from '#src/framework/logging.js';
2
+ import { metricsClient } from '#src/framework/metrics.js';
3
+ import { validateRequestBody } from '#src/framework/validation.js';
4
+ import * as storage from '#src/storage/jobs.js';
5
+ import { JobInputSchema } from '#src/types/jobs.js';
6
+ import type { Middleware } from '#src/types/koa.js';
7
7
 
8
8
  export const postJobHandler: Middleware = async (ctx) => {
9
9
  const jobInput = validateRequestBody(ctx, JobInputSchema);
@@ -1,5 +1,5 @@
1
- import { smokeTestJobStorage } from 'src/storage/jobs.js';
2
- import type { Middleware } from 'src/types/koa.js';
1
+ import { smokeTestJobStorage } from '#src/storage/jobs.js';
2
+ import type { Middleware } from '#src/types/koa.js';
3
3
 
4
4
  /**
5
5
  * Tests connectivity to ensure appropriate access and network configuration.
@@ -1,7 +1,7 @@
1
- import { agentFromApp } from 'src/testing/server.js';
2
-
3
1
  import app from './app.js';
4
2
 
3
+ import { agentFromApp } from '#src/testing/server.js';
4
+
5
5
  const agent = agentFromApp(app);
6
6
 
7
7
  describe('app', () => {
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import { router } from './api/index.js';
4
2
  import { createApp } from './framework/server.js';
5
3
 
@@ -1,7 +1,7 @@
1
1
  import createLogger, { createDestination } from '@seek/logger';
2
2
  import { RequestLogging } from 'seek-koala';
3
3
 
4
- import { config } from 'src/config.js';
4
+ import { config } from '#src/config.js';
5
5
 
6
6
  const { createContextMiddleware, mixin } =
7
7
  RequestLogging.createContextStorage();
@@ -1,10 +1,10 @@
1
1
  import { StatsD } from 'hot-shots';
2
2
  import { createStatsDClient } from 'seek-datadog-custom-metrics';
3
3
 
4
- import { config } from 'src/config.js';
5
-
6
4
  import { logger } from './logging.js';
7
5
 
6
+ import { config } from '#src/config.js';
7
+
8
8
  /* istanbul ignore next: StatsD client is not our responsibility */
9
9
  export const metricsClient = createStatsDClient(StatsD, config, (err) =>
10
10
  logger.error({ err }, 'StatsD error'),
@@ -1,12 +1,12 @@
1
1
  import Router from '@koa/router';
2
2
 
3
- import { metricsClient } from 'src/testing/metrics.js';
4
- import { agentFromRouter } from 'src/testing/server.js';
5
- import { chance } from 'src/testing/types.js';
6
- import type { Middleware } from 'src/types/koa.js';
7
-
8
3
  import { stdoutMock } from './logging.js';
9
4
 
5
+ import { metricsClient } from '#src/testing/metrics.js';
6
+ import { agentFromRouter } from '#src/testing/server.js';
7
+ import { chance } from '#src/testing/types.js';
8
+ import type { Middleware } from '#src/types/koa.js';
9
+
10
10
  const middleware = jest.fn<void, Parameters<Middleware>>();
11
11
 
12
12
  const router = new Router()
@@ -8,9 +8,9 @@ import {
8
8
  VersionMiddleware,
9
9
  } from 'seek-koala';
10
10
 
11
- import { config } from 'src/config.js';
12
- import { contextMiddleware, logger } from 'src/framework/logging.js';
13
- import { metricsClient } from 'src/framework/metrics.js';
11
+ import { config } from '#src/config.js';
12
+ import { contextMiddleware, logger } from '#src/framework/logging.js';
13
+ import { metricsClient } from '#src/framework/metrics.js';
14
14
 
15
15
  const metrics = MetricsMiddleware.create(
16
16
  metricsClient,
@@ -1,12 +1,12 @@
1
- import { agentFromMiddleware } from 'src/testing/server.js';
1
+ import { jsonBodyParser } from './bodyParser.js';
2
+ import { validate } from './validation.js';
3
+
4
+ import { agentFromMiddleware } from '#src/testing/server.js';
2
5
  import {
3
6
  IdDescriptionSchema,
4
7
  chance,
5
8
  mockIdDescription,
6
- } from 'src/testing/types.js';
7
-
8
- import { jsonBodyParser } from './bodyParser.js';
9
- import { validate } from './validation.js';
9
+ } from '#src/testing/types.js';
10
10
 
11
11
  const agent = agentFromMiddleware(jsonBodyParser, (ctx) => {
12
12
  const result = validate({
@@ -1,7 +1,7 @@
1
1
  import { ErrorMiddleware } from 'seek-koala';
2
2
  import type { core, z } from 'zod/v4';
3
3
 
4
- import type { Context } from 'src/types/koa.js';
4
+ import type { Context } from '#src/types/koa.js';
5
5
 
6
6
  type InvalidFields = Record<string, string>;
7
7
 
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import app from './app.js';
4
2
  import { config } from './config.js';
5
3
  import { logger } from './framework/logging.js';
@@ -1 +0,0 @@
1
- import 'skuba-dive/register';
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'crypto';
2
2
 
3
- import type { Job, JobInput } from 'src/types/jobs.js';
3
+ import type { Job, JobInput } from '#src/types/jobs.js';
4
4
 
5
5
  const jobStore: Record<string, Job> = {};
6
6
 
@@ -1,4 +1,4 @@
1
- import * as metrics from 'src/framework/metrics.js';
1
+ import * as metrics from '#src/framework/metrics.js';
2
2
 
3
3
  function assertDefined<T>(value: T | undefined): asserts value is T {
4
4
  expect(value).toBeDefined();
@@ -2,7 +2,7 @@ import type Router from '@koa/router';
2
2
  import type Koa from 'koa';
3
3
  import request from 'supertest';
4
4
 
5
- import { createApp } from 'src/framework/server.js';
5
+ import { createApp } from '#src/framework/server.js';
6
6
 
7
7
  /**
8
8
  * Create a new SuperTest agent from a Koa application.
@@ -1,7 +1,7 @@
1
1
  import { Chance } from 'chance';
2
2
  import { z } from 'zod/v4';
3
3
 
4
- import type { JobInput } from 'src/types/jobs.js';
4
+ import type { JobInput } from '#src/types/jobs.js';
5
5
 
6
6
  export type IdDescription = z.infer<typeof IdDescriptionSchema>;
7
7
 
@@ -33,7 +33,7 @@ it.each(['dev', 'prod'])(
33
33
  process.env.ENVIRONMENT = env;
34
34
  process.env.VERSION = 'local';
35
35
 
36
- const { AppStack } = await import('./appStack');
36
+ const { AppStack } = await import('./appStack.js');
37
37
 
38
38
  jest
39
39
  .spyOn(aws_sns.Topic, 'fromTopicArn')
@@ -2,6 +2,13 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "types": "./src/*",
8
+ "import": "./lib/*",
9
+ "require": "./lib/*"
10
+ }
11
+ },
5
12
  "scripts": {
6
13
  "deploy": "cdk deploy appStack --require-approval never",
7
14
  "deploy:hotswap": "pnpm --silent run deploy --hotswap",
@@ -21,7 +28,7 @@
21
28
  "@seek/logger": "^10.0.0",
22
29
  "datadog-lambda-js": "^10.0.0",
23
30
  "dd-trace": "^5.0.0",
24
- "skuba-dive": "^2.0.0",
31
+ "skuba-dive": "2.1.0-subpath-imports-20250710010820",
25
32
  "zod": "^3.25.67"
26
33
  },
27
34
  "devDependencies": {
@@ -37,7 +44,7 @@
37
44
  "constructs": "^10.0.17",
38
45
  "datadog-cdk-constructs-v2": "^2.0.0",
39
46
  "pino-pretty": "^13.0.0",
40
- "skuba": "12.0.0-enable-js-extensions-20250704134302"
47
+ "skuba": "12.0.0-subpath-imports-20250710010820"
41
48
  },
42
49
  "packageManager": "pnpm@10.12.4",
43
50
  "engines": {
@@ -1,13 +1,13 @@
1
1
  import { PublishCommand } from '@aws-sdk/client-sns';
2
2
 
3
- import { metricsClient } from 'src/framework/metrics.js';
4
- import { createCtx, createSqsEvent } from 'src/testing/handler.js';
5
- import { scoringService, sns } from 'src/testing/services.js';
6
- import { chance, mockJobPublishedEvent } from 'src/testing/types.js';
7
-
8
3
  import * as app from './app.js';
9
4
  import { stdoutMock } from './framework/logging.js';
10
5
 
6
+ import { metricsClient } from '#src/framework/metrics.js';
7
+ import { createCtx, createSqsEvent } from '#src/testing/handler.js';
8
+ import { scoringService, sns } from '#src/testing/services.js';
9
+ import { chance, mockJobPublishedEvent } from '#src/testing/types.js';
10
+
11
11
  describe('app', () => {
12
12
  it('exports a handler', () => expect(app).toHaveProperty('handler'));
13
13
  });
@@ -1,18 +1,16 @@
1
- import 'skuba-dive/register';
2
-
3
1
  import { isLambdaHook } from '@seek/aws-codedeploy-hooks';
4
2
  import type { SQSEvent } from 'aws-lambda';
5
3
 
6
- import { createHandler } from 'src/framework/handler.js';
7
- import { logger } from 'src/framework/logging.js';
8
- import { metricsClient } from 'src/framework/metrics.js';
9
- import { validateJson } from 'src/framework/validation.js';
4
+ import { createHandler } from '#src/framework/handler.js';
5
+ import { logger } from '#src/framework/logging.js';
6
+ import { metricsClient } from '#src/framework/metrics.js';
7
+ import { validateJson } from '#src/framework/validation.js';
10
8
  import {
11
9
  scoreJobPublishedEvent,
12
10
  scoringService,
13
- } from 'src/services/jobScorer.js';
14
- import { sendPipelineEvent } from 'src/services/pipelineEventSender.js';
15
- import { JobPublishedEventSchema } from 'src/types/pipelineEvents.js';
11
+ } from '#src/services/jobScorer.js';
12
+ import { sendPipelineEvent } from '#src/services/pipelineEventSender.js';
13
+ import { JobPublishedEventSchema } from '#src/types/pipelineEvents.js';
16
14
 
17
15
  /**
18
16
  * Tests connectivity to ensure appropriate access and network configuration.
@@ -1,9 +1,9 @@
1
- import { createCtx } from 'src/testing/handler.js';
2
- import { chance } from 'src/testing/types.js';
3
-
4
1
  import { createHandler } from './handler.js';
5
2
  import { logger, stdoutMock } from './logging.js';
6
3
 
4
+ import { createCtx } from '#src/testing/handler.js';
5
+ import { chance } from '#src/testing/types.js';
6
+
7
7
  describe('createHandler', () => {
8
8
  const ctx = createCtx();
9
9
  const input = chance.paragraph();
@@ -1,8 +1,8 @@
1
1
  import type { Context as LambdaContext } from 'aws-lambda';
2
2
  import { datadog } from 'datadog-lambda-js';
3
3
 
4
- import { config } from 'src/config.js';
5
- import { logger, loggerContext } from 'src/framework/logging.js';
4
+ import { config } from '#src/config.js';
5
+ import { logger, loggerContext } from '#src/framework/logging.js';
6
6
 
7
7
  type Handler<Event, Output> = (
8
8
  event: Event,
@@ -2,7 +2,7 @@ import { AsyncLocalStorage } from 'async_hooks';
2
2
 
3
3
  import createLogger, { createDestination } from '@seek/logger';
4
4
 
5
- import { config } from 'src/config.js';
5
+ import { config } from '#src/config.js';
6
6
 
7
7
  interface LoggerContext {
8
8
  awsRequestId: string;
@@ -1,6 +1,6 @@
1
1
  import { sendDistributionMetric } from 'datadog-lambda-js';
2
2
 
3
- import { config } from 'src/config.js';
3
+ import { config } from '#src/config.js';
4
4
 
5
5
  const prefix = `${config.name}.`;
6
6
 
@@ -1,10 +1,10 @@
1
+ import { validateJson } from './validation.js';
2
+
1
3
  import {
2
4
  IdDescriptionSchema,
3
5
  chance,
4
6
  mockIdDescription,
5
- } from 'src/testing/types.js';
6
-
7
- import { validateJson } from './validation.js';
7
+ } from '#src/testing/types.js';
8
8
 
9
9
  describe('validateJson', () => {
10
10
  const idDescription = mockIdDescription();
@@ -1,8 +1,8 @@
1
- import { scoringService } from 'src/testing/services.js';
2
- import { chance, mockJobPublishedEvent } from 'src/testing/types.js';
3
-
4
1
  import * as jobScorer from './jobScorer.js';
5
2
 
3
+ import { scoringService } from '#src/testing/services.js';
4
+ import { chance, mockJobPublishedEvent } from '#src/testing/types.js';
5
+
6
6
  describe('scoreJobPublishedEvent', () => {
7
7
  beforeAll(scoringService.spy);
8
8
 
@@ -1,16 +1,17 @@
1
+ import type {
2
+ JobPublishedEvent,
3
+ JobScoredEvent,
4
+ } from 'src/types/pipelineEvents.js';
5
+
1
6
  import {
2
7
  jobPublishedEventToScorerInput,
3
8
  jobScorerOutputToScoredEvent,
4
- } from 'src/mapping/jobScorer.js';
9
+ } from '#src/mapping/jobScorer.js';
5
10
  import {
6
11
  type JobScorerInput,
7
12
  type JobScorerOutput,
8
13
  JobScorerOutputSchema,
9
- } from 'src/types/jobScorer.js';
10
- import type {
11
- JobPublishedEvent,
12
- JobScoredEvent,
13
- } from 'src/types/pipelineEvents.js';
14
+ } from '#src/types/jobScorer.js';
14
15
 
15
16
  /* istanbul ignore next: simulation of an external service */
16
17
  export const scoringService = {
@@ -1,10 +1,10 @@
1
1
  import { PublishCommand } from '@aws-sdk/client-sns';
2
2
 
3
- import { sns } from 'src/testing/services.js';
4
- import { chance } from 'src/testing/types.js';
5
-
6
3
  import { sendPipelineEvent } from './pipelineEventSender.js';
7
4
 
5
+ import { sns } from '#src/testing/services.js';
6
+ import { chance } from '#src/testing/types.js';
7
+
8
8
  describe('sendPipelineEvent', () => {
9
9
  afterEach(() => {
10
10
  jest.clearAllMocks();
@@ -1,9 +1,9 @@
1
1
  import { PublishCommand } from '@aws-sdk/client-sns';
2
2
 
3
- import { config } from 'src/config.js';
4
-
5
3
  import { sns } from './aws.js';
6
4
 
5
+ import { config } from '#src/config.js';
6
+
7
7
  export const sendPipelineEvent = async (
8
8
  event: unknown,
9
9
  smokeTest: boolean = false,
@@ -3,8 +3,8 @@ import 'aws-sdk-client-mock-jest';
3
3
  import { PublishCommand } from '@aws-sdk/client-sns';
4
4
  import { mockClient } from 'aws-sdk-client-mock';
5
5
 
6
- import { sns as snsClient } from 'src/services/aws.js';
7
- import * as jobScorer from 'src/services/jobScorer.js';
6
+ import { sns as snsClient } from '#src/services/aws.js';
7
+ import * as jobScorer from '#src/services/jobScorer.js';
8
8
 
9
9
  export const scoringService = {
10
10
  request: jest.fn(),
@@ -2,10 +2,10 @@
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
4
  "lib": ["ES2024"],
5
+ "moduleResolution": "node16",
6
+ "module": "node18",
5
7
  "outDir": "lib",
6
- "paths": {
7
- "src": ["src"]
8
- },
8
+ "rootDir": ".",
9
9
  "target": "ES2024"
10
10
  },
11
11
  "exclude": ["lib*/**/*"],
@@ -2,6 +2,14 @@
2
2
  "name": "<%- moduleName %>",
3
3
  "version": "0.0.0-semantically-released",
4
4
  "description": "<%- description %>",
5
+ "type": "module",
6
+ "imports": {
7
+ "#src/*": {
8
+ "types": "./src/*",
9
+ "import": "./lib/*",
10
+ "require": "./lib/*"
11
+ }
12
+ },
5
13
  "repository": {
6
14
  "type": "git",
7
15
  "url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- module.exports = {
5
+ export default {
6
6
  entryPoint: 'src/index.ts',
7
7
  fields: [
8
8
  {
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "lib": ["ES2022"],
4
+ "module": "node18",
5
+ "moduleResolution": "node16",
4
6
  "outDir": "lib",
5
7
  "removeComments": false,
8
+ "rootDir": ".",
6
9
  "target": "ES2022"
7
10
  },
8
11
  "exclude": ["lib*/**/*"],
@@ -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 +0,0 @@
1
- import 'skuba-dive/register';