You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+31-19Lines changed: 31 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,47 +27,54 @@ This will alter the bundler to only emit non-minified esm modules. The aliasing
27
27
28
28
> Note: The build will be finished when the terminal displays: `[20xx-xx-xx 00:00:00] waiting for changes...`.
29
29
30
-
You will now `cd` into the `primereact/dist` directory and run:
30
+
This will create a local copy of the package that is used instead of the registry version.
31
+
Unlike `npm link`, `yalc` does not use symlinks, which avoids common module resolution issues.
31
32
32
-
```shell
33
-
~/primereact/dist/ $ npm link
34
-
```
33
+
### Open a new terminal and navigate to the `primereact/dist/` directory
35
34
36
-
This will create a symlink in your global npm scope so that other local packages will rely on this version of primereact when built. You can verify that the package is linked by running this from the `primereact` directory.
37
-
38
-
```shell
39
-
~/primereact/ $ npm ls -g --depth=0 --link=true
35
+
Run yalc publish
40
36
41
-
/opt/homebrew/lib
42
-
└── primereact@XX.X.XX -> ./../../../Users/${user}/primereact/dist # <-- this must be in the dist/ dir !!!
37
+
```shell
38
+
~/primereact/ $ cd dist
39
+
~/primereact/dist/ $ npx yalc publish
43
40
```
44
41
45
-
> [!WARNING]
46
-
> Reminder! The XX.X.XX version must be a [valid semantic version](https://docs.npmjs.com/about-semantic-versioning) that you are using in your local project
47
-
48
42
### Now change your directory to your local project you are developing on!
49
43
50
44
```shell
51
45
~/primereact/dist/ $ cd~/my-cool-project
52
46
~/my-cool-project/ $
53
47
```
54
48
55
-
The goal now is to link your primereact dependency to the symlink that we configured earlier:
49
+
The goal now is to link your primereact dependency to the yalc package that we configured earlier:
56
50
57
51
```shell
58
-
~/my-cool-project/ $ npm link primereact
52
+
~/my-cool-project/ $ npx yalc add primereact
59
53
```
60
54
61
55
As long at the dependencies version that you symlinked satisfies the version that is specified in `my-cool-project/package.json` then the link should have worked.
62
56
63
57
You can validate that by running:
64
58
65
59
```shell
66
-
~/my-cool-project/ $ npm ls --link=true
60
+
~/my-cool-project/ $ npx yalc check
61
+
62
+
Yalc dependencies found: [ 'primereact' ]
63
+
```
64
+
65
+
After doing your changes in the `primereact/` directory, you can publish the changes to your local project by running:
This command will watch for changes in the `primereact/` directory and automatically push updates to your local project whenever you save a file. (note the double -- before `watch.onEnd`)
71
78
72
79
### Congratulations!
73
80
@@ -78,5 +85,10 @@ You can now live develop in the `primereact/` directory and your changes should
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,8 @@
9
9
"build:lib": "NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package",
10
10
"build:lib:windows": "set \"NODE_ENV=production\" && set \"INPUT_DIR=components/lib/\" && set \"OUTPUT_DIR=dist/\" && npm run build:package",
11
11
"build:package": "npm run build:check && rollup -c && gulp build-resources && npm run build:api",
12
-
"dev:link": "NPM_LINK=true NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package:dev",
13
-
"dev:link:windows": "set \"NPM_LINK=true\" && set \"NODE_ENV=production\" && set \"INPUT_DIR=components/lib/\" && set \"OUTPUT_DIR=dist/\" && npm run build:package:dev",
12
+
"dev:link": "NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package:dev",
13
+
"dev:link:windows": "set \"NODE_ENV=production\" && set \"INPUT_DIR=components/lib/\" && set \"OUTPUT_DIR=dist/\" && npm run build:package:dev",
14
14
"build:package:dev": "npm run build:check && gulp build-resources && npm run build:api && rollup -c --watch",
15
15
"build:api": "npm run apiwebtypes && npm run apidoc",
16
16
"build:check": "npm run lint && npm run format:check && npm run type:check && npm run security:check",
0 commit comments