Skip to content

Commit

Permalink
Build the zip artifact in dist/ instead of dist/[browser]
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Jun 28, 2024
1 parent b5c1269 commit 32d177a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions programs/cli/spec/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ describe('extension build', () => {
expect(
distFileExists(
template.name,
BROWSERS[0],
`${template.name}-1.0-source.zip`
)
).toBeTruthy()
Expand All @@ -119,7 +118,6 @@ describe('extension build', () => {
expect(
distFileExists(
template.name,
BROWSERS[0],
`${template.name}-nice.zip`
)
).toBeTruthy()
Expand Down
7 changes: 5 additions & 2 deletions programs/develop/steps/generateZip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@ export default function generateZip(
{browser = 'chrome', ...options}: BuildOptions
) {
try {
const outputDir = path.join(projectDir, 'dist', browser)
const distDir = path.join(projectDir, 'dist')
const outputDir = path.join(distDir, browser)
// We collect data from the projectDir if the user wants to zip the source files.
const dataDir = options.zipSource ? projectDir : outputDir
const manifest: Record<string, string> = require(
path.join(dataDir, 'manifest.json')
)
const name = getPackageName(manifest, options)
const ext = getExtensionExtension(browser)
// Dist zips are stored in dist/[browser]/[name].zip
const distZipPath = path.join(outputDir, `${name}.${ext}`)
const sourceZipPath = path.join(outputDir, `${name}-source.${ext}`)
// Source zips are stored in dist/[name]-source.zip
const sourceZipPath = path.join(distDir, `${name}-source.${ext}`)
const capitalizedBrowser = capitalizeBrowserName(browser)

if (options.zipSource) {
Expand Down

0 comments on commit 32d177a

Please sign in to comment.