Skip to content

Commit

Permalink
build(expect-env.js): rename from env-expect.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Feb 21, 2021
1 parent caac204 commit aa14ed9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions env-expect.js → expect-env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */

const debug = require('debug')(`${require('./package.json').name}:env-expect`);
const debug = require('debug')(`${require('./package.json').name}:expect-env`);

const DEFAULT_VALUE_REGEX = [/^.*$/, /.*/];

Expand All @@ -10,7 +10,7 @@ module.exports = {
/**
* This function accepts a single object parameter with a list of `rules` used
* to verify `env`. If `env` is not defined, `process.env` is used instead. If
* `rules` is not defined, the "rules" defined under the "env-expect" key in
* `rules` is not defined, the "rules" defined under the "expect-env" key in
* ./package.json are used instead.
*
* Below, "name" is the name of an environment variable and "value" is its
Expand Down Expand Up @@ -159,7 +159,7 @@ module.exports = {
debug('::normalize BAD RULE ENCOUNTERED: %O', rule);
throw new IllegalEnvironmentError(
`bad rule encountered${
fromPkg ? ' in ./package.json "env-expect"' : ''
fromPkg ? ' in ./package.json "expect-env"' : ''
}: ${JSON.stringify(rule, undefined, 2)}`
);
}
Expand All @@ -171,7 +171,7 @@ module.exports = {
if (!rules) {
try {
({
'env-expect': { rules, errorMessage }
'expect-env': { rules, errorMessage }
} = require('./package.json'));
fromPkg = true;
} catch (ignored) {}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
"/package.json",
"/README.md"
],
"env-expect": {
"errorMessage": "\nCopy the \".env.example\" file to \".env\" or define the appropriate repository secrets",
"rules": []
},
"scripts": {
"build": "npm run build-dist --",
"build-changelog": "conventional-changelog --outfile CHANGELOG.md --preset angular --config .changelogrc.js --release-count 0 --skip-unstable && (if [ \"$CHANGELOG_SKIP_TITLE\" != 'true' ]; then { node -e 'console.log(require(\"./.changelogrc.js\").changelogTitle)'; cat CHANGELOG.md; } > CHANGELOG.md.ignore && mv CHANGELOG.md.ignore CHANGELOG.md; fi) && remark -o --use reference-links --use gfm --use frontmatter CHANGELOG.md && prettier --write CHANGELOG.md",
Expand Down Expand Up @@ -198,5 +194,9 @@
},
"publishConfig": {
"access": "public"
},
"expect-env": {
"errorMessage": "\nCopy the \".env.example\" file to \".env\" or define the appropriate repository secrets",
"rules": []
}
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// compile executables, etc

const { EnvironmentPlugin, DefinePlugin, BannerPlugin } = require('webpack');
const { verifyEnvironment } = require('./env-expect');
const { verifyEnvironment } = require('./expect-env');
const nodeExternals = require('webpack-node-externals');
const debug = require('debug')(`${require('./package.json').name}:webpack-config`);

Expand Down

0 comments on commit aa14ed9

Please sign in to comment.