| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Frontend dependency installer. copy frontend modules to desired directory, with additional configurations in package.json:
"scripts": { ... "postinstall": "./node_modules/.bin/fedep" }, "frontendDependencies": { "root": "web/static/assets/lib", "modules": [ "ldLazy" ] }
by executing npx fedep or invoking via postinstall when npm i, fedep will do:
Once configuration is prepared, run:
npx fedep
for a quick setup of frontendDependencies field, run:
npx fedep init
you still have to update its fields according to what you need.
Additionally, you can also use local repo for a specific module:
npx fedep -l <some-module>:<path-to-local-repo>
Use semi comma ; to separate multiple pairs of local repos:
npx fedep -l "mod1:path-to-mod1;mod2:path-to-mod2;mod3:path-to-mod3"
you can use either string or object to list modules to be used. e.g.,
["ldLazy", ..., {name: "ldview"}, ...]
If object is used, it contains following fields:
Use npx fedep publish to publish based on dist folder along with core files such as package.json. For example, say you have following directory structure:
npx fedep publish merge above content into .fedep/publish as below:
and trigger npm publish --access public .fedep/publish. Additionally, npx fedep publish also alters copied package.json with following changes to reflect the change of the directory structure:
publish command also publish files listed in files field, with their original directory structure, except dist folder. dist is by default removed with its content moved to root. To keep dist folder, use --dup true option:
npx fedep publish --dup true
You can also use a different dist folder by folder option:
npx fedep publish --folder another-dist
If you don't have a dist folder and want to publish only files listed in package.json's files field along with core files, use --skip-dist:
npx fedep publish --skip-dist
Additionally please note: it's convenient to add a publish script in scripts field, however this may cause trouble releasing your package because npm seems to prevent publish and trigger npm publish manually, causing issue during release.
So, please use alternative name such as release, as in the below example which release package to both npm and github:
"scripts": {
"release": "npx fedep publish; npx fedep publish -g"
}
Instead of using npm, if you want to publish to Github as a release, simply add -g option:
npx fedep publish -g
by default the published files will be push into a specific branch, which by default is release. add an additional option to overwrite this default branch:
npx fedep publish -g my-release-branch
see also:
add test.
MIT
| Back | FazBrowse Home | New Git URL |