@reflex-stack/tsp 0.1.11 → 0.2.1
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/README.md +40 -45
- package/package.json +5 -5
- package/src/cli.js +55 -58
- package/src/commands/init.js +65 -28
- package/src/commands/size-report.js +29 -34
- package/src/config.js +0 -2
- package/src/tests.js +1 -4
- package/src/utils.js +5 -3
- package/tests/example-package/LICENCE +0 -21
- package/tests/example-package/README.md +0 -31
- package/tests/example-package/dist/common-dep.d.ts +0 -1
- package/tests/example-package/dist/common-dep.js +0 -1
- package/tests/example-package/dist/index.d.ts +0 -2
- package/tests/example-package/dist/index.js +0 -2
- package/tests/example-package/dist/root-dep.d.ts +0 -1
- package/tests/example-package/dist/root-dep.js +0 -1
- package/tests/example-package/dist/stuff.d.ts +0 -1
- package/tests/example-package/dist/stuff.js +0 -5
- package/tests/example-package/dist/submodule/index.d.ts +0 -1
- package/tests/example-package/dist/submodule/index.js +0 -5
- package/tests/example-package/dist/submodule/submodule-dep.d.ts +0 -1
- package/tests/example-package/dist/submodule/submodule-dep.js +0 -1
- package/tests/example-package/package-lock.json +0 -1061
- package/tests/example-package/package.json +0 -47
- package/tests/example-package/reports/main-dark.svg +0 -1
- package/tests/example-package/reports/main-light.svg +0 -1
- package/tests/example-package/reports/submodule-dark.svg +0 -1
- package/tests/example-package/reports/submodule-light.svg +0 -1
- package/tests/example-package/reports/total-dark.svg +0 -1
- package/tests/example-package/reports/total-light.svg +0 -1
- package/tests/example-package/tests/test.js +0 -25
- package/tests/example-package/tests/tsconfig.json +0 -5
- package/tests/example-package/tsconfig.json +0 -36
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@reflex-stack/tsp-example",
|
|
3
|
-
"version": "0.1.3",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"author": "Alexis Bouhet",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"default": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./submodule": {
|
|
15
|
-
"types": "./dist/submodule/index.d.ts",
|
|
16
|
-
"default": "./dist/submodule/index.js"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"tsp": {
|
|
20
|
-
"runtime": "node",
|
|
21
|
-
"src": "./src",
|
|
22
|
-
"dist": "./dist",
|
|
23
|
-
"tests": "./tests",
|
|
24
|
-
"test-files": [
|
|
25
|
-
"test.js"
|
|
26
|
-
],
|
|
27
|
-
"tmp": "./tmp",
|
|
28
|
-
"reports": "./reports",
|
|
29
|
-
"generate-json-report": false,
|
|
30
|
-
"generate-svg-report": true
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tsp build",
|
|
34
|
-
"test": "tsp build --noSizeReport && tsp test --noIntro",
|
|
35
|
-
"publish": "tsp build && tsp test --noIntro && tsp publish --noIntro"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@reflex-stack/tsp": "0.1.2",
|
|
39
|
-
"terser": "^5.37.0",
|
|
40
|
-
"typescript": "^5.7.3"
|
|
41
|
-
},
|
|
42
|
-
"repository": {
|
|
43
|
-
"type": "git",
|
|
44
|
-
"url": "git@github.com:reflex-stack/tsp.git",
|
|
45
|
-
"directory": "tests/example-package"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: white; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">248b</text></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: black; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">248b</text></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: white; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">144b</text></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: black; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">144b</text></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: white; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">392b</text></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="34.6" height="15" xmlns="http://www.w3.org/2000/svg"><style> text { fill: black; font-family: Consolas, Monaco, "Lucida Console", monospace; font-size: 14px; }</style><text y="14">392b</text></svg>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Import your code from dist directory, tests are not built on purpose
|
|
2
|
-
import { rootDep, doStuff } from "../dist/index.js"
|
|
3
|
-
import { doSubmoduleStuff } from "../dist/submodule/index.js"
|
|
4
|
-
// Import small testing lib from tsp
|
|
5
|
-
import { describe, it, expect, startTest } from "@reflex-stack/tsp/tests"
|
|
6
|
-
|
|
7
|
-
const endTest = startTest()
|
|
8
|
-
|
|
9
|
-
describe("Main module", () => {
|
|
10
|
-
it("Should has root dependency", () => {
|
|
11
|
-
expect(rootDep).toBe("root dependency")
|
|
12
|
-
})
|
|
13
|
-
it("Should call doStuff", () => {
|
|
14
|
-
expect(doStuff()).toBe("Do stuff common dependency")
|
|
15
|
-
})
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
describe("Sub module", () => {
|
|
19
|
-
it("Should call doSubmoduleStuff", () => {
|
|
20
|
-
const subModuleStuff = doSubmoduleStuff()
|
|
21
|
-
expect(subModuleStuff).toBe("Do submodule stuff submodule dependency common dependency")
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
endTest()
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Compilation level target
|
|
4
|
-
// If using a bundler in your project it should be the previous or current year
|
|
5
|
-
"target" : "es2023",
|
|
6
|
-
// Allow types to be resolved in tests
|
|
7
|
-
"checkJs": true,
|
|
8
|
-
"allowJs": true,
|
|
9
|
-
// TS libs used, include needed lib.
|
|
10
|
-
// It should contain the target and "DOM" if it runs in the browser
|
|
11
|
-
// https://www.typescriptlang.org/tsconfig/#lib
|
|
12
|
-
"lib": ["es2023"],
|
|
13
|
-
// Module config, you should not change it
|
|
14
|
-
"module": "NodeNext",
|
|
15
|
-
"isolatedModules": false,
|
|
16
|
-
"allowImportingTsExtensions": false,
|
|
17
|
-
// Compiler config
|
|
18
|
-
"strict": false,
|
|
19
|
-
"checkJs": true,
|
|
20
|
-
"useDefineForClassFields" : true,
|
|
21
|
-
"allowSyntheticDefaultImports": true,
|
|
22
|
-
// ---
|
|
23
|
-
// Feel free to configure this file for your needs
|
|
24
|
-
// https://www.typescriptlang.org/tsconfig/
|
|
25
|
-
// ---
|
|
26
|
-
// Forbidden props are :
|
|
27
|
-
// - rootDir
|
|
28
|
-
// - outDir
|
|
29
|
-
// - declaration
|
|
30
|
-
// - noEmitOnError
|
|
31
|
-
// - pretty
|
|
32
|
-
},
|
|
33
|
-
// Compile only from src, avoid looping in dist
|
|
34
|
-
"exclude": ["node_modules", "dist"],
|
|
35
|
-
"include": ["src/**/*"],
|
|
36
|
-
}
|