Skip to content

Commit

Permalink
Bump os-locale
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Aug 23, 2024
1 parent 2a04e0c commit 19ecc75
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 127 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

10 changes: 10 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": "commonjs"
}
]
]
}
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('jest').Config} */
module.exports = {
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
Expand Down Expand Up @@ -27,7 +28,7 @@ module.exports = {
'^.+\\.js$': 'babel-jest',
'^.+\\.txt$': '<rootDir>/tests/jest-raw-loader.js',
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!os-locale)'],
testEnvironment: 'node',
verbose: false,
};
120 changes: 17 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"is-mergeable-object": "1.1.1",
"jed": "1.1.1",
"json-merge-patch": "1.0.2",
"os-locale": "5.0.0",
"os-locale": "6.0.2",
"pino": "8.20.0",
"relaxed-json": "1.0.3",
"semver": "7.6.3",
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import upath from 'upath';
import Jed from 'jed';
import semver from 'semver';
import { oneLine } from 'common-tags';
import osLocale from 'os-locale';
import { osLocaleSync } from 'os-locale';

import log from 'logger';
import { PACKAGE_TYPES, LOCAL_PROTOCOLS } from 'const';
Expand Down Expand Up @@ -136,7 +136,7 @@ export function getVariable(context, name) {
}

export function getLocale() {
return osLocale.sync();
return osLocaleSync();
}

export function getI18Data(locale) {
Expand Down
8 changes: 7 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ const webpack = require('webpack');
// eslint-disable-next-line import/no-extraneous-dependencies
const nodeExternals = require('webpack-node-externals');

// ESM packages must be bundled because webpack will otherwise turn `require()` into `import()`
// and make the import silently asynchronous. In most cases this breaks the import.
const dependenciesToBundle = [
'os-locale', // Used exclusively in sync functions
];

module.exports = {
// Set the webpack4 mode 'none' for compatibility with the behavior of the
// webpack3 bundling step.
mode: 'none',
entry: {
'addons-linter': './src/main.js',
},
target: 'node',
output: {
filename: '[name].js',
libraryTarget: 'commonjs2',
Expand All @@ -38,6 +43,7 @@ module.exports = {
externals: [
nodeExternals({
modulesFromFile: true,
allowlist: dependenciesToBundle,
}),
],
plugins: [
Expand Down

0 comments on commit 19ecc75

Please sign in to comment.