Skip to content

Commit 7d647f2

Browse files
committed
feat: add submodule
1 parent f405046 commit 7d647f2

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
@module
33
*/
44

5+
import { mySubmodule } from './submodule'
6+
57
/**
68
* Lorem ipsum.
79
*/
810
export const myPackage = (taco = ''): string => `${taco} from my package`
11+
12+
export { mySubmodule }

src/submodule/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Lorem ipsum.
3+
*/
4+
export const mySubmodule = (taco = ''): string => `${taco} from my submodule`

test/index.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest'
2-
import { myPackage } from '../src'
2+
import { myPackage, mySubmodule } from '../src'
33

44
describe('index', () => {
55
describe('myPackage', () => {
@@ -9,4 +9,11 @@ describe('index', () => {
99
expect(result).toMatch(message)
1010
})
1111
})
12+
describe('mySubmodule', () => {
13+
it('should return a string containing the message', () => {
14+
const message = 'Hello'
15+
const result = mySubmodule(message)
16+
expect(result).toMatch(message)
17+
})
18+
})
1219
})

tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
"compilerOptions": {
44
"target": "ES2016",
55
"lib": ["ESNext"],
6-
"baseUrl": "./src",
6+
"baseUrl": "src",
77
"module": "CommonJS",
8-
"paths": {
9-
"@/*": ["*"]
10-
},
11-
"outDir": "./dist"
8+
"outDir": "dist"
129
},
1310
"include": ["src/**/*.ts", "test/**/*.ts"]
1411
}

0 commit comments

Comments
 (0)