Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spicy-hotels-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"modular-scripts": minor
---

Allow workspaces outside the `packages` directory
6 changes: 3 additions & 3 deletions __fixtures__/verifiable-project/packages/app-one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
},
"dependencies": {
"package-one": "workspace:*",
"package-two": "workspace:^",
"package-three": "workspace:~",
"package-four": "workspace:^1.0.0"
"package-two": "workspace:*",
"package-three": "workspace:*",
"package-four": "workspace:*"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ describe('verifyWorkspaceDependencies', () => {
expect(error).not.toHaveBeenCalled();
});

it('rejects packages not in the "packages" directory', async () => {
it('doesn\'t reject packages not in the "packages" directory', async () => {
mock(getModularRoot).mockReturnValue('__fixtures__/verifiable-project');

const checked = await check('__fixtures__/verifiable-project');
expect(checked).toBe(false);
expect(error).toHaveBeenCalledWith(
expect.stringContaining(
`package-four is not located within the "/packages" directory`,
),
);
expect(checked).toBe(true);
expect(error).not.toHaveBeenCalled();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ export async function check(target?: string): Promise<boolean> {
valid = false;
}

if (!packageInfo.location.startsWith('packages')) {
logger.error(
`${packageName} is not located within the "/packages" directory in the repository, instead found "${packageInfo.location}"`,
);
valid = false;
}

if (!isValidModularType(path.join(modularRoot, packageInfo.location))) {
logger.error(
`${packageName} at ${
Expand Down