Skip to content

Commit

Permalink
replace files flag with content
Browse files Browse the repository at this point in the history
  • Loading branch information
wclr committed Aug 27, 2021
1 parent f2d963b commit 12e3ef3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 1.0.0.pre.54 (Unreleased)

- fix default pure add in workspaces (regression)
- BREAKING: remove `files` flag
- add `content` flag (instead of `files`)

## 1.0.0.pre.53 (2021-04-28)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Some documented features might not have been published yet, see the [change log]
- If your package has any of these lifecycle scripts: `prepublish`, `prepare`, `prepublishOnly`, `prepack`, `preyalcpublish`, they will run before in this order. If your package has any of these: `postyalcpublish`, `postpack`, `publish`, `postpublish`, they will run after in this order. Use `--no-scripts` to publish without running scripts.
- While copying package content, `yalc` calculates the hash signature of all files and, by default, adds this signature to the package manifest `version`. You can disable this by using the `--no-sig` option.
- You may also use `.yalcignore` to exclude files from publishing to yalc repo, for example, files like README.md, etc.
- `--files` flag will show included files in the published package
- `--content` flag will show included files in the published package
- **NB!** In terms of which files will be included in the package `yalc` fully supposed to emulate behavior of `npm` client (`npm pack`). [If you have nested `.yalc` folder in your package](https://github.com/whitecolor/yalc/issues/95) that you are going to publish with `yalc` and you use `package.json` `files` list, it should be included there explicitly.
- **NB!** Windows users should make sure the `LF` new line symbol is used in published sources; it may be needed for some packages to work correctly (for example, `bin` scripts). `yalc` won't convert line endings for you (because `npm` and `yarn` won't either).
- **NB!** Note that, if you want to include `.yalc` folder in published package content, you should add `!.yalc` line to `.npmignore`.
Expand Down
4 changes: 2 additions & 2 deletions src/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const copyPackageToStore = async (options: {
workingDir: string
signature?: boolean
changed?: boolean
files?: boolean
content?: boolean
devMod?: boolean
workspaceResolve?: boolean
}): Promise<string | false> => {
Expand All @@ -153,7 +153,7 @@ export const copyPackageToStore = async (options: {
)

const filesToCopy = npmList.filter((f) => !ignoreRule.ignores(f))
if (options.files) {
if (options.content) {
console.info('Files included in published content:')
filesToCopy.forEach((f) => {
console.log(`- ${f}`)
Expand Down
2 changes: 1 addition & 1 deletion src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface PublishPackageOptions {
update?: boolean
replace?: boolean
npm?: boolean
files?: boolean
content?: boolean
private?: boolean
scripts?: boolean
devMod?: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/yalc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getPublishOptions = (
replace: argv.replace,
signature: argv.sig,
changed: argv.changed,
files: argv.files,
content: argv.content,
private: argv.private,
scripts: argv.scripts,
update: argv.update || argv.upgrade,
Expand Down

0 comments on commit 12e3ef3

Please sign in to comment.