Skip to content

Commit 4264100

Browse files
authored
Don't include private packages in public areas (#4112)
Don't consider workspace packages marked as private when: - Generating docs - Compiling TypeScript into JavaScript for publishing purposes (either locally or on CI) - Note that TypeScript code in private packages will still be typechecked locally, though. - Updating changelogs - Updating the diagram or list of packages in the README - Publishing releases (either preview builds or regular releases) This allows us to create an example controller package in `packages` that is purely local to this repo.
1 parent 342023d commit 4264100

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

.github/workflows/lint-build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Fetch workspace package names
2424
id: workspace-package-names
2525
run: |
26-
echo "child-workspace-package-names=$(yarn child-workspace-package-names-as-json)" >> "$GITHUB_OUTPUT"
26+
echo "child-workspace-package-names=$(yarn workspaces list --no-private --json | jq --slurp --raw-output 'map(.name) | @json')" >> "$GITHUB_OUTPUT"
2727
shell: bash
2828

2929
lint:

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
"scripts": {
1515
"build": "yarn run build:source && yarn run build:types",
1616
"build:clean": "rimraf dist '**/*.tsbuildinfo' && yarn build",
17-
"build:docs": "yarn workspaces foreach --parallel --interlaced --verbose run build:docs",
18-
"build:source": "yarn workspaces foreach --exclude @metamask/core-monorepo --parallel --interlaced --verbose run build",
17+
"build:docs": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run build:docs",
18+
"build:source": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run build",
1919
"build:types": "tsc --build tsconfig.build.json --verbose",
2020
"build:watch": "yarn run build --watch",
21-
"changelog:update": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:update",
22-
"changelog:validate": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:validate",
23-
"child-workspace-package-names-as-json": "ts-node scripts/child-workspace-package-names-as-json.ts",
21+
"changelog:update": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run changelog:update",
22+
"changelog:validate": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run changelog:validate",
2423
"create-package": "ts-node scripts/create-package",
2524
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn constraints && yarn lint:dependencies",
2625
"lint:dependencies": "depcheck && yarn dedupe --check",
@@ -30,7 +29,7 @@
3029
"lint:misc": "prettier '**/*.json' '**/*.md' '!**/CHANGELOG.old.md' '**/*.yml' '!.yarnrc.yml' '!merged-packages/**' --ignore-path .gitignore",
3130
"prepack": "./scripts/prepack.sh",
3231
"prepare-preview-builds": "./scripts/prepare-preview-builds.sh",
33-
"publish-previews": "yarn workspaces foreach --parallel --verbose run publish:preview",
32+
"publish-previews": "yarn workspaces foreach --no-private --parallel --verbose run publish:preview",
3433
"setup": "yarn install",
3534
"test": "yarn test:scripts --silent --collectCoverage=false --reporters=jest-silent-reporter && yarn test:packages",
3635
"test:clean": "yarn workspaces foreach --parallel --verbose run test:clean && yarn test",

scripts/child-workspace-package-names-as-json.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

scripts/update-readme-content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ async function retrieveWorkspaces(): Promise<Workspace[]> {
5252
'workspaces',
5353
'list',
5454
'--json',
55+
'--no-private',
5556
'--verbose',
5657
]);
5758

0 commit comments

Comments
 (0)