Skip to content

Commit f9c3fc6

Browse files
committed
feature #550 Clean up the public API file and improve a few other things (Lyrkan)
This PR was squashed before being merged into the master branch (closes #550). Discussion ---------- Clean up the public API file and improve a few other things Now that we don't have many active PRs anymore I figured it was a good time to do some spring cleaning, especially in the `index.js` file (since we often recommend users to look at its content). This PR: * Moves the proxy creation into its own file (`lib/EncoreProxy.js`) * Moves the content of `initializeWebpackConfig(...)` inside of the `WebpackConfig`'s constructor (we already had some checks related to the `RuntimeConfig` there anyway) * Fixes a few JSDoc issues (missing or misplaced comments, types not resolving correctly, etc.) * Puts examples from the `index.js` file's comments inside of Markdown code-blocks, which are supported by at least PHPStorm and VSCode: * In PHPStorm | Before | After | |--------|-------| | ![image](https://user-images.githubusercontent.com/850046/55289907-ac42bf00-53cc-11e9-9aeb-33cde4bec1f9.png) | ![image](https://user-images.githubusercontent.com/850046/55289910-b2d13680-53cc-11e9-8275-605017b2018d.png) | * In VSCode (note that the leading whitespaces and asterisk are caused by this bug: microsoft/TypeScript#23517) | Before | After | |--------|-------| | ![image](https://user-images.githubusercontent.com/850046/55289926-e4e29880-53cc-11e9-84d3-9b8a27cc33cc.png) | ![image](https://user-images.githubusercontent.com/850046/55289929-eca23d00-53cc-11e9-84cd-d8cf5082a2e9.png) | * Indicates that `Encore.getWebpackConfig()` returns a Webpack configuration, which allows IDEs' autocompletion to work on it: ![image](https://user-images.githubusercontent.com/850046/55289982-aa2d3000-53cd-11e9-8abd-2c5179ec289c.png) Commits ------- 8531000 Clean up the public API file and improve a few other things
2 parents 6bdfa12 + 8531000 commit f9c3fc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+600
-402
lines changed

bin/encore.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
const parseRuntime = require('../lib/config/parse-runtime');
1414
const context = require('../lib/context');
15-
const chalk = require('chalk');
15+
const chalk = require('chalk').default;
1616
const logger = require('../lib/logger');
1717

1818
const runtimeConfig = parseRuntime(
@@ -40,7 +40,7 @@ if (!runtimeConfig.isValidCommand) {
4040
}
4141
showUsageInstructions();
4242

43-
process.exit(1);
43+
process.exit(1); // eslint-disable-line no-process-exit
4444
}
4545

4646
if (runtimeConfig.helpRequested) {

0 commit comments

Comments
 (0)