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

fix prepublishOnly #4682

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
19 changes: 2 additions & 17 deletions .github/workflows/bundlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,9 @@ jobs:
- name: Build lib
run: corepack yarn run build:lib
- name: Make Uppy bundle use local version
run: |
node <<'EOF'
const pkg = require('./packages/uppy/package.json');
pkg.overrides = {};
(async () => {
for await (const { name } of await require('node:fs/promises').opendir('./packages/@uppy/')) {
pkg.overrides["@uppy/" + name] = `/tmp/packages/@uppy-${name}-${{ github.sha }}.tgz`;
}
for(const key of Object.keys(pkg.dependencies)) {
if (key in pkg.overrides) {
pkg.dependencies[key] = pkg.overrides[key];
}
}
require('node:fs').writeFileSync('./packages/uppy/package.json', JSON.stringify(pkg));
})();
EOF
run: node bin/replace-deps.mjs ${{ github.sha }}
- name: Eject public packages from repo
run: mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
run: mkdir /tmp/artifacts && for name in $(corepack yarn workspaces list --no-private --json | jq --raw-output .name); do (cd packages/${name} && echo ${name} && corepack yarn pack --install-if-needed -o /tmp/artifacts/${name//\//-}-${{ github.sha }}.tgz); done
- name: Upload artifact
if: success()
uses: actions/upload-artifact@v3
Expand Down
12 changes: 12 additions & 0 deletions bin/replace-deps.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { readFile, writeFile } from 'node:fs/promises'

const pkg = JSON.parse(await readFile('packages/uppy/package.json'))
pkg.overrides = {}
for (const key of Object.keys(pkg.dependencies)) {
const match = key.match(/^@uppy\/(.+)$/)
if (match) {
pkg.overrides[key] = `/tmp/artifacts/@uppy-${match[1]}-${process.argv[2]}.tgz`
pkg.dependencies[key] = pkg.overrides[key]
}
}
await writeFile('packages/uppy/package.json', JSON.stringify(pkg, null, 2))
2 changes: 1 addition & 1 deletion packages/@uppy/companion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"scripts": {
"build": "tsc -p .",
"deploy": "kubectl apply -f infra/kube/companion-kube.yml",
"prepublishOnly": "yarn run build",
"prepack": "corepack yarn run build",
"start": "node ./lib/standalone/start-server.js",
"test": "jest"
},
Expand Down