From a50cc26301a2ac52e7a5dba6e056ad1c23124ef9 Mon Sep 17 00:00:00 2001 From: Roy Sutton Date: Fri, 10 Aug 2018 16:59:54 -0400 Subject: [PATCH 1/5] Bump mocha-react-proptype-checker version Enact-DCO-1.0-Signed-off-by: Roy Sutton roy.sutton@lge.com --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be98ca47..9de0e97c 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "license-checker": "16.0.0", "minimist": "1.2.0", "mocha": "5.0.4", - "mocha-react-proptype-checker": "0.1.0", + "mocha-react-proptype-checker": "0.2.0", "phantomjs-prebuilt": "2.1.16", "postcss-flexbugs-fixes": "3.3.0", "postcss-global-import": "1.0.6", From 7492a80c1f472d4b244cd1d5fcca5487f4e0379e Mon Sep 17 00:00:00 2001 From: Roy Sutton Date: Tue, 11 Sep 2018 15:32:28 -0400 Subject: [PATCH 2/5] Update command help and docs (#142) Enact-DCO-1.0-Signed-off-by: Roy Sutton roy.sutton@lge.com --- commands/create.js | 4 ++-- commands/link.js | 2 +- docs/installation.md | 13 +++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/commands/create.js b/commands/create.js index 075c698e..b40109d9 100755 --- a/commands/create.js +++ b/commands/create.js @@ -154,8 +154,8 @@ function displayHelp() { console.log(); console.log(' Options'); console.log(' -t, --template Specific template to use'); - console.log(' -local Include @enact/cli locally'); - console.log(' -verbose Verbose output logging'); + console.log(' --local Include @enact/cli locally'); + console.log(' --verbose Verbose output logging'); console.log(' -v, --version Display version information'); console.log(' -h, --help Display help information'); console.log(); diff --git a/commands/link.js b/commands/link.js index a961f195..d2bbe83b 100755 --- a/commands/link.js +++ b/commands/link.js @@ -12,7 +12,7 @@ function displayHelp() { console.log(' enact link [options]'); console.log(); console.log(' Options'); - console.log(' -verbose Verbose output logging'); + console.log(' --verbose Verbose output logging'); console.log(' -v, --version Display version information'); console.log(' -h, --help Display help information'); console.log(); diff --git a/docs/installation.md b/docs/installation.md index 6f553460..50c2eb88 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -8,10 +8,19 @@ Node 6.4 or later. ## Installation via npm -Standard global installation of `@enact/cli` via npm. For Linux `sudo` may be required. - +Standard global installation of `@enact/cli` via npm. ```sh npm install -g @enact/cli ``` All releases are published, with the default (and `latest` tag) being the current stable release. Unreleased and development builds can be installed by installing from the git repository directly (for example, `enactjs/cli#develop`). + +### Linux Notes + +When installing under Linux, it may be necessary to prefix the install command with `sudo`. +Additionally, if you receive an error when the install process attempts to install PhantomJS, try +the following: + +```sh +sudo npm install -g --unsafe-perm @enact/cli +``` From b7bd87a84b504d52d3651f1c92ad9e6040169bb9 Mon Sep 17 00:00:00 2001 From: Ryan Duffy Date: Fri, 21 Sep 2018 14:08:28 -0700 Subject: [PATCH 3/5] ENYO-5632: Add core-js as a dev dependency for local installs (#143) * add core-js as a dev dependency for local installs Signed-off-by: Ryan Duffy * move npm name to module-scoped variable Signed-off-by: Ryan Duffy * make core-js a regular dependency --- commands/create.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/create.js b/commands/create.js index b40109d9..4e55b4ae 100755 --- a/commands/create.js +++ b/commands/create.js @@ -18,6 +18,7 @@ const minimist = require('minimist'); const validatePackageName = require('validate-npm-package-name'); const ENACT_DEV_NPM = '@enact/cli'; +const CORE_JS_NPM = 'core-js@2'; const INCLUDED = path.dirname(require.resolve('@enact/template-moonstone')); const TEMPLATE_DIR = path.join(process.env.APPDATA || os.homedir(), '.enact'); @@ -258,7 +259,9 @@ function api(opts = {}) { .then(() => { if (opts.local) { console.log('Installing @enact/cli locally. This might take a couple minutes.'); - return npmInstall(opts.directory, opts.verbose, '--save-dev', ENACT_DEV_NPM); + return npmInstall(opts.directory, opts.verbose, '--save', CORE_JS_NPM).then(() => + npmInstall(opts.directory, opts.verbose, '--save-dev', ENACT_DEV_NPM) + ); } }) .then(() => generator.complete && generator.complete(params)); From c68feee43fdbb8ac4e596f3d9f4ef4638a251985 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Tue, 25 Sep 2018 10:43:45 -0700 Subject: [PATCH 4/5] PLAT-65802: Add meta flag support for overriding metadata at buildtime (#145) * PLAT-65802: Add method to override enact package metadata (alternate implementation) * Adjust wording Enact-DCO-1.0-Signed-off-by: Roy Sutton roy.sutton@lge.com * Update to @enact/dev-utils version 1.2.0 --- commands/pack.js | 33 ++++++++++++++++++++++++++++----- commands/serve.js | 20 ++++++++++++++++---- package-lock.json | 19 ++++++------------- package.json | 2 +- 4 files changed, 51 insertions(+), 23 deletions(-) diff --git a/commands/pack.js b/commands/pack.js index 9d00906c..d4dad1c5 100755 --- a/commands/pack.js +++ b/commands/pack.js @@ -19,7 +19,7 @@ const minimist = require('minimist'); const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); const stripAnsi = require('strip-ansi'); const webpack = require('webpack'); -const {mixins, packageRoot} = require('@enact/dev-utils'); +const {optionParser: app, mixins} = require('@enact/dev-utils'); function displayHelp() { let e = 'node ' + path.relative(process.cwd(), __filename); @@ -44,6 +44,7 @@ function displayHelp() { console.log(' "all" - All locales that iLib supports'); console.log(' -s, --snapshot Generate V8 snapshot blob'); console.log(' (requires V8_MKSNAPSHOT set)'); + console.log(' -m, --meta JSON to override package.json enact metadata'); console.log(' --stats Output bundle analysis file'); console.log(' --verbose Verbose log build details'); console.log(' -v, --version Display version information'); @@ -102,7 +103,7 @@ function printFileSizes(stats, output) { const assets = stats.assets.filter(asset => /\.(js|css|bin)$/.test(asset.name)).map(asset => { const size = fs.statSync(path.join(output, asset.name)).size; return { - folder: path.relative(packageRoot().path, path.join(output, path.dirname(asset.name))), + folder: path.relative(app.context, path.join(output, path.dirname(asset.name))), name: path.basename(asset.name), size: size, sizeLabel: filesize(size) @@ -164,6 +165,18 @@ function watch(config) { function api(opts = {}) { let config; + // Apply any package.json enact metadata overrides. + // Until webpak 4 is used, must occur before requiring webpack config. + if (opts.meta) { + let meta; + try { + meta = JSON.parse(opts.meta); + } catch (e) { + throw new Error('Invalid metadata; must be a valid JSON string.\n' + e.message); + } + app.applyEnactMeta(meta); + } + // Do this as the first thing so that any code reading it knows the right env. if (opts.production) { process.env.NODE_ENV = 'production'; @@ -173,6 +186,7 @@ function api(opts = {}) { config = require('../config/webpack.config.dev'); } + // Set any output path override if (opts.output) config.output.path = path.resolve(opts.output); mixins.apply(config, opts); @@ -193,13 +207,22 @@ function api(opts = {}) { function cli(args) { const opts = minimist(args, { boolean: ['minify', 'framework', 'stats', 'production', 'isomorphic', 'snapshot', 'verbose', 'watch', 'help'], - string: ['externals', 'externals-public', 'locales', 'output'], + string: ['externals', 'externals-public', 'locales', 'output', 'meta'], default: {minify: true}, - alias: {o: 'output', p: 'production', i: 'isomorphic', l: 'locales', s: 'snapshot', w: 'watch', h: 'help'} + alias: { + o: 'output', + p: 'production', + i: 'isomorphic', + l: 'locales', + s: 'snapshot', + m: 'meta', + w: 'watch', + h: 'help' + } }); if (opts.help) displayHelp(); - process.chdir(packageRoot().path); + process.chdir(app.context); api(opts).catch(err => { console.log(); console.log(chalk.red('Failed to compile.\n')); diff --git a/commands/serve.js b/commands/serve.js index 2f7c2501..7819be4d 100755 --- a/commands/serve.js +++ b/commands/serve.js @@ -21,7 +21,6 @@ const {choosePort, createCompiler, prepareProxy, prepareUrls} = require('react-d const webpack = require('webpack'); const WebpackDevServer = require('webpack-dev-server'); const app = require('@enact/dev-utils').optionParser; -const devConfig = require('../config/webpack.config.dev'); // Any unhandled promise rejections should be treated like errors. process.on('unhandledRejection', err => { @@ -49,6 +48,7 @@ function displayHelp() { console.log(' -b, --browser Automatically open browser'); console.log(' -i, --host Server host IP address'); console.log(' -p, --port Server port number'); + console.log(' -m, --meta JSON to override package.json enact metadata'); console.log(' -v, --version Display version information'); console.log(' -h, --help Display help information'); console.log(); @@ -193,8 +193,20 @@ function serve(config, host, port, open) { } function api(opts) { + // Apply any package.json enact metadata overrides. + // Until webpak 4 is used, must occur before requiring webpack config. + if (opts.meta) { + let meta; + try { + meta = JSON.parse(opts.meta); + } catch (e) { + throw new Error('Invalid metadata; must be a valid JSON string.\n' + e.message); + } + app.applyEnactMeta(meta); + } + // Setup the development config with additional webpack-dev-erver customizations. - const config = hotDevServer(devConfig); + const config = hotDevServer(require('../config/webpack.config.dev')); // Tools like Cloud9 rely on this. const host = process.env.HOST || opts.host || config.devServer.host || '0.0.0.0'; @@ -210,9 +222,9 @@ function api(opts) { function cli(args) { const opts = minimist(args, { - string: ['host', 'port'], + string: ['host', 'port', 'meta'], boolean: ['browser', 'help'], - alias: {b: 'browser', i: 'host', p: 'port', h: 'help'} + alias: {b: 'browser', i: 'host', p: 'port', m: 'meta', h: 'help'} }); if (opts.help) displayHelp(); diff --git a/package-lock.json b/package-lock.json index 57eb7a91..df2d155b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -998,9 +998,9 @@ } }, "@enact/dev-utils": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@enact/dev-utils/-/dev-utils-1.1.2.tgz", - "integrity": "sha512-6oEjxLLaQVvOib/OLBnOlm3H44cIp5OF7VVoaawFHHlY32udG4E8n5b5vibY59ssHujeL5he17QnGBgfaKDDQQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@enact/dev-utils/-/dev-utils-1.2.0.tgz", + "integrity": "sha512-A5rfsimvaAZMX+ins5pyzlQYzgEYIl2AIXDlMSG5xTaAAtwSkUHrbuzUGR2DrbYdVs73kHpL+f6YqTDE2k8POQ==", "requires": { "chalk": "2.3.2", "console.mute": "0.3.0", @@ -6992,18 +6992,11 @@ } }, "mocha-react-proptype-checker": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/mocha-react-proptype-checker/-/mocha-react-proptype-checker-0.1.0.tgz", - "integrity": "sha512-A04hxgRdRBcwDy8IP4femiZwp5MZVLmhE32Ftd3xlTLx2WBbVBanX3spLbQyWDe6hMkYyPrwOoD/FeCrvwxxVw==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/mocha-react-proptype-checker/-/mocha-react-proptype-checker-0.2.0.tgz", + "integrity": "sha512-qcW0LWoDMQ3NQM7SplTuhwYOWZez0GD7ADnWP7n731jrYRwp14odSpmhQjPTuK+IxKhtMWo+7LrsW5UPGbcI9g==", "requires": { "console-snoop": "0.1.1" - }, - "dependencies": { - "console-snoop": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/console-snoop/-/console-snoop-0.1.1.tgz", - "integrity": "sha512-TJaztvnzM+gYQ/drDivDTnZVrdJvzG50K09q6h5mZIA1IC4tpIrv/EW8LLTrLH/neB4v8w5TNv7a7Q/nMYFzSw==" - } } }, "move-concurrently": { diff --git a/package.json b/package.json index 9de0e97c..c0cdcdb1 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@babel/preset-env": "7.0.0-beta.41", "@babel/preset-react": "7.0.0-beta.41", "@babel/preset-stage-0": "7.0.0-beta.41", - "@enact/dev-utils": "1.1.2", + "@enact/dev-utils": "1.2.0", "@enact/template-moonstone": "2.0.0", "autoprefixer": "8.1.0", "babel-eslint": "8.2.2", From 5081d3ab70c541ff846c89788b915618bac46a57 Mon Sep 17 00:00:00 2001 From: Jason Robitaille Date: Thu, 27 Sep 2018 10:40:50 -0700 Subject: [PATCH 5/5] 1.2.0 release details --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e1897c..f2eae8ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.2.0 (September 27, 2018) + +* Updated to latest `@enact/dev-utils` and `mocha-react-proptype-checker` dependency releases. + +### create + +* Added `core-js` as a direct dependency when creating a new project with `--local` to prevent conflicting polyfill versions. + +### pack + +* Added support for `-m`/`--meta` option to override the `enact` object metadata from the `package.json`. + ## 1.1.1 (August 10, 2018) ### create diff --git a/package-lock.json b/package-lock.json index df2d155b..2504cc9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@enact/cli", - "version": "1.1.1", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c0cdcdb1..7a374a45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@enact/cli", - "version": "1.1.1", + "version": "1.2.0", "description": "Full-featured build environment tool for Enact applications.", "main": "index.js", "author": "Jason Robitaille ",