Skip to content

Commit 07ff822

Browse files
committed
feat: Output ZIP files instead of XPI files
1 parent 830065b commit 07ff822

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/cmd/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ function defaultPackageCreator(
3131
filter: (...args) => fileFilter.wantFile(...args),
3232
})
3333
.then((buffer) => {
34+
let extension = 'zip';
3435
let packageName = safeFileName(
35-
`${manifestData.name}-${manifestData.version}.xpi`);
36+
`${manifestData.name}-${manifestData.version}.${extension}`);
3637
let extensionPath = path.join(artifactsDir, packageName);
3738
let stream = createWriteStream(extensionPath);
3839
let promisedStream = streamToPromise(stream);

tests/test-cmd/test.build.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('build', () => {
2424
})
2525
.then((buildResult) => {
2626
assert.match(buildResult.extensionPath,
27-
/minimal_extension-1\.0\.xpi$/);
27+
/minimal_extension-1\.0\.zip$/);
2828
return buildResult.extensionPath;
2929
})
3030
.then((extensionPath) => zipFile.open(extensionPath))
@@ -62,12 +62,12 @@ describe('build', () => {
6262
})
6363
.then((buildResult) => {
6464
assert.match(buildResult.extensionPath,
65-
/the_extension-0\.0\.1\.xpi$/);
65+
/the_extension-0\.0\.1\.zip$/);
6666
return buildResult.extensionPath;
6767
})
6868
));
6969

70-
it('asks FileFilter what files to include in the XPI', () => {
70+
it('asks FileFilter what files to include in the ZIP', () => {
7171
let zipFile = new ZipFile();
7272
let fileFilter = new FileFilter({
7373
filesToIgnore: ['**/background-script.js'],
@@ -99,7 +99,7 @@ describe('build', () => {
9999
{manifestData: basicManifest, onSourceChange, fileFilter})
100100
.then((buildResult) => {
101101
// Make sure we still have a build result.
102-
assert.match(buildResult.extensionPath, /\.xpi$/);
102+
assert.match(buildResult.extensionPath, /\.zip$/);
103103
return buildResult;
104104
})
105105
.then((buildResult) => {
@@ -122,7 +122,7 @@ describe('build', () => {
122122
.then(() => args.onChange());
123123
})
124124
.then((buildResult) => {
125-
assert.match(buildResult.extensionPath, /\.xpi$/);
125+
assert.match(buildResult.extensionPath, /\.zip$/);
126126
return fs.stat(buildResult.extensionPath);
127127
})
128128
.then((stat) => {
@@ -209,7 +209,7 @@ describe('build', () => {
209209
assert.equal(filter.wantFile('some.xpi'), true);
210210
assert.equal(filter.wantFile('manifest.json'), false);
211211
});
212-
212+
213213
it('ignores node_modules by default', () => {
214214
assert.equal(defaultFilter.wantFile('path/to/node_modules'), false);
215215
});

tests/test-cmd/test.sign.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('sign', () => {
7575
// Do a sanity check that a built extension was passed to the
7676
// signer.
7777
assert.include(stubs.signAddon.firstCall.args[0].xpiPath,
78-
'minimal_extension-1.0.xpi');
78+
'minimal_extension-1.0.zip');
7979
});
8080
}
8181
));

tests/test-firefox/test.firefox.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ describe('firefox', () => {
354354
return withTempDir(
355355
(tmpDir) => {
356356
let data = {
357-
extensionPath: fixturePath('minimal_extension-1.0.xpi'),
357+
extensionPath: fixturePath('minimal_extension-1.0.zip'),
358358
profile: undefined,
359359
profileDir: path.join(tmpDir.path(), 'profile'),
360360
};
@@ -411,19 +411,19 @@ describe('firefox', () => {
411411

412412
it('requires a directory path for proxy installs', () => setUp(
413413
(data) => {
414-
const xpiPath = fixturePath('minimal_extension-1.0.xpi');
414+
const extensionPath = fixturePath('minimal_extension-1.0.zip');
415415
return firefox.installExtension(
416416
{
417417
manifestData: basicManifest,
418418
profile: data.profile,
419-
extensionPath: xpiPath,
419+
extensionPath: extensionPath,
420420
asProxy: true,
421421
})
422422
.then(makeSureItFails())
423423
.catch(onlyInstancesOf(WebExtError, (error) => {
424424
assert.match(error.message,
425425
/must be the extension source directory/);
426-
assert.include(error.message, xpiPath);
426+
assert.include(error.message, extensionPath);
427427
}));
428428
}
429429
));

0 commit comments

Comments
 (0)