@alessiofrittoli/fetcher 2.0.0 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessiofrittoli/fetcher",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Typescript fetch/xhr utilities",
5
5
  "type": "module",
6
6
  "author": {
@@ -38,7 +38,8 @@
38
38
  "module": "./dist/index.mjs",
39
39
  "types": "./dist/index.d.mts",
40
40
  "files": [
41
- "dist"
41
+ "dist",
42
+ "scripts/postinstall"
42
43
  ],
43
44
  "exports": {
44
45
  ".": {
@@ -0,0 +1,16 @@
1
+ const { Chain } = require('@alessiofrittoli/chain-functions')
2
+ const project = require('../../package.json')
3
+ const tsSetup = require('./ts-setup.cjs')
4
+
5
+ /** @type {import( '@alessiofrittoli/chain-functions/types' ).LastChainLink<() => void | Promise<void>>} */
6
+ const lastChainLink = () => () => {
7
+ console.log({
8
+ package: project.name,
9
+ message: `Post-Install done. Thank you for installing ${project.name}!`,
10
+ })
11
+ }
12
+
13
+ /** @type {import( '@alessiofrittoli/chain-functions/types' ).ChainFactory<() => void | Promise<void>>} */
14
+ const chain = [tsSetup, lastChainLink]
15
+
16
+ Chain.functions(chain)()
@@ -0,0 +1,14 @@
1
+ const { addTypesReference } = require('@alessiofrittoli/node-scripts/postinstall')
2
+ const project = require('../../package.json')
3
+
4
+ /** @type {import( '@alessiofrittoli/chain-functions/types' ).ChainLink<() => void | Promise<void>>} */
5
+ const tsSetup = next => () => {
6
+ addTypesReference({
7
+ name: project.name,
8
+ scopes: [`${project.name}/globals`],
9
+ })
10
+
11
+ return next()
12
+ }
13
+
14
+ module.exports = tsSetup