chore: pure ESM (#1202)

This commit is contained in:
Eli Bosley
2025-02-25 14:14:14 -05:00
committed by GitHub
parent d59ca415af
commit ae47866724
350 changed files with 2587 additions and 1923 deletions

View File

@@ -30,14 +30,14 @@ try {
// Create a temporary directory for packaging
await mkdir('./deploy/pack/', { recursive: true });
await writeFile('./deploy/pack/package.json', JSON.stringify(parsedPackageJson, null, 4));
// Copy necessary files to the pack directory
await $`cp -r dist README.md .env.* ecosystem.config.json ./deploy/pack/`;
// Change to the pack directory and install dependencies
cd('./deploy/pack');
console.log('Installing production dependencies...');
$.verbose = true;
await $`pnpm install --prod --ignore-workspace --node-linker hoisted`;
@@ -48,10 +48,9 @@ try {
// Create the tarball
await $`tar -czf ../release/unraid-api.tgz ./`;
// Clean up
cd('..');
} catch (error) {
// Error with a command
if (Object.keys(error).includes('stderr')) {

View File

@@ -19,10 +19,12 @@ export const getDeploymentVersion = async (env = process.env, packageVersion: st
return env.IS_TAGGED ? packageVersion : `${packageVersion}+${env.GIT_SHA}`;
} else {
const gitShortSHA = await runCommand('git', ['rev-parse', '--short', 'HEAD']);
const isCommitTagged = await runCommand('git', ['describe', '--tags', '--abbrev=0', '--exact-match']) !== undefined;
const isCommitTagged =
(await runCommand('git', ['describe', '--tags', '--abbrev=0', '--exact-match'])) !==
undefined;
console.log('gitShortSHA', gitShortSHA, 'isCommitTagged', isCommitTagged);
if (!gitShortSHA) {
console.error('Failed to get git short SHA');
process.exit(1);