@alessiofrittoli/type-utils 1.0.0 → 1.1.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Type Utils ❇️
2
2
 
3
- Version 1.0.0
3
+ Version 1.1.0
4
4
 
5
5
  ## Lightweight TypeScript types utilities
6
6
 
@@ -41,7 +41,7 @@ pnpm i @alessiofrittoli/type-utils
41
41
  ```
42
42
 
43
43
  This tiny library defines some global types which are not imported in your IDE by default.\
44
- After installation a `postinstall` scritp is executed to create the `type-utils.d.ts` file at the root of your project.
44
+ After installation a `postinstall` script is executed to create the `type-utils.d.ts` file at the root of your project.
45
45
  Please make sure to add it in the array of the "include" property in your `tsconfig.json`.
46
46
 
47
47
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessiofrittoli/type-utils",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Lightweight TypeScript types utilities",
5
5
  "author": {
6
6
  "name": "Alessio Frittoli",
@@ -31,12 +31,12 @@
31
31
  "postinstall": "node scripts/postinstall/index.js"
32
32
  },
33
33
  "devDependencies": {
34
- "@eslint/js": "^9.15.0",
35
- "@types/node": "^22.10.0",
36
- "eslint": "^9.15.0",
37
- "globals": "^15.12.0",
34
+ "@eslint/js": "^9.17.0",
35
+ "@types/node": "^22.10.2",
36
+ "eslint": "^9.17.0",
37
+ "globals": "^15.14.0",
38
38
  "tsup": "^8.3.5",
39
39
  "typescript": "^5.7.2",
40
- "typescript-eslint": "^8.16.0"
40
+ "typescript-eslint": "^8.18.1"
41
41
  }
42
42
  }
@@ -7,6 +7,7 @@ const tsSetup = () => {
7
7
 
8
8
  const projectName = project.name.replace( '@alessiofrittoli/', '' )
9
9
  const projectRoot = process.env.INIT_CWD || process.cwd()
10
+ const typesFilename = `${ projectName }.d.ts`
10
11
 
11
12
  if ( projectRoot.endsWith( projectName ) ) {
12
13
  console.log( `Skip "postinstall" script. Running in ${ project.name }` )
@@ -17,7 +18,7 @@ const tsSetup = () => {
17
18
  process.exit( 1 )
18
19
  }
19
20
 
20
- const tsconfigPath = path.resolve( projectRoot, 'type-utils.d.ts' )
21
+ const tsconfigPath = path.resolve( projectRoot, typesFilename )
21
22
 
22
23
  const data = [
23
24
  `/// <reference types="${ project.name }" />`,
@@ -26,10 +27,10 @@ const tsSetup = () => {
26
27
 
27
28
  try {
28
29
  fs.writeFileSync( tsconfigPath, data )
29
- console.log( '"type-utils.d.ts" has been created at the root of your project.' )
30
+ console.log( `"${ typesFilename }" has been created at the root of your project.` )
30
31
  console.log( 'Please update your tsconfig.json to add this file in your "include" property of your tsconfig.json file.' )
31
32
  } catch ( error ) {
32
- console.error( 'An error occured while creating "type-utils.d.ts" at the root of your project. Some global types may not working as expect.', error )
33
+ console.error( `An error occured while creating "${ typesFilename }" at the root of your project. Some global types may not working as expect.`, error )
33
34
  process.exit( 1 )
34
35
  }
35
36