Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"grunt-contrib-watch": "1.0.0",
"grunt-coveralls": "1.0.1",
"grunt-eslint": "19.0.0",
"grunt-flowbin": "0.0.6",
"grunt-flowbin": "rpl/grunt-flowbin#fix/flow-bin-dep",
"grunt-mocha-test": "0.13.2",
"grunt-newer": "1.2.0",
"grunt-webpack": "1.0.15",
Expand Down
20 changes: 9 additions & 11 deletions src/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ import type {ExtensionManifest} from '../util/manifest';

// defaultPackageCreator types and implementation.

export type ExtensionBuildResult = {
extensionPath: string,
};
export type ExtensionBuildResult = {| extensionPath: string |};

export type PackageCreatorParams = {
export type PackageCreatorParams = {|
manifestData?: ExtensionManifest,
sourceDir: string,
fileFilter: FileFilter,
artifactsDir: string,
};
|};

export type PackageCreatorFn =
(params: PackageCreatorParams) => Promise<ExtensionBuildResult>;
Expand Down Expand Up @@ -72,18 +70,18 @@ async function defaultPackageCreator(

// Build command types and implementation.

export type BuildCmdParams = {
export type BuildCmdParams = {|
sourceDir: string,
artifactsDir: string,
asNeeded?: boolean,
};
|};

export type BuildCmdOptions = {
export type BuildCmdOptions = {|
manifestData?: ExtensionManifest,
fileFilter?: FileFilter,
onSourceChange?: OnSourceChangeFn,
packageCreator?: PackageCreatorFn,
};
|};

export default async function build(
{sourceDir, artifactsDir, asNeeded = false}: BuildCmdParams,
Expand Down Expand Up @@ -123,9 +121,9 @@ export default async function build(

// FileFilter types and implementation.

export type FileFilterOptions = {
export type FileFilterOptions = {|
filesToIgnore?: Array<string>,
};
|};

/*
* Allows or ignores files when creating a ZIP archive.
Expand Down
5 changes: 5 additions & 0 deletions src/util/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const log = createLogger(__filename);
export type ExtensionManifest = {
name: string,
version: string,
applications: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be applications? since it's optional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to applications? already upstream in #639

gecko: {
id: string
}
}
};

export default async function getValidatedManifest(
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test-cmd/test.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ describe('build', () => {
// Make sure a manifest without an ID doesn't throw an error.
return build({
sourceDir: fixturePath('minimal-web-ext'),
manifestData: manifestWithoutApps,
artifactsDir: tmpDir.path(),
}, {
manifestData: manifestWithoutApps,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sold! :) This is a great catch.

});
}
);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test-cmd/test.run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */
import path from 'path';
import {EventEmitter} from 'events';
import EventEmitter from 'events';
import {describe, it} from 'mocha';
import {assert} from 'chai';
import sinon from 'sinon';
Expand Down