Skip to content

Commit 60e703a

Browse files
authored
Merge pull request #21 from PieLabs/feature/expose-pie-branch-param
expose --pieBranch param
2 parents 026b9d2 + f62476a commit 60e703a

2 files changed

Lines changed: 25 additions & 14 deletions

File tree

docs/pack-question.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ It generates 2 javascript files:
99
> Note: This doesn't generate the final question for you. To do that you'll need to create the final html page, include the 2 js files above, and use a controller that can interact with the controller-map.js file. See [pie-docs](http://pielabs.github.io/pie-docs) for more infomation.
1010
1111
### Options
12+
`--pieBranch` - what branch of the pie dependencies (pie-player, pie-control-panel, etc) to use: default: `develop`.
1213
`--clean` - clean build assets before packing. default: `false`
1314
`--support` - a js file to load to add support for a build type. See below.
1415
`--dir` - the relative path to a directory to use as the root. This should contain `config.json` and `index.html` (default: the current working directory)

src/question/packer.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class Packer {
3939

4040
logger.silly('[pack] opts: ', opts);
4141

42-
let npmDependencies = _.extend({}, DEFAULT_DEPENDENCIES, this._question.npmDependencies);
42+
let npmDependencies = _.extend({}, DEFAULT_DEPENDENCIES(opts.pieBranch), this._question.npmDependencies);
4343

4444
logger.debug('npm dependencies: ', JSON.stringify(npmDependencies));
4545

@@ -93,18 +93,27 @@ export default class Packer {
9393
}
9494
}
9595

96-
export const DEFAULT_DEPENDENCIES = {
97-
'babel-core': '^6.17.0',
98-
'babel-loader': '^6.2.5',
99-
'style-loader': '^0.13.1',
100-
'css-loader': '^0.25.0',
101-
'babel-preset-es2015': '^6.16.0',
102-
'css-loader': '^0.25.0',
103-
'pie-player': 'PieLabs/pie-player',
104-
'pie-controller': 'PieLabs/pie-controller',
105-
'pie-control-panel': 'PieLabs/pie-control-panel',
106-
'style-loader': '^0.13.1',
107-
'webpack': '2.1.0-beta.21'
96+
export let DEFAULT_DEPENDENCIES = (branch) => {
97+
98+
branch = branch || 'master';
99+
100+
let branchSpecific = {
101+
'pie-player': `PieLabs/pie-player#${branch}`,
102+
'pie-controller': `PieLabs/pie-controller#${branch}`,
103+
'pie-control-panel': `PieLabs/pie-control-panel#${branch}`
104+
}
105+
106+
return _.extend({
107+
'babel-core': '^6.17.0',
108+
'babel-loader': '^6.2.5',
109+
'style-loader': '^0.13.1',
110+
'css-loader': '^0.25.0',
111+
'babel-preset-es2015': '^6.16.0',
112+
'css-loader': '^0.25.0',
113+
'style-loader': '^0.13.1',
114+
'webpack': '2.1.0-beta.21'
115+
116+
}, branchSpecific);
108117
};
109118

110119
export const DEFAULTS = {
@@ -117,5 +126,6 @@ export const DEFAULTS = {
117126
keepBuildAssets: true,
118127
pieJs: 'pie.js',
119128
controllersJs: 'controllers.js',
120-
fullInstall: false
129+
fullInstall: false,
130+
pieBranch: 'develop'
121131
}

0 commit comments

Comments
 (0)