@systemfsoftware/stryker-js-typescript-checker 1.2.2 → 1.3.0
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/CHANGELOG.md +33 -0
- package/LICENSE +203 -21
- package/README.md +31 -0
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +132 -122
- package/package.json +23 -10
- package/.turbo/turbo-build.log +0 -21
- package/AGENTS.md +0 -7
- package/oxlint.config.ts +0 -9
- package/src/fs/hybrid-file-system.ts +0 -118
- package/src/fs/index.ts +0 -2
- package/src/fs/script-file.ts +0 -44
- package/src/grouping/create-groups.ts +0 -77
- package/src/grouping/ts-file-node.ts +0 -54
- package/src/index.ts +0 -18
- package/src/plugin-tokens.ts +0 -2
- package/src/tsconfig-helpers.ts +0 -187
- package/src/typescript-checker-options-with-stryker-options.ts +0 -9
- package/src/typescript-checker.ts +0 -223
- package/src/typescript-compiler.ts +0 -412
- package/test/integration/e2e-plugin-entry.it.spec.ts +0 -153
- package/test/integration/project-references.it.spec.ts +0 -146
- package/test/integration/project-with-ts-buildinfo.it.spec.ts +0 -92
- package/test/integration/single-project.it.spec.ts +0 -298
- package/test/integration/tsconfig-helpers.it.spec.ts +0 -199
- package/test/integration/typescript-checkers-errors.it.spec.ts +0 -112
- package/test/unit/fs/hybrid-file-system.spec.ts +0 -109
- package/test/unit/grouping/create-groups.spec.ts +0 -122
- package/test/unit/grouping/ts-file-node.spec.ts +0 -132
- package/testResources/errors/compile-error/add.ts +0 -3
- package/testResources/errors/compile-error/tsconfig.json +0 -6
- package/testResources/errors/empty-dir/.gitkeep +0 -0
- package/testResources/errors/invalid-tsconfig/tsconfig.json +0 -1
- package/testResources/project-references/src/index.ts +0 -5
- package/testResources/project-references/src/job.ts +0 -6
- package/testResources/project-references/src/tsconfig.json +0 -10
- package/testResources/project-references/tsconfig.root.json +0 -7
- package/testResources/project-references/tsconfig.settings.json +0 -17
- package/testResources/project-references/utils/math.ts +0 -3
- package/testResources/project-references/utils/text.ts +0 -3
- package/testResources/project-references/utils/tsconfig.json +0 -7
- package/testResources/project-with-ts-buildinfo/src/index.ts +0 -3
- package/testResources/project-with-ts-buildinfo/tsconfig.json +0 -17
- package/testResources/single-project/src/counter.ts +0 -9
- package/testResources/single-project/src/errorInFileAbove2Mutants/counter.ts +0 -9
- package/testResources/single-project/src/errorInFileAbove2Mutants/todo-counter.ts +0 -7
- package/testResources/single-project/src/errorInFileAbove2Mutants/todo.spec.ts +0 -11
- package/testResources/single-project/src/errorInFileAbove2Mutants/todo.ts +0 -22
- package/testResources/single-project/src/not-type-checked.js +0 -1
- package/testResources/single-project/src/todo.spec.ts +0 -11
- package/testResources/single-project/src/todo.ts +0 -22
- package/testResources/single-project/tsconfig.json +0 -17
- package/tsconfig.json +0 -26
- package/tsdown.config.ts +0 -16
- package/vitest.config.ts +0 -13
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { HybridFileSystem } from '../../../src/fs/hybrid-file-system.js'
|
|
4
|
-
|
|
5
|
-
describe('HybridFileSystem', () => {
|
|
6
|
-
function createSut(): HybridFileSystem {
|
|
7
|
-
return new HybridFileSystem()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
describe('writeFile', () => {
|
|
11
|
-
it('should create a new in-memory file', () => {
|
|
12
|
-
const sut = createSut()
|
|
13
|
-
sut.writeFile('add.js', 'a + b')
|
|
14
|
-
const file = sut.getFile('add.js')
|
|
15
|
-
expect(file).toBeTruthy()
|
|
16
|
-
expect(file!.content).toBe('a + b')
|
|
17
|
-
expect(file!.fileName).toBe('add.js')
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('should override an existing file', () => {
|
|
21
|
-
const sut = createSut()
|
|
22
|
-
sut.writeFile('add.js', 'a + b')
|
|
23
|
-
sut.writeFile('add.js', 'a - b')
|
|
24
|
-
const file = sut.getFile('add.js')
|
|
25
|
-
expect(file!.content).toBe('a - b')
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should convert path separator to forward slashes', () => {
|
|
29
|
-
const sut = createSut()
|
|
30
|
-
sut.writeFile('test\\foo\\a.js', 'a')
|
|
31
|
-
const actual = sut.getFile('test/foo/a.js')
|
|
32
|
-
expect(actual).toBeTruthy()
|
|
33
|
-
expect(actual!.content).toBe('a')
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
describe('readFile', () => {
|
|
38
|
-
it('should return in-memory content', () => {
|
|
39
|
-
const sut = createSut()
|
|
40
|
-
sut.writeFile('foo.js', 'in-memory')
|
|
41
|
-
expect(sut.readFile('foo.js')).toBe('in-memory')
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('should return undefined for non-mutated files to allow disk fallback', () => {
|
|
45
|
-
const sut = createSut()
|
|
46
|
-
expect(sut.readFile('some-file-that-is-not-tracked.js')).toBeUndefined()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('should return null for buildinfo files', () => {
|
|
50
|
-
const sut = createSut()
|
|
51
|
-
expect(sut.readFile('cache.tsbuildinfo')).toBeNull()
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
it('should return the tsconfig override when present', () => {
|
|
55
|
-
const sut = createSut()
|
|
56
|
-
sut.tsConfigOverrides.set('/project/tsconfig.json', '{"compilerOptions":{}}')
|
|
57
|
-
expect(sut.readFile('/project/tsconfig.json')).toBe('{"compilerOptions":{}}')
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
describe('fileExists', () => {
|
|
62
|
-
it('should return true for in-memory files', () => {
|
|
63
|
-
const sut = createSut()
|
|
64
|
-
sut.writeFile('foo.js', '')
|
|
65
|
-
expect(sut.fileExists('foo.js')).toBe(true)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('should return false for buildinfo files', () => {
|
|
69
|
-
const sut = createSut()
|
|
70
|
-
expect(sut.fileExists('cache.tsbuildinfo')).toBe(false)
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('should return undefined for unknown files', () => {
|
|
74
|
-
const sut = createSut()
|
|
75
|
-
expect(sut.fileExists('unknown.js')).toBeUndefined()
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
describe('mutateFile / resetFile', () => {
|
|
80
|
-
it('should mutate a file and reset it afterwards', () => {
|
|
81
|
-
const sut = createSut()
|
|
82
|
-
sut.writeFile('add.js', 'function add(a: number, b: number) { return a + b; }')
|
|
83
|
-
sut.mutateFile('add.js', {
|
|
84
|
-
location: {
|
|
85
|
-
start: { line: 0, column: 42 },
|
|
86
|
-
end: { line: 0, column: 49 },
|
|
87
|
-
},
|
|
88
|
-
replacement: 'a - b',
|
|
89
|
-
})
|
|
90
|
-
expect(sut.readFile('add.js')).toContain('a - b')
|
|
91
|
-
|
|
92
|
-
sut.resetFile('add.js')
|
|
93
|
-
expect(sut.readFile('add.js')).toContain('a + b')
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
describe('existsInMemory', () => {
|
|
98
|
-
it('should return true if file exists in memory', () => {
|
|
99
|
-
const sut = createSut()
|
|
100
|
-
sut.writeFile('test-file', '')
|
|
101
|
-
expect(sut.existsInMemory('test-file')).toBe(true)
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
it('should return false if file does not exist in memory', () => {
|
|
105
|
-
const sut = createSut()
|
|
106
|
-
expect(sut.existsInMemory('test-file')).toBe(false)
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
})
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { createGroups } from '../../../src/grouping/create-groups.js'
|
|
4
|
-
import { TSFileNode } from '../../../src/grouping/ts-file-node.js'
|
|
5
|
-
|
|
6
|
-
function factoryMutant(fileName: string, id: string) {
|
|
7
|
-
return {
|
|
8
|
-
id,
|
|
9
|
-
fileName,
|
|
10
|
-
mutatorName: 'foo-mutator',
|
|
11
|
-
replacement: '',
|
|
12
|
-
location: {
|
|
13
|
-
start: { line: 0, column: 0 },
|
|
14
|
-
end: { line: 0, column: 0 },
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
describe('createGroups', () => {
|
|
20
|
-
it('single mutant should create single group', () => {
|
|
21
|
-
const mutants = [factoryMutant('a.js', 'mutant-1')]
|
|
22
|
-
const nodes = new Map<string, TSFileNode>([
|
|
23
|
-
['a.js', new TSFileNode('a.js', [], [])],
|
|
24
|
-
])
|
|
25
|
-
const groups = createGroups(mutants, nodes)
|
|
26
|
-
expect(groups).toHaveLength(1)
|
|
27
|
-
expect(groups[0]!).toHaveLength(1)
|
|
28
|
-
expect(groups[0]![0]).toBe('mutant-1')
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('two mutants in different files without reference to each other should create single group', () => {
|
|
32
|
-
const mutants = [factoryMutant('a.js', '1'), factoryMutant('b.js', '2')]
|
|
33
|
-
const nodes = new Map<string, TSFileNode>([
|
|
34
|
-
['a.js', new TSFileNode('a.js', [], [])],
|
|
35
|
-
['b.js', new TSFileNode('b.js', [], [])],
|
|
36
|
-
])
|
|
37
|
-
const groups = createGroups(mutants, nodes)
|
|
38
|
-
expect(groups).toHaveLength(1)
|
|
39
|
-
expect(groups[0]![0]).toBe('1')
|
|
40
|
-
expect(groups[0]![1]).toBe('2')
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('two mutants in different files with reference to each other should create 2 groups', () => {
|
|
44
|
-
const mutants = [factoryMutant('a.js', '1'), factoryMutant('b.js', '2')]
|
|
45
|
-
const nodeA = new TSFileNode('a.js', [], [])
|
|
46
|
-
const nodeB = new TSFileNode('b.js', [nodeA], [])
|
|
47
|
-
const nodes = new Map<string, TSFileNode>([
|
|
48
|
-
[nodeA.fileName, nodeA],
|
|
49
|
-
[nodeB.fileName, nodeB],
|
|
50
|
-
])
|
|
51
|
-
const groups = createGroups(mutants, nodes)
|
|
52
|
-
expect(groups).toHaveLength(2)
|
|
53
|
-
expect(groups[0]![0]).toBe('1')
|
|
54
|
-
expect(groups[1]![0]).toBe('2')
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('two mutants in different files with circular dependency to each other should create 2 groups', () => {
|
|
58
|
-
const mutants = [factoryMutant('a.js', '1'), factoryMutant('b.js', '2')]
|
|
59
|
-
const nodeA = new TSFileNode('a.js', [], [])
|
|
60
|
-
const nodeB = new TSFileNode('b.js', [nodeA], [])
|
|
61
|
-
nodeA.parents.push(nodeB)
|
|
62
|
-
const nodes = new Map<string, TSFileNode>([
|
|
63
|
-
[nodeA.fileName, nodeA],
|
|
64
|
-
[nodeB.fileName, nodeB],
|
|
65
|
-
])
|
|
66
|
-
const groups = createGroups(mutants, nodes)
|
|
67
|
-
expect(groups).toHaveLength(2)
|
|
68
|
-
expect(groups[0]![0]).toBe('1')
|
|
69
|
-
expect(groups[1]![0]).toBe('2')
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('two mutants in same file should create 2 groups', () => {
|
|
73
|
-
const mutants = [factoryMutant('a.js', '1'), factoryMutant('a.js', '2')]
|
|
74
|
-
const nodeA = new TSFileNode('a.js', [], [])
|
|
75
|
-
const nodes = new Map<string, TSFileNode>([[nodeA.fileName, nodeA]])
|
|
76
|
-
const groups = createGroups(mutants, nodes)
|
|
77
|
-
expect(groups).toHaveLength(2)
|
|
78
|
-
expect(groups[0]![0]).toBe('1')
|
|
79
|
-
expect(groups[1]![0]).toBe('2')
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
it('complex graph should contain multiple groups', () => {
|
|
83
|
-
const mutants = [
|
|
84
|
-
factoryMutant('a.js', '1'),
|
|
85
|
-
factoryMutant('b.js', '2'),
|
|
86
|
-
factoryMutant('c.js', '3'),
|
|
87
|
-
factoryMutant('d.js', '4'),
|
|
88
|
-
factoryMutant('e.js', '5'),
|
|
89
|
-
factoryMutant('f.js', '6'),
|
|
90
|
-
]
|
|
91
|
-
const nodeA = new TSFileNode('a.js', [], [])
|
|
92
|
-
const nodeB = new TSFileNode('b.js', [nodeA], [])
|
|
93
|
-
const nodeC = new TSFileNode('c.js', [nodeA], [])
|
|
94
|
-
const nodeD = new TSFileNode('d.js', [nodeC], [])
|
|
95
|
-
const nodeE = new TSFileNode('e.js', [nodeA], [])
|
|
96
|
-
const nodeF = new TSFileNode('f.js', [nodeE, nodeD], [])
|
|
97
|
-
const nodes = new Map<string, TSFileNode>([
|
|
98
|
-
[nodeA.fileName, nodeA],
|
|
99
|
-
[nodeB.fileName, nodeB],
|
|
100
|
-
[nodeC.fileName, nodeC],
|
|
101
|
-
[nodeD.fileName, nodeD],
|
|
102
|
-
[nodeE.fileName, nodeE],
|
|
103
|
-
[nodeF.fileName, nodeF],
|
|
104
|
-
])
|
|
105
|
-
const groups = createGroups(mutants, nodes)
|
|
106
|
-
expect(groups).toHaveLength(4)
|
|
107
|
-
expect(groups[0]![0]).toBe('1')
|
|
108
|
-
expect(groups[1]![0]).toBe('2')
|
|
109
|
-
expect(groups[1]![1]).toBe('3')
|
|
110
|
-
expect(groups[1]![2]).toBe('5')
|
|
111
|
-
expect(groups[2]![0]).toBe('4')
|
|
112
|
-
expect(groups[3]![0]).toBe('6')
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
it('should throw error when node is not in graph', () => {
|
|
116
|
-
const mutants = [factoryMutant('a.js', '1')]
|
|
117
|
-
const nodeA = new TSFileNode('.js', [], [])
|
|
118
|
-
const nodes = new Map<string, TSFileNode>([[nodeA.fileName, nodeA]])
|
|
119
|
-
|
|
120
|
-
expect(() => createGroups(mutants, nodes)).toThrow('Node not in graph: a.js')
|
|
121
|
-
})
|
|
122
|
-
})
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { TSFileNode } from '../../../src/grouping/ts-file-node.js'
|
|
4
|
-
|
|
5
|
-
describe('TSFileNode', () => {
|
|
6
|
-
describe('getAllParentReferencesIncludingSelf', () => {
|
|
7
|
-
it('without parent should return array of 1 node', () => {
|
|
8
|
-
const node = new TSFileNode('NodeA', [], [])
|
|
9
|
-
expect(node.getAllParentReferencesIncludingSelf()).toHaveLength(1)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
it('with 1 parent should return array of 2 nodes', () => {
|
|
13
|
-
const node = new TSFileNode('NodeA', [new TSFileNode('', [], [])], [])
|
|
14
|
-
expect(node.getAllParentReferencesIncludingSelf()).toHaveLength(2)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('with recursive depth of 2 should return 3 nodes', () => {
|
|
18
|
-
const node = new TSFileNode(
|
|
19
|
-
'NodeA',
|
|
20
|
-
[new TSFileNode('', [new TSFileNode('', [], [])], [])],
|
|
21
|
-
[],
|
|
22
|
-
)
|
|
23
|
-
expect(node.getAllParentReferencesIncludingSelf()).toHaveLength(3)
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('with recursive depth of 2 and multiple parents should return 4 nodes', () => {
|
|
27
|
-
const node = new TSFileNode(
|
|
28
|
-
'NodeA',
|
|
29
|
-
[
|
|
30
|
-
new TSFileNode(
|
|
31
|
-
'',
|
|
32
|
-
[new TSFileNode('', [], []), new TSFileNode('', [], [])],
|
|
33
|
-
[],
|
|
34
|
-
),
|
|
35
|
-
],
|
|
36
|
-
[],
|
|
37
|
-
)
|
|
38
|
-
expect(node.getAllParentReferencesIncludingSelf()).toHaveLength(4)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('with circular dependency should skip circular dependency node', () => {
|
|
42
|
-
const nodeA = new TSFileNode('NodeA', [], [])
|
|
43
|
-
const nodeC = new TSFileNode('NodeB', [nodeA], [])
|
|
44
|
-
const nodeB = new TSFileNode('NodeB', [nodeC], [])
|
|
45
|
-
nodeA.parents.push(nodeB)
|
|
46
|
-
expect(nodeA.getAllParentReferencesIncludingSelf()).toHaveLength(3)
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
describe('getAllChildReferencesIncludingSelf', () => {
|
|
51
|
-
it('without child should return array of 1 node', () => {
|
|
52
|
-
const node = new TSFileNode('NodeA', [], [])
|
|
53
|
-
expect(node.getAllChildReferencesIncludingSelf()).toHaveLength(1)
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('with 1 child should return array of 2 nodes', () => {
|
|
57
|
-
const node = new TSFileNode('NodeA', [], [new TSFileNode('', [], [])])
|
|
58
|
-
expect(node.getAllChildReferencesIncludingSelf()).toHaveLength(2)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('with recursive depth of 2 should return 3 nodes', () => {
|
|
62
|
-
const node = new TSFileNode(
|
|
63
|
-
'NodeA',
|
|
64
|
-
[],
|
|
65
|
-
[new TSFileNode('', [], [new TSFileNode('', [], [])])],
|
|
66
|
-
)
|
|
67
|
-
expect(node.getAllChildReferencesIncludingSelf()).toHaveLength(3)
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('with recursive depth of 2 and multiple children should return 4 nodes', () => {
|
|
71
|
-
const node = new TSFileNode(
|
|
72
|
-
'NodeA',
|
|
73
|
-
[],
|
|
74
|
-
[
|
|
75
|
-
new TSFileNode(
|
|
76
|
-
'',
|
|
77
|
-
[],
|
|
78
|
-
[new TSFileNode('', [], []), new TSFileNode('', [], [])],
|
|
79
|
-
),
|
|
80
|
-
],
|
|
81
|
-
)
|
|
82
|
-
expect(node.getAllChildReferencesIncludingSelf()).toHaveLength(4)
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
describe('getMutantsWithReferenceToChildrenOrSelf', () => {
|
|
87
|
-
it('with single mutant in file should return 1 mutant', () => {
|
|
88
|
-
const node = new TSFileNode('NodeA.js', [], [])
|
|
89
|
-
const mutants = [createMutant('NodeA.js')]
|
|
90
|
-
expect(node.getMutantsWithReferenceToChildrenOrSelf(mutants)).toHaveLength(1)
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
it('with single mutant in child should return 1 mutant', () => {
|
|
94
|
-
const node = new TSFileNode('NodeA.js', [], [])
|
|
95
|
-
const nodeB = new TSFileNode('NodeB.js', [], [])
|
|
96
|
-
node.children.push(nodeB)
|
|
97
|
-
const mutants = [createMutant('NodeB.js')]
|
|
98
|
-
expect(node.getMutantsWithReferenceToChildrenOrSelf(mutants)).toHaveLength(1)
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
it('should not create endless loop', () => {
|
|
102
|
-
const node = new TSFileNode('NodeA.js', [], [])
|
|
103
|
-
node.children = [node]
|
|
104
|
-
|
|
105
|
-
const mutants = [createMutant('NodeA.js')]
|
|
106
|
-
|
|
107
|
-
expect(node.getMutantsWithReferenceToChildrenOrSelf(mutants)).toHaveLength(1)
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('should find mutant with backward slashes and forward slashes', () => {
|
|
111
|
-
const node = new TSFileNode('path/NodeA.js', [], [])
|
|
112
|
-
node.children = [node]
|
|
113
|
-
|
|
114
|
-
const mutants = [createMutant('path/NodeA.js'), createMutant('path\\NodeA.js')]
|
|
115
|
-
|
|
116
|
-
expect(node.getMutantsWithReferenceToChildrenOrSelf(mutants)).toHaveLength(2)
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
function createMutant(fileName: string) {
|
|
122
|
-
return {
|
|
123
|
-
fileName,
|
|
124
|
-
id: '0',
|
|
125
|
-
replacement: '-',
|
|
126
|
-
location: {
|
|
127
|
-
start: { line: 1, column: 1 },
|
|
128
|
-
end: { line: 1, column: 1 },
|
|
129
|
-
},
|
|
130
|
-
mutatorName: '',
|
|
131
|
-
}
|
|
132
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
invalid tsconfig file
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"module": "commonjs",
|
|
7
|
-
"composite": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationMap": true,
|
|
10
|
-
|
|
11
|
-
// These settings should be overridden by the typescript checker
|
|
12
|
-
"noUnusedLocals": true,
|
|
13
|
-
"noUnusedParameters": true,
|
|
14
|
-
|
|
15
|
-
"types": []
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"module": "commonjs",
|
|
7
|
-
"outDir": "dist",
|
|
8
|
-
|
|
9
|
-
// These settings should be overridden by the typescript checker
|
|
10
|
-
"noUnusedLocals": true,
|
|
11
|
-
"noUnusedParameters": true,
|
|
12
|
-
|
|
13
|
-
"types": [],
|
|
14
|
-
"incremental": true,
|
|
15
|
-
"tsBuildInfoFile": "do-not-delete.tsbuildinfo"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TodoList } from './todo.js'
|
|
2
|
-
|
|
3
|
-
const list = new TodoList()
|
|
4
|
-
const n: number = list.createTodoItem('Mow lawn', 'Mow moving forward.')
|
|
5
|
-
console.log(n)
|
|
6
|
-
|
|
7
|
-
function addTodo(name = 'test', description = 'test') {
|
|
8
|
-
list.createTodoItem(name, description)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
addTodo()
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface ITodo {
|
|
2
|
-
name: string
|
|
3
|
-
description: string
|
|
4
|
-
completed: boolean
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
class Todo implements ITodo {
|
|
8
|
-
constructor(public name: string, public description: string, public completed: boolean) {}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class TodoList {
|
|
12
|
-
public static allTodos: Todo[] = []
|
|
13
|
-
createTodoItem(name: string, description: string) {
|
|
14
|
-
let newItem = new Todo(name, description, false)
|
|
15
|
-
let totalCount: number = TodoList.allTodos.push(newItem)
|
|
16
|
-
return totalCount
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
allTodoItems(): ITodo[] {
|
|
20
|
-
return TodoList.allTodos
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const foo = 'bar'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TodoList } from './todo.js'
|
|
2
|
-
|
|
3
|
-
const list = new TodoList()
|
|
4
|
-
const n: number = list.createTodoItem('Mow lawn', 'Mow moving forward.')
|
|
5
|
-
console.log(n)
|
|
6
|
-
|
|
7
|
-
function addTodo(name = 'test', description = 'test') {
|
|
8
|
-
list.createTodoItem(name, description)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
addTodo()
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface ITodo {
|
|
2
|
-
name: string
|
|
3
|
-
description: string
|
|
4
|
-
completed: boolean
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
class Todo implements ITodo {
|
|
8
|
-
constructor(public name: string, public description: string, public completed: boolean) {}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class TodoList {
|
|
12
|
-
public static allTodos: Todo[] = []
|
|
13
|
-
createTodoItem(name: string, description: string) {
|
|
14
|
-
let newItem = new Todo(name, description, false)
|
|
15
|
-
let totalCount: number = TodoList.allTodos.push(newItem)
|
|
16
|
-
return totalCount
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
allTodoItems(): ITodo[] {
|
|
20
|
-
return TodoList.allTodos
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"strict": true,
|
|
5
|
-
"target": "es5",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"module": "commonjs",
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
|
|
10
|
-
// These settings should be overridden by the typescript checker
|
|
11
|
-
"noUnusedLocals": true,
|
|
12
|
-
"noUnusedParameters": true,
|
|
13
|
-
|
|
14
|
-
"types": []
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*.ts"]
|
|
17
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@systemfsoftware/tsconfig/tsc/no-dom/library",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"rootDir": ".",
|
|
6
|
-
"types": [
|
|
7
|
-
"node"
|
|
8
|
-
],
|
|
9
|
-
// Fork of @stryker-mutator/typescript-checker: the leaf AGENTS.md mandates a minimal upstream
|
|
10
|
-
// diff, so the constitution policy in @systemfsoftware/tsconfig/effect is deliberately NOT
|
|
11
|
-
// extended here. The Effect Language Service runs at its own defaults — correctness tier only.
|
|
12
|
-
"plugins": [
|
|
13
|
-
{
|
|
14
|
-
"name": "@effect/language-service"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"include": [
|
|
19
|
-
"src",
|
|
20
|
-
"test"
|
|
21
|
-
],
|
|
22
|
-
"exclude": [
|
|
23
|
-
"node_modules",
|
|
24
|
-
"dist"
|
|
25
|
-
]
|
|
26
|
-
}
|
package/tsdown.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsdown'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: {
|
|
5
|
-
index: './src/index.ts',
|
|
6
|
-
},
|
|
7
|
-
format: 'esm',
|
|
8
|
-
dts: true,
|
|
9
|
-
exports: { devExports: '@systemfsoftware/source' },
|
|
10
|
-
// `jsr:` specs publish as `npm:@jsr/std__jsonc@…`, which exists only on npm.jsr.io, so a
|
|
11
|
-
// default-registry consumer cannot install it. Inlining the parser (a leaf, no runtime
|
|
12
|
-
// imports) keeps the published artifact free of any `@jsr` dep. Dropping this line
|
|
13
|
-
// reintroduces an uninstallable release — verified by packing and installing the tarball.
|
|
14
|
-
noExternal: ['@std/jsonc'],
|
|
15
|
-
clean: false,
|
|
16
|
-
})
|
package/vitest.config.ts
DELETED