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
6 changes: 4 additions & 2 deletions org.coloradomesh.MeshClient.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ modules:
PNPM_HOME: /run/build/mesh-client/.pnpm
pnpm_config_cache: /run/build/mesh-client/.npm
build-commands:
# Install pnpm standalone binary from archived release (no network needed).
# Install pnpm standalone from archived release (no network needed).
# Archive extracts to pnpm-vendor/ (strip-components: 0) so the root `pnpm` binary is
# kept and the bundled dist/ does not collide with app dist/.
# kept and the bundled dist/ does not collide with app dist/. pnpm 11+ requires
# dist/pnpm.mjs next to the wrapper binary (install alone is not enough).
- install -Dm755 pnpm-vendor/pnpm /run/build/mesh-client/.pnpm-bin/pnpm
- cp -a pnpm-vendor/dist /run/build/mesh-client/.pnpm-bin/dist
# Offline install using generated-sources.json (retries @jsr temp-dir races).
# --store-dir must use the sandbox-absolute path because the type:shell
# source that writes .npmrc runs outside the sandbox, so $PWD there is
Expand Down
9 changes: 9 additions & 0 deletions scripts/check-flatpak.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ function checkManifestPnpmVersion(pkg) {
}
}

// The standalone wrapper requires dist/pnpm.mjs beside .pnpm-bin/pnpm.
if (!/cp\s+-a\s+pnpm-vendor\/dist\s+\/run\/build\/mesh-client\/\.pnpm-bin\/dist\b/.test(yaml)) {
violations.push({
file: rel,
message:
'manifest must copy pnpm-vendor/dist into .pnpm-bin/dist (pnpm 11+ wrapper needs dist/pnpm.mjs)',
});
}

return violations;
}

Expand Down
18 changes: 18 additions & 0 deletions scripts/flatpak-pnpm-bin.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @vitest-environment node
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { describe, expect, it } from 'vitest';

const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const MANIFEST = path.join(ROOT, 'org.coloradomesh.MeshClient.yml');

describe('Flatpak pnpm standalone install', () => {
it('copies pnpm-vendor/dist beside the wrapper binary (pnpm 11+ needs dist/pnpm.mjs)', () => {
const yaml = fs.readFileSync(MANIFEST, 'utf8');
expect(yaml).toMatch(
/install -Dm755 pnpm-vendor\/pnpm \/run\/build\/mesh-client\/\.pnpm-bin\/pnpm/,
);
expect(yaml).toMatch(/cp -a pnpm-vendor\/dist \/run\/build\/mesh-client\/\.pnpm-bin\/dist/);
});
});