CopFy
Dependencies
- @actjs.on/no-dir
Installing
$ npm i @actjs.on/cop-fy --save-dev
Usage
Create a file path @actjs.on/cop-fy.json
in your project's directory, like root-directory-of-project/settings/@actjs.on/cop-fy.json
with the below settings:
{
"$schema": "../../node_modules/@actjs.on/cop-fy/settings/schema.json",
"rootProjectPath": "../../../",
"rootPath2CopyFor": "dist/@scope/library-name",
"settings": [
{
"extPatterns": [
"ext",
"*.ext2.ext"
],
"pathsOfCopyFilesSettings": {
"exceptionPatterns": [
".git/...",
"dist/...",
"node_modules/...",
"settings/..."
],
"copySettings": [
{
"copyFromSubpath": "lib/subfolder-1",
"patterns": [
"src/lib/subfolder-of-first-lib-folder/subfolder-1/lib/subfolder-1/..."
]
}
]
}
}
]
}
Then in, package.json
file, in script
setting, do as below:
"scripts": {
"build:prepare": "git pull && tsc -b",
"rwin:set-cop-fy-settings-directory": "npm set ACTJS_ON_SETTINGS_DIRECTORY=%INIT_CWD%/settings",
"rwin:cop-fy:copy-files": "npm run rwin:set-cop-fy-settings-directory && npm explore @actjs.on/cop-fy -- npm run copy-files",
"rwin:build": "npm run build:prepare && npm run rwin:cop-fy:copy-files"
}
So, inside root-directory-of-project
, run:
$ npm run rwin:build && npm publish dist/@scope/library-name
Settings
Name | Description |
---|---|
rootProjectPath | Required. Type: string |
rootPath2CopyFor | Required. Type: string |
settings | Required. Type: object[] |
extPatterns | Optional. Type: string[] |
pathsOfCopyFilesSettings | Required. Type: object[] |
exceptionPatterns | Optional. Type: string[] |
copySettings | Required. Type: string[] |
patterns | Required. Type: string[] |
copyFromSubpath | Optional. Type: string. If it isn’t defined the files will be copied to informed path to rootPath2CopyFor , but the path defined in copySettings will be considered. |