Skip to content

Commit

Permalink
Merge branch 'master' into feat-2
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz authored Aug 25, 2024
2 parents c2f4982 + 3b156c9 commit c688bb9
Show file tree
Hide file tree
Showing 35 changed files with 2,097 additions and 1,135 deletions.
23 changes: 0 additions & 23 deletions .yarn/versions/022ed111.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .yarn/versions/14723858.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .yarn/versions/34e33c5b.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .yarn/versions/3a4fece1.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .yarn/versions/40390280.yml

This file was deleted.

File renamed without changes.
23 changes: 0 additions & 23 deletions .yarn/versions/67374fa9.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .yarn/versions/681ab739.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .yarn/versions/9f4940a4.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .yarn/versions/a712705e.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .yarn/versions/d8bd4f19.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .yarn/versions/db8fe3a1.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Features in `master` can be tried out by running `yarn set version from sources`
:::

- Fixes `preferInteractive` forcing interactive mode in non-TTY environments.
- `node-modules` linker now honors user-defined symlinks for `<workspace>/node_modules` directories

## 4.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ export const getHttpsCertificates = async () => {
csr,
clientKey,
selfSigned: true,
config: [`[v3_req]`, `basicConstraints = critical,CA:TRUE\``].join(`\n`),
});

const serverCSRResult = await createCSR({commonName: `localhost`});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {mockPluginServer} from './plugins.utility';
const COMMANDS_PLUGIN = (name: string, {async = false, printOnBoot = false, thirdParty = false} = {}) => `
const factory = ${async ? `async` : ``} r => {
const {Command} = r('clipanion');
const path = r('node:path');
if (${printOnBoot})
console.log('Booting ${name.toUpperCase()}');
Expand All @@ -22,6 +23,14 @@ const factory = ${async ? `async` : ``} r => {
this.context.stdout.write('Executing ${name.toUpperCase()}\\n');
}
},
class MyCommandPath extends Command {
static paths = [['${name}', 'path']];
async execute() {
this.context.stdout.write(path.posix.join('a', 'b') + '\\n');
}
},
],
},
};
Expand Down Expand Up @@ -77,6 +86,19 @@ describe(`Features`, () => {
});
}));

test(`it should support plugins using builtin modules`, makeTemporaryEnv({
}, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/plugin-a.js` as PortablePath, COMMANDS_PLUGIN(`a`));

await xfs.writeFilePromise(`${path}/.yarnrc.yml` as PortablePath, stringifySyml({
plugins: [`./plugin-a.js`],
}));

await expect(run(`a`, `path`)).resolves.toMatchObject({
stdout: `a/b\n`,
});
}));

test(`it should accept asynchronous plugins`, makeTemporaryEnv({
}, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/plugin-a.js` as PortablePath, COMMANDS_PLUGIN(`a`, {async: true}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,47 @@ describe(`Node_Modules`, () => {
}),
);

it(`should work with user-created <workspace>/node_modules symlinks`,
makeTemporaryEnv(
{
workspaces: [`ws`],
dependencies: {
},
},
{
nodeLinker: `node-modules`,
nmHoistingLimits: `workspaces`,
},
async ({path, run}) => {
await xfs.mkdirpPromise(ppath.join(path, `ws`));
const trueInstallDir = ppath.resolve(path, `target`);
await xfs.mkdirPromise(trueInstallDir);

await xfs.writeJsonPromise(ppath.join(path, `ws/${Filename.manifest}`), {
name: `ws`,
devDependencies: {
[`no-deps`]: `1.0.0`,
},
});

await xfs.symlinkPromise(trueInstallDir, ppath.join(path, `ws/node_modules`));

await run(`install`);

expect(xfs.existsSync(ppath.join(trueInstallDir, `no-deps`))).toBeTruthy();
expect(xfs.lstatSync(ppath.join(path, `ws/node_modules`)).isSymbolicLink()).toBeTruthy();

await xfs.writeJsonPromise(ppath.join(path, `ws/${Filename.manifest}`), {
name: `ws`,
});

await run(`install`);

expect(xfs.existsSync(ppath.join(trueInstallDir, `no-deps`))).toBeFalsy();
expect(xfs.lstatSync(ppath.join(path, `ws/node_modules`)).isSymbolicLink()).toBeTruthy();
}),
);

it(`should support supportedArchitectures`,
makeTemporaryEnv(
{
Expand Down
Loading

0 comments on commit c688bb9

Please sign in to comment.