Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor package.json files to the package’s root #6562

Merged
merged 2 commits into from Oct 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions CHANGELOG.md
Expand Up @@ -4,15 +4,15 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

## Master

- Run the engines check before showing the UI for `upgrade-interactive`
- Ensures the engine check is ran before showing the UI for `upgrade-interactive`

[#6536](https://github.com/yarnpkg/yarn/pull/6536) - [**Orta Therox**](https://github.com/orta)

- Restore Node v4 support by downgrading `cli-table3`
- Restores Node v4 support by downgrading `cli-table3`

[#6535](https://github.com/yarnpkg/yarn/pull/6535) - [**Mark Stacey**](https://github.com/Gudahtt)

- Prevent infinite loop when parsing corrupted lockfile with unterminated string
- Prevents infinite loop when parsing corrupted lockfiles with unterminated strings

[#4965](https://github.com/yarnpkg/yarn/pull/4965) - [**Ryan Hendrickson**](https://github.com/rhendric)

Expand All @@ -32,6 +32,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

[#5322](https://github.com/yarnpkg/yarn/pull/5322) - [**Karolis Narkevicius**](https://twitter.com/KidkArolis)

- Fixes how the `files` property is interpreted to bring it in line with npm

[#6562](https://github.com/yarnpkg/yarn/pull/6562) - [**Bertrand Marron**](https://github.com/tusbar)

## 1.12.0

- Adds initial support for PnP on Windows
Expand Down
12 changes: 12 additions & 0 deletions __tests__/commands/pack.js
Expand Up @@ -67,6 +67,18 @@ test.concurrent('pack should include all files listed in the files array', (): P
});
});

test.concurrent('pack should include files based from the package’s root', (): Promise<void> => {
return runPack([], {}, 'files-include-from-root', async (config): Promise<void> => {
const {cwd} = config;
const files = await getFilesFromArchive(
path.join(cwd, 'files-include-from-root-v1.0.0.tgz'),
path.join(cwd, 'files-include-from-root-v1.0.0'),
);
expect(files.indexOf('index.js')).toBeGreaterThanOrEqual(0);
expect(files.indexOf('sub/index.js')).toEqual(-1);
});
});

test.concurrent('pack should included globbed files', (): Promise<void> => {
return runPack([], {}, 'files-glob', async (config): Promise<void> => {
const {cwd} = config;
Expand Down
1 change: 1 addition & 0 deletions __tests__/fixtures/pack/files-include-from-root/index.js
@@ -0,0 +1 @@
console.log('included');
6 changes: 6 additions & 0 deletions __tests__/fixtures/pack/files-include-from-root/package.json
@@ -0,0 +1,6 @@
{
"name": "files-include-from-root",
"version": "1.0.0",
"license": "MIT",
"files": ["index.js"]
}
@@ -0,0 +1 @@
console.log('not included');
2 changes: 1 addition & 1 deletion src/cli/commands/pack.js
Expand Up @@ -88,7 +88,7 @@ export async function packTarball(
onlyFiles.map((filename: string): string => `!${filename}`),
onlyFiles.map((filename: string): string => `!${path.join(filename, '**')}`),
);
const regexes = ignoreLinesToRegex(lines, '.');
const regexes = ignoreLinesToRegex(lines, './');
filters = filters.concat(regexes);
}

Expand Down