Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yeoman Migration #148

Closed
wants to merge 16 commits into from
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
21 changes: 0 additions & 21 deletions __mocks__/creator/validate-options.mock.js

This file was deleted.

28 changes: 17 additions & 11 deletions lib/creator/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const yeoman = require('yeoman-environment');
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const path = require('path');
const defaultGenerator = require('./yeoman/webpack-generator');
const WebpackAdapter = require('./yeoman/webpack-adapter');
const runTransform = require('./transformations/index');

const defaultGenerator = require('webpack-addons').WebpackGenerator;
const runTransform = require('webpack-addons').initTransform;
const WebpackAdapter = require('./utils/webpack-adapter');
/*
* @function creator
*
Expand All @@ -31,13 +31,19 @@ function creator(options) {
env.registerStub(defaultGenerator, 'webpack-default-generator');
}

env.run(generatorName).on('end', () => {
if(generatorName !== 'webpack-default-generator') {
//HACK / FIXME
env = env.options.env;
return runTransform(env.configuration);
} else {
return runTransform(env.getArgument('configuration'));
return env.run(generatorName).on('end', () => {
if(generatorName === 'webpack-default-generator') {
return runTransform(env.configuration).then( (didFinish) => {
if(didFinish) {
process.stdout.write('\n' + chalk.green(
'Congratulations! Your new webpack configuration file has been created!\n'
));
} else {
process.stdout.write('\n' + chalk.red(
'Sorry! Your webpack configuration did not fully succeed !\n'
));
}
});
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/creator/index.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const replaceGeneratorName = require('./index').replaceGeneratorName;
var replaceGeneratorName = require('./index').replaceGeneratorName;

describe('replaceGeneratorName', () => {

it('should replace a pattern of an addon', () => {
const generatorName = replaceGeneratorName('webpack-addons-thefox');
var generatorName = replaceGeneratorName('webpack-addons-thefox');
expect(generatorName).toEqual('generator-thefox');
});

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions lib/creator/transformations/context/context.js

This file was deleted.

5 changes: 0 additions & 5 deletions lib/creator/transformations/context/context.test.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions lib/creator/transformations/devtool/devtool.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/creator/transformations/devtool/devtool.test.js

This file was deleted.

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions lib/creator/transformations/entry/entry.js

This file was deleted.

17 changes: 0 additions & 17 deletions lib/creator/transformations/entry/entry.test.js

This file was deleted.

Loading