@reflex-stack/tsp 0.1.3 → 0.1.4

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 (2) hide show
  1. package/README.md +22 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -15,13 +15,15 @@ Check example on [NPM](https://www.npmjs.com/package/@reflex-stack/tsp-example)
15
15
 
16
16
  ## Init a new TypeScript Package
17
17
 
18
- First, create the associated **git repository** and clone it ( optional ).
18
+ First, create the associated **git repository** for your package and clone it ( optional ).
19
19
 
20
- Then, run this command the cloned directory :
20
+ Then, run this command in the cloned directory. :
21
21
  ```bash
22
22
  npx @reflex-stack/tsp init
23
23
  ```
24
24
 
25
+ > If you create this package in a mono-repo, `cd` in the correct repository before running this command. The subdirectory is important for package.json and size report generation.
26
+
25
27
  #### Created files
26
28
 
27
29
  This will ask some questions and create those files. It contains 1 **submodule** example and a simple test implementation.
@@ -53,15 +55,19 @@ npm run build
53
55
  - Will clear `./dist`, build sources from `.ts` files to `.js` and `.d.ts` files.
54
56
  - Will generate size report and generate `./reports` directory with JSON and SVG files.
55
57
 
56
- > Run `npm run build --noSizeReport`
58
+ > Run `npm run build --noSizeReport` to skip size report entirely.
57
59
 
58
60
  #### Test
59
- - `npm run test`
61
+ ```bash
62
+ npm run test
63
+ ```
60
64
  > Will clear `./dist`, build sources and run tests. No size report.
61
65
 
62
66
  #### Publish
63
- - `npm run publish`
64
- > Will clear `./dist`, build sources and run tests, and start publish process.
67
+ ```bash
68
+ npm run publish
69
+ ```
70
+ > Will clear `./dist`, build sources, run tests, and start publish process.
65
71
  > This will ask you how to upgrade package.json version, push to git and npm.
66
72
 
67
73
 
@@ -76,6 +82,16 @@ There are 2 svgs generated, for dark and light mode, to be included in the READM
76
82
 
77
83
  > When scaffolded, an example of SVG inclusion is generated in README.md
78
84
 
85
+ How to include the size report in `README.md` ?
86
+
87
+ ```html
88
+ Main bundle is <picture style="display: inline-block"><source media="(prefers-color-scheme: dark)" srcset="./reports/main-dark.svg"><img src="./reports/main-light.svg"></picture>
89
+ Submodule is <picture style="display: inline-block"><source media="(prefers-color-scheme: dark)" srcset="./reports/submodule-dark.svg"><img src="./reports/submodule-light.svg"></picture>
90
+ Total is <picture style="display: inline-block"><source media="(prefers-color-scheme: dark)" srcset="./reports/total-dark.svg"><img src="./reports/total-light.svg"></picture>
91
+ ```
92
+
93
+ > Those works in GitHub and NPM
94
+
79
95
  **TSP** can also generate a json size report if needed ( default is set to false )
80
96
 
81
97
  ## TSP config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reflex-stack/tsp",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tsp": "./src/cli.js"