Skip to content

Commit

Permalink
feat: create zipper as module (tsconfig) and add new env values
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykKuniczak committed Jan 19, 2025
1 parent 9bf1016 commit 49f0487
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/zipper/index.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { resolve } from 'node:path';
import { zipBundle } from './lib';
import { zipBundle } from './lib/index.js';
import { IS_FIREFOX } from '@extension/env';

const YYYY_MM_DD = new Date().toISOString().slice(0, 10).replace(/-/g, '');
const HH_mm_ss = new Date().toISOString().slice(11, 19).replace(/:/g, '');
Expand All @@ -8,5 +9,5 @@ const fileName = `extension-${YYYY_MM_DD}-${HH_mm_ss}`;
await zipBundle({
distDirectory: resolve(import.meta.dirname, '..', '..', '..', 'dist'),
buildDirectory: resolve(import.meta.dirname, '..', '..', '..', 'dist-zip'),
archiveName: process.env.CLI_CEB_FIREFOX === 'true' ? `${fileName}.xpi` : `${fileName}.zip`,
archiveName: IS_FIREFOX ? `${fileName}.xpi` : `${fileName}.zip`,
});
3 changes: 2 additions & 1 deletion packages/zipper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
"clean:turbo": "rimraf .turbo",
"clean": "pnpm clean:bundle && pnpm clean:node_modules && pnpm clean:turbo",
"ready": "tsc -b",
"zip": "node dist/index.mjs",
"zip": "node --env-file=../../.env dist/index.mjs",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "pnpm lint --fix",
"prettier": "prettier . --write --ignore-path ../../.prettierignore",
"type-check": "tsc --noEmit"
},
"devDependencies": {
"@extension/tsconfig": "workspace:*",
"@extension/env": "workspace:*",
"fast-glob": "^3.3.2",
"fflate": "^0.8.2",
"tsx": "^4.19.2"
Expand Down
5 changes: 2 additions & 3 deletions packages/zipper/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"extends": "@extension/tsconfig/base",
"extends": "@extension/tsconfig/module",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"noEmit": false
"outDir": "dist"
},
"include": ["index.mts", "lib"]
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 49f0487

Please sign in to comment.