release: @johanleroy/git-arboretum 1.0.0 — publication sur le registre Gitea
Some checks failed
Release / Publish to Gitea npm registry (push) Failing after 4m57s
Some checks failed
Release / Publish to Gitea npm registry (push) Failing after 4m57s
- renomme le paquet en @johanleroy/git-arboretum (scope routé vers le registre npm Gitea privé) - embarque @arboretum/shared via bundleDependencies (scripts/vendor-shared.mjs au prepack) - joint README/LICENSE au tarball (scripts/copy-meta.mjs) + metadata, keywords, publishConfig - CI pack-smoke en mono-tarball avec assertion bundleDep ; nouveau workflow release.yml (publish sur tag v*) - version 1.0.0 ; README mis à jour (install scopé + service systemd) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
43
packages/server/scripts/vendor-shared.mjs
Normal file
43
packages/server/scripts/vendor-shared.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
// Embarque @arboretum/shared (dépendance runtime non publiée) DANS le tarball npm.
|
||||
// Branché sur le hook "prepack", aux côtés de bundleDependencies dans package.json.
|
||||
//
|
||||
// Pourquoi un vrai dossier et pas le symlink workspace : sous npm workspaces, shared
|
||||
// est seulement symlinké dans le node_modules racine ; `npm pack` n'embarque une
|
||||
// bundleDependency que si elle existe comme VRAI dossier dans le node_modules du
|
||||
// paquet packé (packages/server/node_modules/@arboretum/shared). On le matérialise ici.
|
||||
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const sharedDir = join(serverDir, '..', 'shared');
|
||||
const sharedDist = join(sharedDir, 'dist');
|
||||
const target = join(serverDir, 'node_modules', '@arboretum', 'shared');
|
||||
|
||||
if (!existsSync(sharedDist)) {
|
||||
console.error(
|
||||
`vendor-shared: ${sharedDist} introuvable — lance "npm run build" (shared doit être compilé) avant le pack.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// package.json minimal et déterministe : on reprend les champs de résolution réels de
|
||||
// shared (version incluse, pour rester synchro), sans scripts ni files inutiles au runtime.
|
||||
const shared = JSON.parse(readFileSync(join(sharedDir, 'package.json'), 'utf8'));
|
||||
const minimal = {
|
||||
name: shared.name,
|
||||
version: shared.version,
|
||||
type: shared.type,
|
||||
main: shared.main,
|
||||
types: shared.types,
|
||||
exports: shared.exports,
|
||||
};
|
||||
|
||||
// Idempotent : on repart d'un dossier propre à chaque pack.
|
||||
rmSync(target, { recursive: true, force: true });
|
||||
mkdirSync(target, { recursive: true });
|
||||
writeFileSync(join(target, 'package.json'), JSON.stringify(minimal, null, 2) + '\n');
|
||||
cpSync(sharedDist, join(target, 'dist'), { recursive: true });
|
||||
|
||||
console.log(`vendor-shared: embarqué ${shared.name}@${shared.version} -> ${target}`);
|
||||
Reference in New Issue
Block a user