From c4fbf2031f495077dea5912fd97632dd06f6e52d Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Wed, 15 Jun 2016 18:43:50 -0400 Subject: [PATCH] chore(all): prepare release 1.0.0-beta.2.0.1 --- .eslintrc | 3 --- .eslintrc.json | 3 +++ dist/index.js | 12 ++++++++---- dist/resolve-template.js | 21 +++++++++++---------- package.json | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.json diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index f674032..0000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/aurelia-tools/.eslintrc" -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..6cbb37d --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/aurelia-tools/.eslintrc.json" +} diff --git a/dist/index.js b/dist/index.js index 6a2e10f..5dc5a38 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14,7 +14,7 @@ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var path = require('path'); +var path = require('upath'); var ContextElementDependency = require('webpack/lib/dependencies/ContextElementDependency'); var resolveTemplates = require('./resolve-template'); @@ -23,8 +23,8 @@ var AureliaWebpackPlugin = function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; (0, _classCallCheck3.default)(this, AureliaWebpackPlugin); - options.root = options.root || path.dirname(module.parent.filename); - options.src = options.src || path.resolve(options.root, 'src'); + options.root = path.normalizeSafe(options.root) || path.dirname(module.parent.filename); + options.src = path.normalizeSafe(options.src) || path.resolve(options.root, 'src'); options.resourceRegExp = options.resourceRegExp || /aurelia-loader-context/; this.options = options; @@ -43,7 +43,8 @@ var AureliaWebpackPlugin = function () { }); cmf.plugin('after-resolve', function (result, callback) { if (!result) return callback(); - if (_this.options.src.indexOf(result.resource, _this.options.src.length - result.resource.length) !== -1) { + var resourcePath = path.normalizeSafe(result.resource); + if (_this.options.src.indexOf(resourcePath, _this.options.src.length - resourcePath.length) !== -1) { (function () { var resolveDependencies = result.resolveDependencies; @@ -116,6 +117,9 @@ var AureliaWebpackPlugin = function () { return callback(null, dependencies); }, function (error) { console.error('Error processing templates', error.message); + console.error('-----------------------'); + console.error(error); + console.error('-----------------------'); return callback(error); }); }); diff --git a/dist/resolve-template.js b/dist/resolve-template.js index 1c76284..74e9757 100644 --- a/dist/resolve-template.js +++ b/dist/resolve-template.js @@ -196,7 +196,7 @@ var processAll = function () { case 63: fromPath = _ref3; - _moduleName = fromPath.split(path.sep)[0]; + _moduleName = fromPath.split(pathSep)[0]; rootAlias = resource.root ? path.resolve(options.root, 'node_modules', _moduleName, resource.root) : undefined; if (!rootAlias && baseVendorPkg.aurelia.build.moduleRootOverride && baseVendorPkg.aurelia.build.moduleRootOverride[_moduleName]) { @@ -422,7 +422,7 @@ var getDependency = function () { case 0: if (webpackRequireString.indexOf('..') == -1) { dependencies[webpackRequireString] = webpackPath; - console.log((fromWithinModule ? '<' + fromWithinModule + '> ' + '[' + path.basename(requestedBy) : '[' + requestedByRelativeToSrc) + '] required "' + webpackRequireString + '" from "' + webpackPath.replace(optionsGlobal.root + path.sep, '') + '".'); + console.log((fromWithinModule ? '<' + fromWithinModule + '> ' + '[' + path.basename(requestedBy) : '[' + requestedByRelativeToSrc) + '] required "' + webpackRequireString + '" from "' + webpackPath.replace(optionsGlobal.root + pathSep, '') + '".'); filesProcessed.push(webpackRequireString); } @@ -435,7 +435,7 @@ var getDependency = function () { dependencies[htmlWebpackRequireString] = getPath(htmlCounterpart, isLazy, bundleName); - console.log((fromWithinModule ? '<' + fromWithinModule + '> ' + '[' + path.basename(requestedBy) : '[' + requestedByRelativeToSrc) + '] required "' + htmlWebpackRequireString + '" from "' + htmlCounterpart.replace(optionsGlobal.root + path.sep, '') + '".'); + console.log((fromWithinModule ? '<' + fromWithinModule + '> ' + '[' + path.basename(requestedBy) : '[' + requestedByRelativeToSrc) + '] required "' + htmlWebpackRequireString + '" from "' + htmlCounterpart.replace(optionsGlobal.root + pathSep, '') + '".'); filesProcessed.push(htmlWebpackRequireString); @@ -467,7 +467,7 @@ var getDependency = function () { case 0: dependencies = {}; requestedByRelativeToSrc = path.relative(srcPath, requestedBy); - split = requestedByRelativeToSrc.split(path.sep); + split = requestedByRelativeToSrc.split(pathSep); if (split[0] == 'node_modules') { nodeModulesList = nodeModulesList.concat([path.join(srcPath, 'node_modules')]); @@ -607,7 +607,7 @@ var getDependency = function () { webpackPath = getPath(moduleName, isLazy, bundleName); webpackRequireString = './' + fromPath; } else if (stats.isFile()) { - moduleName = fromPath.split('/')[0]; + moduleName = fromPath.split(pathSep)[0]; modulePath = path.resolve(nodeModulesList[nodeModulesIndex], moduleName); webpackPath = getPath(fullPath, isLazy, bundleName); @@ -760,7 +760,7 @@ var getDependency = function () { break; } - pathParts = fromPath.split('/'); + pathParts = fromPath.split(pathSep); if (!(!pathIsLocal && pathParts.length > 1 && rootAlias && rootAlias !== srcPath)) { _context5.next = 111; @@ -769,7 +769,7 @@ var getDependency = function () { _moduleName2 = pathParts.shift(); relativeRootAlias = path.relative(srcPath, rootAlias); - relativeRootSplit = relativeRootAlias.split(path.sep); + relativeRootSplit = relativeRootAlias.split(pathSep); if (relativeRootSplit[0] == '..') { relativeRootSplit.shift(); @@ -780,7 +780,7 @@ var getDependency = function () { } relativeRootAlias = relativeRootSplit.join('/'); - rootedFromPath = path.join(_moduleName2, relativeRootAlias, pathParts.join(path.sep)); + rootedFromPath = path.join(_moduleName2, relativeRootAlias, pathParts.join(pathSep)); if (!(rootedFromPath !== fromPath && !triedToCorrectPath)) { _context5.next = 111; @@ -829,12 +829,13 @@ var getDependency = function () { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var path = require('path'); +var path = require('upath'); var fileSystem = require('fs'); var readdir = require('recursive-readdir'); var assign = _assign2.default || require('object.assign'); var Promise = require('bluebird'); var cheerio = require('cheerio'); +var pathSep = '/'; var filesProcessed = []; var modulesProcessed = []; @@ -866,7 +867,7 @@ function getPath(input, lazy, bundle) { } function getPathWithoutExtension(input) { - return path.join(path.parse(input).dir, path.parse(input).name); + return path.trimExt(input); } module.exports = { diff --git a/package.json b/package.json index 46f073c..9e28f1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-webpack-plugin", - "version": "1.0.0-beta.2.0.0", + "version": "1.0.0-beta.2.0.1", "description": "A plugin for webpack that enables bundling Aurelia applications.", "keywords": [ "aurelia",