Skip to content

Commit

Permalink
Switch to oss skuba-dive package (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c authored Jun 10, 2020
1 parent 2aa0ea5 commit 70ae29a
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-walls-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

**configure, init:** Switch to oss `skuba-dive` package
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
"typescript": "3.9.3"
},
"peerDependencies": {
"@seek/skuba-dive": "1",
"@types/jest": ">= 25 < 27"
"@types/jest": ">= 25 < 27",
"skuba-dive": "1"
},
"peerDependenciesMeta": {
"@seek/skuba-dive": {
"skuba-dive": {
"optional": true
},
"@types/jest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ gantry*.yml
"package.json": Object {
"data": "{
\\"dependencies\\": {
\\"@seek/skuba-dive\\": \\"0.0.1\\"
\\"skuba-dive\\": \\"0.0.1\\"
},
\\"devDependencies\\": {
\\"skuba\\": \\"0.0.0-semantically-released\\"
Expand Down
8 changes: 4 additions & 4 deletions src/cli/configure/modules/skubaDive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('skubaDiveModule', () => {
const outputData = parsePackage(outputFiles['package.json']);

assertDefined(outputData);
expect(outputData.dependencies).toHaveProperty('@seek/skuba-dive');
expect(outputData.dependencies).toHaveProperty('skuba-dive');
});

it('registers entry point directly under src', async () => {
Expand All @@ -38,7 +38,7 @@ describe('skubaDiveModule', () => {
);

expect(outputFiles['src/app.ts']).toBe(
"import '@seek/skuba-dive/register';\n\nconsole.log();\n",
"import 'skuba-dive/register';\n\nconsole.log();\n",
);
});

Expand All @@ -54,7 +54,7 @@ describe('skubaDiveModule', () => {
});

expect(outputFiles['src/register.ts']).toBe(
"import '@seek/skuba-dive/register';\n\nconsole.log();\n",
"import 'skuba-dive/register';\n\nconsole.log();\n",
);
expect(outputFiles['src/nested/index.ts']).toBe(
"import '../register';\n\nconsole.error();\n",
Expand All @@ -80,7 +80,7 @@ describe('skubaDiveModule', () => {
const outputData = parsePackage(outputFiles['package.json']);

assertDefined(outputData);
expect(outputData.dependencies).toHaveProperty('@seek/skuba-dive');
expect(outputData.dependencies).toHaveProperty('skuba-dive');
expect(outputData.dependencies).not.toHaveProperty('module-alias');
expect(outputData.dependencies).toHaveProperty('something-else', '0.0.1');
});
Expand Down
16 changes: 8 additions & 8 deletions src/cli/configure/modules/skubaDive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const skubaDiveModule = async ({
}: {
entryPoint: string;
}): Promise<Module> => {
const skubaDiveVersion = await latestVersion('@seek/skuba-dive');
const skubaDiveVersion = await latestVersion('skuba-dive');

const skubaDiveData = {
dependencies: {
'@seek/skuba-dive': skubaDiveVersion,
'skuba-dive': skubaDiveVersion,
},
};

Expand All @@ -38,8 +38,8 @@ export const skubaDiveModule = async ({

if (
typeof inputFile === 'undefined' ||
inputFile.includes('@seek/skuba-dive/register') ||
registerFile?.includes('@seek/skuba-dive/register')
inputFile.includes('skuba-dive/register') ||
registerFile?.includes('skuba-dive/register')
) {
return inputFile;
}
Expand All @@ -51,14 +51,14 @@ export const skubaDiveModule = async ({
'src',
);

// import @seek/skuba-dive directly from the entry point
// import skuba-dive directly from the entry point
if (relativeToSrc === '') {
return prependImport('@seek/skuba-dive/register', outputFile);
return prependImport('skuba-dive/register', outputFile);
}

// import @seek/skuba-dive via src/register.ts
// import skuba-dive via src/register.ts
files[DEFAULT_FILENAME] = prependImport(
'@seek/skuba-dive/register',
'skuba-dive/register',
registerFile,
);

Expand Down
2 changes: 1 addition & 1 deletion template/greeter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@seek/skuba-dive": "^1.0.2"
"skuba-dive": "^1.0.2"
},
"devDependencies": {
"@types/node": "^14.0.1",
Expand Down
2 changes: 1 addition & 1 deletion template/greeter/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@seek/skuba-dive/register';
import 'skuba-dive/register';

/* eslint-disable-next-line no-console */
console.log('Hello world');
2 changes: 1 addition & 1 deletion template/koa-rest-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@koa/router": "^8.0.8",
"@seek/koala": "^4.0.0",
"@seek/node-datadog-custom-metrics": "^2.2.3",
"@seek/skuba-dive": "^1.0.2",
"skuba-dive": "^1.0.2",
"hot-shots": "^7.4.2",
"koa": "^2.12.0",
"koa-bodyparser": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion template/koa-rest-api/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@seek/skuba-dive/register';
import 'skuba-dive/register';

import { router } from 'src/api';
import { config } from 'src/config';
Expand Down
2 changes: 1 addition & 1 deletion template/koa-rest-api/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Env } from '@seek/skuba-dive';
import { Env } from 'skuba-dive';

interface Config {
environment: Environment;
Expand Down
2 changes: 1 addition & 1 deletion template/lambda-sqs-worker/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@seek/node-datadog-custom-metrics": "^2.2.3",
"@seek/skuba-dive": "^1.0.2",
"skuba-dive": "^1.0.2",
"pino": "^6.2.1",
"runtypes": "^4.2.0",
"runtypes-filter": "^0.2.1"
Expand Down
2 changes: 1 addition & 1 deletion template/lambda-sqs-worker/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@seek/skuba-dive/register';
import 'skuba-dive/register';

import { SQSEvent } from 'aws-lambda';

Expand Down
2 changes: 1 addition & 1 deletion template/lambda-sqs-worker/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Env } from '@seek/skuba-dive';
import { Env } from 'skuba-dive';

interface Config {
environment: Environment;
Expand Down

0 comments on commit 70ae29a

Please sign in to comment.