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

[rush] Surface patternsToInclude and patternsToExclude on the deploy.json configuration #4259

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions build-tests/package-extractor-test-01/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "package-extractor-test-01",
"description": "This project is used by tests in the @rushstack/package-extractor package.",
"version": "1.0.0",
"private": true,
"scripts": {
"_phase:build": ""
},
"dependencies": {
"package-extractor-test-02": "workspace:*"
},
"devDependencies": {
"package-extractor-test-03": "workspace:*"
}
}
1 change: 1 addition & 0 deletions build-tests/package-extractor-test-01/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
12 changes: 12 additions & 0 deletions build-tests/package-extractor-test-02/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "package-extractor-test-02",
"description": "This project is used by tests in the @rushstack/package-extractor package.",
"version": "1.0.0",
"private": true,
"scripts": {
"_phase:build": ""
},
"dependencies": {
"package-extractor-test-03": "workspace:*"
}
}
1 change: 1 addition & 0 deletions build-tests/package-extractor-test-02/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
9 changes: 9 additions & 0 deletions build-tests/package-extractor-test-03/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-extractor-test-03",
"description": "This project is used by tests in the @rushstack/package-extractor package.",
"version": "1.0.0",
"private": true,
"scripts": {
"_phase:build": ""
}
}
1 change: 1 addition & 0 deletions build-tests/package-extractor-test-03/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
12 changes: 12 additions & 0 deletions build-tests/package-extractor-test-04/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "package-extractor-test-04",
"description": "This project is used by tests in the @rushstack/package-extractor package.",
"version": "1.0.0",
"private": true,
"scripts": {
"_phase:build": ""
},
"dependencies": {
"@rushstack/node-core-library": "workspace:*"
}
}
1 change: 1 addition & 0 deletions build-tests/package-extractor-test-04/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Add \"patternsToInclude\" and \"patternsToExclude\" support to Rush deploy.json configurations. This will allow developers to include or exclude provided glob patterns within a local project when running \"rush deploy\"",
D4N14L marked this conversation as resolved.
Show resolved Hide resolved
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/node-core-library",
"comment": "",
D4N14L marked this conversation as resolved.
Show resolved Hide resolved
"type": "none"
}
],
"packageName": "@rushstack/node-core-library"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/package-extractor",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/package-extractor"
}
8 changes: 8 additions & 0 deletions common/config/rush/nonbrowser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,14 @@
"name": "open",
"allowedCategories": [ "libraries" ]
},
{
"name": "package-extractor-test-02",
"allowedCategories": [ "tests" ]
},
{
"name": "package-extractor-test-03",
"allowedCategories": [ "tests" ]
},
{
"name": "postcss",
"allowedCategories": [ "libraries", "tests" ]
Expand Down
30 changes: 27 additions & 3 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/repo-state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "5b48f46bcf623f6b470ccb325aabfa560dac4337",
"pnpmShrinkwrapHash": "1acb86f1b88b96c9dfced5d5c8c20d96302b0b1f",
"preferredVersionsHash": "1926a5b12ac8f4ab41e76503a0d1d0dccc9c0e06"
}
16 changes: 8 additions & 8 deletions libraries/node-core-library/src/Import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ export class Import {
preserveSymlinks: false,
realpathSync: getRealPath
});
} catch (e) {
throw new Error(`Cannot find module "${modulePath}" from "${options.baseFolderPath}".`);
} catch (e: unknown) {
throw new Error(`Cannot find module "${modulePath}" from "${options.baseFolderPath}": ${e}`);
}
}

Expand Down Expand Up @@ -383,8 +383,8 @@ export class Import {
}
);
return await resolvePromise;
} catch (e) {
throw new Error(`Cannot find module "${modulePath}" from "${options.baseFolderPath}".`);
} catch (e: unknown) {
throw new Error(`Cannot find module "${modulePath}" from "${options.baseFolderPath}": ${e}`);
}
}

Expand Down Expand Up @@ -444,8 +444,8 @@ export class Import {

const packagePath: string = path.dirname(resolvedPath);
return packagePath;
} catch {
throw new Error(`Cannot find package "${packageName}" from "${baseFolderPath}".`);
} catch (e: unknown) {
throw new Error(`Cannot find package "${packageName}" from "${baseFolderPath}": ${e}.`);
}
}

Expand Down Expand Up @@ -536,8 +536,8 @@ export class Import {

const packagePath: string = path.dirname(resolvedPath);
return packagePath;
} catch {
throw new Error(`Cannot find package "${packageName}" from "${baseFolderPath}".`);
} catch (e: unknown) {
throw new Error(`Cannot find package "${packageName}" from "${baseFolderPath}": ${e}`);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find module \\"@rushstack/node-core-library\\" from \\"<packageRoot>/lib/test\\"."`;
exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find module \\"@rushstack/node-core-library\\" from \\"<packageRoot>/lib/test\\": Error: Cannot find module '@rushstack/node-core-library' from '<dirname>'"`;

exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 2`] = `"Cannot find module \\"@rushstack/node-core-library/lib/Constants.js\\" from \\"<packageRoot>/lib/test\\"."`;
exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 2`] = `"Cannot find module \\"@rushstack/node-core-library/lib/Constants.js\\" from \\"<packageRoot>/lib/test\\": Error: Cannot find module '@rushstack/node-core-library/lib/Constants.js' from '<dirname>'"`;

exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"Cannot find module \\"fs/foo/bar\\" from \\"<packageRoot>/lib/test\\"."`;
exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"Cannot find module \\"fs/foo/bar\\" from \\"<packageRoot>/lib/test\\": Error: Cannot find module 'fs/foo/bar' from '<dirname>'"`;

exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find module \\"fs\\" from \\"<packageRoot>/lib/test\\"."`;

exports[`Import resolvePackage allowSelfReference fails to resolve a path inside this package with allowSelfReference turned on 1`] = `"The package name \\"@rushstack/node-core-library/lib/Constants.js\\" contains an invalid character: \\"/\\""`;

exports[`Import resolvePackage allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find package \\"@rushstack/node-core-library\\" from \\"<packageRoot>/lib/test\\"."`;
exports[`Import resolvePackage allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find package \\"@rushstack/node-core-library\\" from \\"<packageRoot>/lib/test\\": Error: Cannot find module '@rushstack/node-core-library/' from '<dirname>'."`;

exports[`Import resolvePackage fails to resolve a path inside a dependency 1`] = `"The package name \\"@rushstack/heft/lib/start.js\\" contains an invalid character: \\"/\\""`;

exports[`Import resolvePackage fails to resolve a path inside a dependency of a dependency 1`] = `"The package name \\"@rushstack/ts-command-line/lib/Constants.js\\" contains an invalid character: \\"/\\""`;

exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"The package name \\"fs/foo/bar\\" contains an invalid character: \\"/\\""`;

exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find package \\"fs\\" from \\"<packageRoot>/lib/test\\"."`;
exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find package \\"fs\\" from \\"<packageRoot>/lib/test\\": Error: Cannot find module 'fs/' from '<dirname>'."`;
3 changes: 1 addition & 2 deletions libraries/package-extractor/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Keep temp folders in mocked 'repos' that are used for unit tests
!**/test/**/temp
test-output
4 changes: 4 additions & 0 deletions libraries/package-extractor/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
}
}
}
},

"test": {
"cleanFiles": [{ "sourcePath": "test-output" }]
}
}
}
Loading
Loading