From 4dcc5476b313045e264395e7b7bf43b6467da58e Mon Sep 17 00:00:00 2001 From: Dave Freeman Date: Wed, 21 Dec 2016 20:33:39 -0600 Subject: [PATCH 01/13] typo fix (#37) --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 7027bd24..0a6fa341 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,4 +7,4 @@ The enact-dev package includes the following documentation: * [Installation](./installation.md) * [Starting a New App](./starting-a-new-app.md) * [Loading an Existing App](./loading-existing-app.md) -* [Insomorphic Support](./isomorphic-support.md) +* [Isomorphic Support](./isomorphic-support.md) From 1745acc129c5e5be78e8484214e486bd85642393 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 22 Dec 2016 10:33:12 -0800 Subject: [PATCH 02/13] Minor update to example syntax --- template/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/template/README.md b/template/README.md index d9ef3752..794bf3a8 100644 --- a/template/README.md +++ b/template/README.md @@ -104,7 +104,7 @@ You would need to install an ESLint plugin for your editor first. Then, you will need to install some packages *globally*: ```sh -npm install -g enyojs/eslint-config-enact eslint-plugin-react eslint-plugin-babel babel-eslint +npm install -g enyojs/eslint-config-enact eslint-plugin-react eslint-plugin-babel babel-eslint eslint ``` @@ -128,7 +128,7 @@ For example: ### `Button.js` ```js -import kind from 'enact-core/kind'; +import kind from '@enact/core/kind'; const Button = kind({ render() { @@ -143,7 +143,7 @@ export default Button; // Don’t forget to use export default! ```js -import kind from 'enact-core/kind'; +import kind from '@enact/core/kind'; import Button from './Button'; // Import a component from another file const DangerButton = kind({ @@ -182,7 +182,7 @@ This project setup uses [Webpack](https://webpack.github.io/) for handling all a ### `Button.js` ```js -import kind from 'enact-core/kind'; +import kind from '@enact/core/kind'; import styles './Button.css'; // Tell Webpack that Button.js uses these styles const Button = kind({ @@ -208,7 +208,7 @@ You can **`import` an image right in a JavaScript module**. This tells Webpack t Here is an example: ```js -import kind from 'enyo-core/kind'; +import kind from '@enact/core/kind'; import logo from './logo.png'; // Tell Webpack this JS file uses this image console.log(logo); // /logo.84287d09.png From b24e0abb1107ceec6cd0e48c56d79449f27e4004 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 22 Dec 2016 12:12:11 -0800 Subject: [PATCH 03/13] Ignore webpack build warnings --- config/karma.conf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/karma.conf.js b/config/karma.conf.js index c4e20fe5..f1be1957 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -144,7 +144,8 @@ module.exports = function(karma) { reasons: false, timings: false, version: false, - children: false + children: false, + warnings: false } }, From 33ff84cde3b50b586cf0a1876b2d60105df35fb7 Mon Sep 17 00:00:00 2001 From: Derek Tor Date: Tue, 10 Jan 2017 17:10:31 -0800 Subject: [PATCH 04/13] Set failOnEmptyTestSuite to true (#38) Enact-DCO-1.1-Signed-off-by: Derek Tor derek.tor@lge.com --- config/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/karma.conf.js b/config/karma.conf.js index f1be1957..2ef99462 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -39,7 +39,7 @@ module.exports = function(karma) { [require.resolve('./proptype-checker')]: ['webpack'] }, - failOnEmptyTestSuite: false, + failOnEmptyTestSuite: true, webpack: { // Use essentially the same webpack config as from the development build setup. From dd73868bb3cf4bf08ae0123baaaa794eadc47df8 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 12 Jan 2017 10:51:57 -0800 Subject: [PATCH 05/13] =?UTF-8?q?PLAT-34559:=20Add=20polyfill=20for=20Stri?= =?UTF-8?q?ng.prototype.repeat=20for=20phantomjs=20te=E2=80=A6=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PLAT-34559: Add polyfill for String.prototype.repeat for phantomjs testing * Lock version number to minor revision Reviewed-By: Roy Sutton (roy.sutton@lge.com) Integrated-By: Aaron Tam (aaron.tam@lge.com) --- config/karma.conf.js | 2 ++ package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/config/karma.conf.js b/config/karma.conf.js index 2ef99462..cc545079 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -28,6 +28,7 @@ module.exports = function(karma) { frameworks: ['mocha', 'chai', 'dirty-chai'], files: [ require.resolve('./polyfills'), + require.resolve('string.prototype.repeat'), require.resolve('./proptype-checker'), './!(node_modules|dist|build)/**/*-specs.js' ], @@ -36,6 +37,7 @@ module.exports = function(karma) { // add webpack as preprocessor './!(node_modules|dist|build)/**/*.js': ['webpack'], [require.resolve('./polyfills')]: ['webpack'], + [require.resolve('string.prototype.repeat')]: ['webpack'], [require.resolve('./proptype-checker')]: ['webpack'] }, diff --git a/package.json b/package.json index f5915503..bd49b8c7 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "sinon": "git+https://github.com/sinonjs/sinon.git", "string.fromcodepoint": "~0.2.1", "string.prototype.codepointat": "~0.2.0", + "string.prototype.repeat": "~0.2.0", "strip-ansi": "~3.0.1", "style-loader": "~0.13.1", "webos-meta-webpack-plugin": "enyojs/webos-meta-webpack-plugin#0.1.1", From c53498770ce50beef08358a1f9e78000fb1bc96f Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Mon, 16 Jan 2017 12:02:13 -0800 Subject: [PATCH 06/13] PLAT-34552: add dist to .gitignore for app template (#41) Integrated-By: Ryan Duffy (ryan.duffy@lge.com) --- template/gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/template/gitignore b/template/gitignore index c5a93547..49c03385 100644 --- a/template/gitignore +++ b/template/gitignore @@ -8,6 +8,7 @@ coverage # production build +dist # misc .DS_Store From 1b9cb405d97d3056c98333484dac58691fd3236c Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Mon, 16 Jan 2017 16:56:04 -0800 Subject: [PATCH 07/13] ENYO-3803: Add config option for node polyfills (#43) * ENYO-3803: Add config option for node polyfills * Use null object instead of undefined. * Operator spacing --- README.md | 1 + config/karma.conf.js | 6 +++--- config/webpack.config.dev.js | 4 +++- config/webpack.config.prod.js | 4 +++- template/README.md | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f7d53972..63ec0dae 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ The enact-dev tool will check the project's `package.json` looking for an option * `isomorphic` _[boolean|string]_ - If `true`, it indicates the default entrypoint is isomorphic-compatible (and can be built via the `--isomorphic` enact-dev flag). If the value is a string, then it will use that value as a filepath to a custom isomorphic-compatible entrypoint. * `title` _[string]_ - Title text that should be put within the HTML's `` tags. Note: if this is a webOS-project, the title by default will be auto-detected from the appinfo.json content. * `ri` _[object]_ - Resolution independence options to be forwarded to the [LESS plugin](https://github.com/enyojs/less-plugin-resolution-independence). +* `node` _[object]_ - Configuration settings for polyfilling NodeJS built-ins. See `node` [webpack option](https://webpack.github.io/docs/configuration.html#node). * `proxy` _[string]_ - Proxy target during project `serve` to be used within the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware). For example: diff --git a/config/karma.conf.js b/config/karma.conf.js index cc545079..879bee57 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -15,7 +15,7 @@ function readJSON(file) { try { return JSON.parse(fs.readFileSync(file, {encoding:'utf8'})); } catch(e) { - return undefined; + return null; } } @@ -74,12 +74,12 @@ module.exports = function(karma) { 'react/lib/ExecutionEnvironment': true, 'react/lib/ReactContext': true }, - node: { + node: Object.assign({}, enact.node || {}, { console: true, fs: 'empty', net: 'empty', tls: 'empty' - }, + }), module: { loaders: [ {test: /\.(js|jsx|es6)$/, loader: 'babel', exclude: /node_modules.(?!@enact)/, diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 1e1782cc..ace25fda 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -26,7 +26,7 @@ function readJSON(file) { try { return JSON.parse(fs.readFileSync(file, {encoding:'utf8'})); } catch(e) { - return undefined; + return null; } } @@ -85,6 +85,8 @@ module.exports = { fallback: path.resolve('./node_modules') }, // @remove-on-eject-end + // Optional configuration for polyfilling NodeJS built-ins. + node: enact.node || null, module: { // First, run the linter. // It's important to do this before Babel processes the JS. diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 4355e281..bc90acf9 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -24,7 +24,7 @@ function readJSON(file) { try { return JSON.parse(fs.readFileSync(file, {encoding:'utf8'})); } catch(e) { - return undefined; + return null; } } @@ -77,6 +77,8 @@ module.exports = { fallback: path.resolve('./node_modules') }, // @remove-on-eject-end + // Optional configuration for polyfilling NodeJS built-ins. + node: enact.node || null, module: { // First, run the linter. // It's important to do this before Babel processes the JS. diff --git a/template/README.md b/template/README.md index 794bf3a8..26642356 100644 --- a/template/README.md +++ b/template/README.md @@ -71,6 +71,7 @@ The enact-dev tool will check the project's `package.json` looking for an option * `isomorphic` _[boolean|string]_ - If `true`, it indicates the default entrypoint is isomorphic-compatible (and can be built via the `--isomorphic` enact-dev flag). If the value is a string, then it will use that value as a filepath to a custom isomorphic-compatible entrypoint. * `title` _[string]_ - Title text that should be put within the HTML's `` tags. Note: if this is a webOS-project, the title by default will be auto-detected from the appinfo.json content. * `ri` _[object]_ - Resolution independence options to be forwarded to the [LESS plugin](https://github.com/enyojs/less-plugin-resolution-independence). +* `node` _[object]_ - Configuration settings for polyfilling NodeJS built-ins. See `node` [webpack option](https://webpack.github.io/docs/configuration.html#node). * `proxy` _[string]_ - Proxy target during project `serve` to be used within the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware). For example: From 309586afc99c7f065740ea875105f70ce4f5e0d3 Mon Sep 17 00:00:00 2001 From: Ryan Duffy Date: Tue, 17 Jan 2017 10:41:39 -0600 Subject: [PATCH 08/13] add prop spread to Panel instance in template Enyo-DCO-1.1-Signed-off-by: Ryan Duffy (ryan.duffy@lge.com) --- template/src/views/MainPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/src/views/MainPanel.js b/template/src/views/MainPanel.js index 73d826d5..1bbae51a 100644 --- a/template/src/views/MainPanel.js +++ b/template/src/views/MainPanel.js @@ -6,8 +6,8 @@ import {Panel, Header} from '@enact/moonstone/Panels'; const MainPanel = kind({ name: 'MainPanel', - render: () => ( - + render: (props) => ( +
From 99168a5e781bc27d9280f0ac65f6d3ba7b658a1d Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 19 Jan 2017 15:47:30 -0800 Subject: [PATCH 09/13] =?UTF-8?q?ENYO-3796:=20ilib=20not=20correctly=20res?= =?UTF-8?q?etting/reloading=20with=20snapshot=20app=20b=E2=80=A6=20(#39)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ENYO-3796: ilib not correctly resetting/reloading with snapshot app builds * Ensure iLib locale updater is exposed correctly when library is symlinked, and that exposing occurs higher in the loader list than babel. * Removed redundant if-statement * ENYO-3803: Add config option for node polyfills * ENYO-3803: Add config option for node polyfills (reverted from commit c57da6d538f2f6e8dfb989189dc353710fca1745) Reviewed-By: Roy Sutton (roy.sutton@lge.com) Integrated-By: Aaron Tam (aaron.tam@lge.com) --- global-cli/modifiers/snapshot.js | 10 ++++++---- global-cli/modifiers/util/html-template-isomorphic.ejs | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/global-cli/modifiers/snapshot.js b/global-cli/modifiers/snapshot.js index 1aaac17c..676213a1 100644 --- a/global-cli/modifiers/snapshot.js +++ b/global-cli/modifiers/snapshot.js @@ -1,5 +1,6 @@ var path = require('path'), + fs = require('fs'), helper = require('./util/config-helper'), SnapshotPlugin = require('./util/SnapshotPlugin'); @@ -11,10 +12,11 @@ module.exports = function(config, opts) { htmlPlugin.options.snapshot = true; } - // Expose iLib so we can update _platform value once page loads, if used - config.module.loaders.push({ - test: path.join(process.cwd(), 'node_modules', '@enact', 'i18n', 'ilib', 'lib', 'ilib.js'), - loader: 'expose?iLib' + // Expose iLib locale utility function module so we can update the locale on page load, if used + var babel = helper.findLoader(config, 'babel'); + config.module.loaders.splice((babel>=0 ? babel : 0), 0, { + test: fs.realpathSync(path.join(process.cwd(), 'node_modules', '@enact', 'i18n', 'src', 'locale.js')), + loader: 'expose?iLibLocale' }); } diff --git a/global-cli/modifiers/util/html-template-isomorphic.ejs b/global-cli/modifiers/util/html-template-isomorphic.ejs index f688be9f..093f5333 100644 --- a/global-cli/modifiers/util/html-template-isomorphic.ejs +++ b/global-cli/modifiers/util/html-template-isomorphic.ejs @@ -57,9 +57,8 @@ }; appendScripts(<%= JSON.stringify(htmlWebpackPlugin.files.js || []) %>); <% } else { %> - if(window.iLib) { - delete iLib._platform; - iLib.setLocale(iLib.getLocale()); + if(typeof iLibLocale === 'object') { + iLibLocale.updateLocale(); } if(typeof App === 'object' && (typeof ReactDOM === 'object')) { ReactDOM.render(App['default'] || App, document.getElementById('root')); From f64d28f7adfd4c54e2759755b67a588ba5ba8ed2 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 26 Jan 2017 13:11:41 -0800 Subject: [PATCH 10/13] PLAT-34949: Fix framework-snapshot and resource bugs (#45) * Fix falsely externalized libraries that started with the same name (eg. react-redux). * Skip injection of the framework js/css when using a snapshot framework. * Dynamic parent package detection to correctly determine if a file is a main entrypoint and it's external ID can be shortened. * Grammar fix * Improved parent directory caching with fixed resolution of modules like react. * Added support for prepend option. Both the prepend and append values get applied to a temporary data file rather than the user's distribution file. * Include resource bundle with external-framework apps. * Ensure ReactDOM is correctly exposed in the isomorphic layout with an external framework * Only noResources ilib-loader flag is needed. * Fixed loader detection by name * Allow Enact framework css file and ensure v8SnapshotFile framework blob gets attached as needed. * Disable enact_framework.load() in framework snapshot until to avoid issues. * Check enact_framework against undefined rather than object Reviewed-By: Derek Tor (derek.tor@lge.com) Integrated-By: Ryan Duffy (ryan.duffy@lge.com) --- config/webpack.config.dev.js | 2 +- global-cli/modifiers/externals.js | 17 +++++- global-cli/modifiers/framework.js | 2 +- global-cli/modifiers/isomorphic.js | 28 +++++----- global-cli/modifiers/snapshot.js | 5 +- .../modifiers/util/EnactFrameworkPlugin.js | 32 +++++++++-- .../modifiers/util/EnactFrameworkRefPlugin.js | 53 +++++++++++++++---- global-cli/modifiers/util/SnapshotPlugin.js | 21 +++++++- global-cli/modifiers/util/config-helper.js | 4 +- .../util/html-template-isomorphic.ejs | 3 ++ 10 files changed, 130 insertions(+), 37 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index ace25fda..a1c34d20 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -110,7 +110,7 @@ module.exports = { extends: path.join(__dirname, '.babelrc'), // @remove-on-eject-end // This is a feature of `babel-loader` for webpack (not Babel itself). - // It enables caching results in ./node_modules/.cache/react-scripts/ + // It enables caching results in ./node_modules/.cache/enact-dev/ // directory for faster rebuilds. So use findCacheDir() because of: // https://github.com/facebookincubator/create-react-app/issues/483 cacheDirectory: findCacheDir({ diff --git a/global-cli/modifiers/externals.js b/global-cli/modifiers/externals.js index e753c3b1..c5d282b3 100644 --- a/global-cli/modifiers/externals.js +++ b/global-cli/modifiers/externals.js @@ -1,13 +1,26 @@ -var EnactFrameworkRefPlugin = require('./util/EnactFrameworkRefPlugin') +var + fs = require('fs'), + exists = require('path-exists').sync, + EnactFrameworkRefPlugin = require('./util/EnactFrameworkRefPlugin'); module.exports = function(config, opts) { + var resBundle = './resources/ilibmanifest.json'; + if(!exists(resBundle)) { + if(!exists('./resources')) { + fs.mkdirSync('./resources'); + } + fs.writeFileSync(resBundle, JSON.stringify({files:[]}, null, '\t'), {encoding:'utf8'}); + } + config.entry.main.splice(config.entry.main.length-1, 0, resBundle); + // Add the reference plugin so the app uses the external framework config.plugins.push(new EnactFrameworkRefPlugin({ name: 'enact_framework', libraries: ['@enact', 'react', 'react-dom'], external: { path: opts.externals, - inject: opts['externals-inject'] || opts.inject + inject: opts['externals-inject'] || opts.inject, + snapshot: opts.snapshot } })); }; diff --git a/global-cli/modifiers/framework.js b/global-cli/modifiers/framework.js index 967c80c8..888a25b0 100644 --- a/global-cli/modifiers/framework.js +++ b/global-cli/modifiers/framework.js @@ -35,7 +35,7 @@ module.exports = function(config, opts) { // Append additional options to the ilib-loader to skip './resources' detection/generation var ilibLoader = helper.getLoaderByName(config, 'ilib'); if(ilibLoader) { - ilibLoader.loader += '?noSave&noResources'; + ilibLoader.loader += '?noResources'; } // Remove the HTML generation plugin and webOS-meta plugin diff --git a/global-cli/modifiers/isomorphic.js b/global-cli/modifiers/isomorphic.js index 6b658d0f..6a4abc64 100644 --- a/global-cli/modifiers/isomorphic.js +++ b/global-cli/modifiers/isomorphic.js @@ -21,13 +21,22 @@ module.exports = function(config, opts) { var iso = enact.isomorphic || enact.prerender; // Only use isomorphic if an isomorphic entrypoint is specified if(iso) { - var reactDOM = path.join(process.cwd(), 'node_modules', 'react-dom', 'index.js'); - if(!exists(reactDOM)) { - reactDOM = require.resolve('react-dom'); + if(!opts.externals) { + var reactDOM = path.join(process.cwd(), 'node_modules', 'react-dom', 'index.js'); + if(!exists(reactDOM)) { + reactDOM = require.resolve('react-dom'); + } + // Prepend react-dom as top level entrypoint so espose-loader will expose + // it to window.ReactDOM to allow runtime rendering of the app. + config.entry.main.unshift(reactDOM); + + // Expose the 'react-dom' on a global context for App's rendering + // Currently maps the toolset to window.ReactDOM. + config.module.loaders.push({ + test: reactDOM, + loader: 'expose?ReactDOM' + }); } - // Prepend react-dom as top level entrypoint so espose-loader will expose - // it to window.ReactDOM to allow runtime rendering of the app. - config.entry.main.unshift(reactDOM); // If 'isomorphic' value is a string, use custom entrypoint. if(typeof iso === 'string') { @@ -40,13 +49,6 @@ module.exports = function(config, opts) { // Use universal module definition to allow usage in Node and browser environments. config.output.libraryTarget = 'umd'; - // Expose the 'react-dom' on a global context for App's rendering - // Currently maps the toolset to window.ReactDOM. - config.module.loaders.push({ - test: reactDOM, - loader: 'expose?ReactDOM' - }); - // Update HTML webpack plugin to use the isomorphic template and include screentypes var htmlPlugin = helper.getPluginByName(config, 'HtmlWebpackPlugin'); if(htmlPlugin) { diff --git a/global-cli/modifiers/snapshot.js b/global-cli/modifiers/snapshot.js index 676213a1..0a048e08 100644 --- a/global-cli/modifiers/snapshot.js +++ b/global-cli/modifiers/snapshot.js @@ -22,7 +22,8 @@ module.exports = function(config, opts) { // Include plugin to attempt generation of v8 snapshot binary if V8_MKSNAPSHOT env var is set config.plugins.push(new SnapshotPlugin({ - target: (opts.framework ? 'enact.js' : 'main.js'), - append: (opts.framework ? '\nenact_framework.load();\n' : undefined) + target: (opts.framework ? 'enact.js' : 'main.js') + // Disabled temporarily until effectiveness is proven + //append: (opts.framework ? '\nenact_framework.load();\n' : undefined) })); }; diff --git a/global-cli/modifiers/util/EnactFrameworkPlugin.js b/global-cli/modifiers/util/EnactFrameworkPlugin.js index 827cb351..3ee5e74c 100644 --- a/global-cli/modifiers/util/EnactFrameworkPlugin.js +++ b/global-cli/modifiers/util/EnactFrameworkPlugin.js @@ -3,7 +3,8 @@ var fs = require('fs'), DllEntryPlugin = require('webpack/lib/DllEntryPlugin'), DllModule = require('webpack/lib/DllModule'), - RawSource = require("webpack/lib/RawSource"); + RawSource = require("webpack/lib/RawSource"), + exists = require('path-exists').sync; var pkgCache = {}; var checkPkgMain = function(dir) { @@ -20,11 +21,32 @@ var checkPkgMain = function(dir) { } }; +var parentCache = {}; +var findParent = function(dir) { + if(parentCache[dir]) { + return parentCache[dir]; + } else { + var currPkg = path.join(dir, 'package.json'); + if(exists(currPkg)) { + return dir; + } else { + if(dir === '/' || dir === '' || dir === '.') { + return null; + } else { + return findParent(path.dirname(dir)); + } + } + } +}; + function normalizeModuleID(id) { - var parent = path.dirname(id); - var main = checkPkgMain(parent); - if(main && path.resolve(id)===path.resolve(path.join(parent, main))) { - id = parent; + var dir = exists(id) && fs.statSync(id).isDirectory() ? id : path.dirname(id); + parentCache[dir] = findParent(dir); + if(parentCache[dir]) { + var main = checkPkgMain(parentCache[dir]); + if(main && path.resolve(id)===path.resolve(path.join(parentCache[dir], main))) { + id = parentCache[dir]; + } } id = id.replace(/\\/g, '/'); diff --git a/global-cli/modifiers/util/EnactFrameworkRefPlugin.js b/global-cli/modifiers/util/EnactFrameworkRefPlugin.js index b3f0e2ef..540fd5f8 100644 --- a/global-cli/modifiers/util/EnactFrameworkRefPlugin.js +++ b/global-cli/modifiers/util/EnactFrameworkRefPlugin.js @@ -1,5 +1,7 @@ var path = require('path'), + fs = require('fs'), + exists = require('path-exists').sync, ExternalsPlugin = require('webpack/lib/ExternalsPlugin'), DelegatedSourceDependency = require('webpack/lib/dependencies/DelegatedSourceDependency'), DelegatedModule = require('webpack/lib/DelegatedModule'); @@ -11,14 +13,12 @@ function DelegatedEnactFactoryPlugin(options) { } DelegatedEnactFactoryPlugin.prototype.apply = function(normalModuleFactory) { var name = this.options.name; - var libs = this.options.libraries; + var libReg = new RegExp('^(' + this.options.libraries.join('|') + ')(?=[\\\\\\/]|$)'); normalModuleFactory.plugin('factory', function(factory) { return function(data, callback) { var request = data.dependency.request; - for(var i=0; i Date: Fri, 27 Jan 2017 13:51:33 -0800 Subject: [PATCH 11/13] Updated for React 15.4.2 and webos-meta-webpack-plugin 0.2.0 --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bd49b8c7..359e1d11 100644 --- a/package.json +++ b/package.json @@ -70,11 +70,11 @@ "postcss-loader": "~1.2.1", "postcss-remove-classes": "~1.0.2", "promise": "~7.1.1", - "react": "~15.4.1", - "react-addons-perf": "~15.4.1", - "react-addons-test-utils": "~15.4.1", + "react": "~15.4.2", + "react-addons-perf": "~15.4.2", + "react-addons-test-utils": "~15.4.2", "react-dev-utils": "~0.4.2", - "react-dom": "~15.4.1", + "react-dom": "~15.4.2", "recursive-readdir": "~2.1.0", "require-from-string": "~1.2.1", "resolution-independence": "~0.0.3", @@ -86,7 +86,7 @@ "string.prototype.repeat": "~0.2.0", "strip-ansi": "~3.0.1", "style-loader": "~0.13.1", - "webos-meta-webpack-plugin": "enyojs/webos-meta-webpack-plugin#0.1.1", + "webos-meta-webpack-plugin": "enyojs/webos-meta-webpack-plugin#0.2.0", "webpack": "~1.14.0", "webpack-bundle-analyzer": "~2.1.1", "webpack-dev-server": "~1.16.2", From f0a04b6cf4b82b9aa9d0c6044ba6b1c239a9c5ed Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Fri, 27 Jan 2017 13:51:59 -0800 Subject: [PATCH 12/13] Updated for Enact 1.0.0-beta.2 and React 15.4.2 --- template/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/template/package.json b/template/package.json index 282f1a07..fbe2bae0 100644 --- a/template/package.json +++ b/template/package.json @@ -28,13 +28,13 @@ "extends": "enact" }, "dependencies": { - "@enact/core": "^1.0.0-beta.1", - "@enact/ui": "^1.0.0-beta.1", - "@enact/moonstone": "^1.0.0-beta.1", - "@enact/spotlight": "^1.0.0-beta.1", - "@enact/i18n": "^1.0.0-beta.1", - "@enact/webos": "^1.0.0-beta.1", - "react": "^15.4.1", - "react-dom": "^15.4.1" + "@enact/core": "^1.0.0-beta.2", + "@enact/ui": "^1.0.0-beta.2", + "@enact/moonstone": "^1.0.0-beta.2", + "@enact/spotlight": "^1.0.0-beta.2", + "@enact/i18n": "^1.0.0-beta.2", + "@enact/webos": "^1.0.0-beta.2", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } From fc0c59e7cc13144ac2556cbbc1b7684bf9d73a40 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Fri, 27 Jan 2017 13:52:22 -0800 Subject: [PATCH 13/13] Added release notes for 0.5.1 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc66ea77..d6a76063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## 0.5.1 (January 27, 2017) + +## create + +* Template updated for Enact 1.0.0-beta.2 and React 15.4.2. +* Template's .gitignore file now correctly includes `dist`. + +## pack + +* Added a `node` Enact build option to support polyfilling NodeJS components. See [here](https://github.com/enyojs/enact-dev/blob/master/README.md#enact-build-options) for more info. +* All localized appinfo.json resources and assets will now be correctly copied to the output directory. + +# test + +* Added a polyfill for String.prototype.repeat, as phantomjs lacks the API. +* Webpack build warnings will no longer spam the console in certain scenarios. +* Test action will now automatically fail when no test suite is found. This was done to allows tests which build incorrect or have missing modules to correctly fail. See [#38](https://github.com/enyojs/enact-dev/pull/38) for more background information. + + ## 0.5.0 (December 20, 2016) Several additional documentation files have been added to the `docs` directory, to cover common topics.