Skip to content

Commit

Permalink
Merge pull request #135 from merkle-open/fix/maintenance
Browse files Browse the repository at this point in the history
maintenance: node update and move to npm workspaces
  • Loading branch information
ernscht authored Oct 31, 2024
2 parents 2504140 + a994e95 commit a37a4da
Show file tree
Hide file tree
Showing 56 changed files with 33,347 additions and 19,367 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EditorConfig. Frontend. Default. Namics.
# EditorConfig. Frontend. Default.
# @see: http://EditorConfig.org
# install a plugin to your editor: http://editorconfig.org/#download
# mark: not all plugins supports the same EditorConfig properties
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ name: ci
on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- master
- develop
jobs:
test:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
platform: [ubuntu-latest, windows-latest]
node-version: [16.x, 18.x, 20.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm i
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ tmp

# debugging
*.log

# build
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.1
20.18.0
4 changes: 3 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = require('@namics/prettier-config');
const config = require('@merkle-open/prettier-config');

module.exports = config;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ The `common-config-webpack-plugin` suite provides typechecks and integration tes

## Peer dependencies

The `common-config-webpack-plugin` has a direct dependencies to babel and ts.
The `common-config-webpack-plugin` has direct dependencies to babel and ts.
However if you need to pick a specific version you can use the `js-config-webpack-plugin` or `ts-config-webpack-plugin` which use peer-dependencies instead.

## License
Expand Down
12 changes: 6 additions & 6 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
"homepage": "https://github.com/merkle-open/webpack-config-plugins/",
"repository": "https://github.com/merkle-open/webpack-config-plugins.git",
"version": "2.0.3",
"author": "Merkle Inc",
"main": "dist/config-generator.js",
"license": "MIT",
"author": "Merkle Inc",
"engines": {
"node": ">=16.13.0",
"npm": ">=8.1.0"
},
"bin": {
"generate-webpack-config": "dist/generate-webpack-config.js"
},
"files": [
"dist"
],
"main": "dist/config-generator.js",
"keywords": [
"webpack",
"cli"
Expand All @@ -37,9 +41,5 @@
"webpack": "4.46.0",
"webpack-cli": "4.6.0",
"webpack-dev-server": "3.11.2"
},
"engines": {
"npm": ">=6",
"node": ">=10"
}
}
8 changes: 4 additions & 4 deletions cli/src/config-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,21 @@ function getModuleNamesForConfiguration(configOptions: ConfigLoaderTypeOptions):
function combinePluginsToWrappers(moduleNamesForConfiguration: Array<PluginName>): Array<PluginName> {
// Use Asset Plugin
const useAssetConfigWebpackPlugin = !assetConfigWebpackPluginChildren.some(
(moduleName) => moduleNamesForConfiguration.indexOf(moduleName) === -1
(moduleName) => moduleNamesForConfiguration.indexOf(moduleName) === -1,
);
if (useAssetConfigWebpackPlugin) {
moduleNamesForConfiguration = moduleNamesForConfiguration.filter(
(moduleName) => assetConfigWebpackPluginChildren.indexOf(moduleName) === -1
(moduleName) => assetConfigWebpackPluginChildren.indexOf(moduleName) === -1,
);
moduleNamesForConfiguration.push('asset-config-webpack-plugin');
}
// Use common config plugin
const useCommonConfigWebpackPlugin = !commonConfigWebpackPluginChildren.some(
(moduleName) => moduleNamesForConfiguration.indexOf(moduleName) === -1
(moduleName) => moduleNamesForConfiguration.indexOf(moduleName) === -1,
);
if (useCommonConfigWebpackPlugin) {
moduleNamesForConfiguration = moduleNamesForConfiguration.filter(
(moduleName) => commonConfigWebpackPluginChildren.indexOf(moduleName) === -1
(moduleName) => commonConfigWebpackPluginChildren.indexOf(moduleName) === -1,
);
moduleNamesForConfiguration.push('common-config-webpack-plugin');
}
Expand Down
6 changes: 3 additions & 3 deletions cli/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('cli', () => {
mockInquirer({ options, overwrite: 'no', install: 'no' });
await generateConfigCli(process.cwd());
expect(logger.mock.calls.length).not.toBe(0);
}
},
);

test.each(combinations as any)(
Expand All @@ -76,7 +76,7 @@ describe('cli', () => {
mockInquirer({ options, overwrite: 'no', install: 'no' });
await generateConfigCli(process.cwd());
expect(mergeLoggerMockCalls(logger)).toMatchSnapshot();
}
},
);

test.each(combinations as any)(
Expand All @@ -88,6 +88,6 @@ describe('cli', () => {
mockInquirer({ options, overwrite: 'yes', install: 'no' });
await generateConfigCli(tmpSubFolder);
expect(mergeLoggerMockCalls(logger)).toMatchSnapshot();
}
},
);
});
10 changes: 5 additions & 5 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const generateConfigCli = async (cwd = process.cwd()) => {
{},
...configOptionKeys.map((configOption) => ({
[configOption]: options.indexOf(configOption) !== -1,
}))
})),
) as { [key in ConfigOptionKeys]: boolean };

const result = generateConfigurations(configOptions);
Expand Down Expand Up @@ -57,14 +57,14 @@ export const generateConfigCli = async (cwd = process.cwd()) => {
if (webpackConfigNeedsUpdateFs) {
if (userAllowsWebackOverwrite) {
console.log(
`✍️ ${webpackConfigExist ? 'Overwriting' : 'Creating'} "${path.relative(cwd, webpackConfigPath)}"\n`
`✍️ ${webpackConfigExist ? 'Overwriting' : 'Creating'} "${path.relative(cwd, webpackConfigPath)}"\n`,
);
writeFileSync(webpackConfigPath, result.webpackConfig);
} else {
console.log(
'⚠️ Skipping writing webpack.config.js\n💡 Add the following code to your webpack.config.js:\n\n' +
result.webpackConfig +
'\n'
'\n',
);
}
} else {
Expand Down Expand Up @@ -122,7 +122,7 @@ export const generateConfigCli = async (cwd = process.cwd()) => {
}
if (configOptions.useCli || configOptions.useDevServer) {
console.log(
'💡 For more information on available modes please go to https://webpack.js.org/concepts/mode/'
'💡 For more information on available modes please go to https://webpack.js.org/concepts/mode/',
);
}
}
Expand All @@ -140,7 +140,7 @@ async function spawnInheritAsync(cmd: string, args: Array<string>): Promise<bool
// Any exit code other than 0 is considered to be an error.
code ? resolve(false) : resolve(true);
})
.on('error', () => resolve(false))
.on('error', () => resolve(false)),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "2.11.0",
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": [
"cli",
"packages/*"
Expand Down
Loading

0 comments on commit a37a4da

Please sign in to comment.