Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Oct 27, 2024
1 parent d8707f4 commit 1cb60d4
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 77 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import globals from "globals";
import eslint from "@eslint/js";

export default [
{
ignores: ["lib/build/amodro-trace", "**/dist"],
},
eslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jasmine,
},

ecmaVersion: 2019,
sourceType: "commonjs",
},

rules: {
"no-prototype-builtins": 0,
"no-console": 0,
"getter-return": 0,
"no-inner-declarations": 0,

"comma-dangle": ["error", {
arrays: "never",
objects: "never",
imports: "never",
exports: "never",
functions: "never",
}],
},
}
];
8 changes: 5 additions & 3 deletions lib/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ exports.Bundle = class {
// in AMD module environment. There is special code in lib/build/amodro-trace/write/defines.js
// to bring up global var "moment".
const special = [];
while (true) { // eslint-disable-line no-constant-condition
while (true) {
const idx = sorted.findIndex(f => f.dependencyInclusion && (
f.dependencyInclusion.description.name === 'jquery' ||
f.dependencyInclusion.description.name === 'moment'));
Expand Down Expand Up @@ -284,15 +284,17 @@ exports.Bundle = class {
if (base64SourceMap) {
return null;
}
} catch (error) {
} catch {
// we don't want the build to fail when a sourcemap file can't be parsed
return null;
}

let converter;

try {
converter = Convert.fromMapFileSource(file.contents.toString(), parsedPath.dir);
converter = Convert.fromMapFileSource(file.contents.toString(), (filename) =>
fs.readFileSync(path.resolve(parsedPath.dir, filename), 'utf-8')
);
} catch (e) {
logger.error(e);
return null;
Expand Down
2 changes: 1 addition & 1 deletion lib/build/bundled-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ exports.BundledSource = class {

try {
contents = cjsTransform(modulePath, this.contents, forceCjsWrap);
} catch (ignore) {
} catch {
// file is not in amd/cjs format, try native es module
try {
contents = esTransform(modulePath, this.contents);
Expand Down
2 changes: 1 addition & 1 deletion lib/build/dependency-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports.DependencyDescription = class {

try {
return fs.readFileSync(p).toString();
} catch (e) {
} catch {
console.log('error', p);
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/build/dependency-inclusion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const SourceInclusion = require('./source-inclusion').SourceInclusion;
const minimatch = require('minimatch');
const { minimatch } = require('minimatch');
const Utils = require('./utils');
const logger = require('aurelia-logging').getLogger('DependencyInclusion');

Expand Down
4 changes: 2 additions & 2 deletions lib/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Bundler = require('./bundler').Bundler;
const PackageAnalyzer = require('./package-analyzer').PackageAnalyzer;
const PackageInstaller = require('./package-installer').PackageInstaller;
const cacheDir = require('./utils').cacheDir;
const del = require('del');
const fs = require('fs');

let bundler;
let project;
Expand Down Expand Up @@ -60,7 +60,7 @@ exports.dest = function(opts) {

exports.clearCache = function() {
// delete cache folder outside of cwd
return del(cacheDir, {force: true});
return fs.promises.rm(cacheDir, { recursive: true, force: true });
};

function buildLoaderConfig(p) {
Expand Down
2 changes: 1 addition & 1 deletion lib/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports.getCache = function(hash) {
const filePath = cachedFilePath(hash);
try {
return JSON.parse(fs.readFileSync(filePath));
} catch (e) {
} catch {
// ignore
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/cli-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function definedEnvironments() {
let files;
try {
files = fs.readdirSync('aurelia_project/environments');
} catch (e) {
} catch {
// ignore
}
files && files.forEach(file => {
Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ exports.CLI = class {
// need to configure logger after getting args
this.configureLogger();
resolve(found);
} catch (e) {
} catch {
if (this.project) {
this.project.resolveTask(commandModule).then(taskPath => {
if (taskPath) {
Expand Down
4 changes: 2 additions & 2 deletions lib/file-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ exports.statSync = function(path) {
exports.isFile = function(path) {
try {
return fs.statSync(path).isFile();
} catch (err) {
} catch {
// ignore
return false;
}
Expand All @@ -112,7 +112,7 @@ exports.isFile = function(path) {
exports.isDirectory = function(path) {
try {
return fs.statSync(path).isDirectory();
} catch (err) {
} catch {
// ignore
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/package-managers/base-package-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports.BasePackageManager = class {
getExecutablePath(directory) {
try {
return npmWhich(directory).sync(this.executableName);
} catch (e) {
} catch {
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function installBabel() {
configFile: false,
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-modules-commonjs', {loose: true}]
],
only: [/aurelia_project/]
Expand Down
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lint": "eslint lib spec",
"pretest": "npm run lint",
"test": "jasmine",
"coverage": "nyc jasmine",
"coverage": "c8 jasmine",
"test:watch": "nodemon -x 'npm test'",
"preversion": "npm test",
"version": "standard-changelog && git add CHANGELOG.md",
Expand All @@ -38,64 +38,64 @@
"url": "https://github.com/aurelia/cli"
},
"dependencies": {
"@babel/core": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-decorators": "^7.18.2",
"@babel/plugin-transform-modules-amd": "^7.18.0",
"@babel/plugin-transform-modules-commonjs": "^7.18.2",
"@babel/register": "^7.17.7",
"@babel/core": "^7.26.0",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/plugin-transform-class-properties": "^7.25.9",
"@babel/plugin-transform-modules-amd": "^7.25.9",
"@babel/plugin-transform-modules-commonjs": "^7.25.9",
"@babel/register": "^7.25.9",
"ansi-colors": "^4.1.3",
"assert": "^2.0.0",
"aurelia-dependency-injection": "^1.5.2",
"assert": "^2.1.0",
"aurelia-dependency-injection": "^1.6.1",
"aurelia-logging": "^1.5.2",
"aurelia-polyfills": "^1.3.4",
"browserify-zlib": "^0.2.0",
"buffer": "^5.7.0",
"buffer": "^6.0.3",
"concat-with-sourcemaps": "^1.1.0",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"convert-source-map": "^1.8.0",
"crypto-browserify": "^3.12.0",
"del": "^6.1.1",
"domain-browser": "^4.22.0",
"enquirer": "^2.3.6",
"convert-source-map": "^2.0.0",
"crypto-browserify": "^3.12.1",
"domain-browser": "^5.7.0",
"enquirer": "^2.4.1",
"events": "^3.3.0",
"fs-browser-stub": "^1.0.1",
"gulp": "^4.0.2",
"htmlparser2": "^8.0.1",
"gulp": ">=4.0.2",
"htmlparser2": "^9.1.0",
"https-browserify": "^1.0.0",
"lodash": "^4.17.21",
"map-stream": "0.0.7",
"meriyah": "^4.2.1",
"minimatch": "^5.1.0",
"meriyah": "^6.0.2",
"minimatch": "^10.0.1",
"npm-which": "^3.0.1",
"os-browserify": "^0.3.0",
"path-browserify": "1.0.1",
"process": "^0.11.10",
"punycode": "^2.1.1",
"punycode": "^2.3.1",
"querystring-browser-stub": "^1.0.0",
"readable-stream": "^3.6.0",
"resolve": "^1.22.0",
"semver": "^7.3.7",
"readable-stream": "^4.5.2",
"resolve": "^1.22.8",
"semver": "^7.6.3",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"terser": "^5.14.0",
"terser": "^5.36.0",
"timers-browserify": "^2.0.12",
"tty-browserify": "0.0.1",
"typescript": "^4.7.3",
"url": "^0.11.0",
"util": "^0.12.4",
"typescript": "^5.6.3",
"url": "^0.11.4",
"util": "^0.12.5",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^17.0.39",
"eslint": "^8.17.0",
"jasmine": "^4.1.0",
"@types/node": "^22.8.1",
"c8": "^10.1.2",
"eslint": "^9.13.0",
"globals": "^15.11.0",
"jasmine": "^5.4.0",
"jasmine-spec-reporter": "^7.0.0",
"nodemon": "^2.0.16",
"nyc": "^15.1.0",
"standard-changelog": "^2.0.27",
"yargs": "^17.5.1"
"nodemon": "^3.1.7",
"standard-changelog": "^6.0.0",
"yargs": "^17.7.2"
}
}
1 change: 0 additions & 1 deletion spec/lib/build/dependency-inclusion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ describe('the DependencyInclusion module', () => {
lazyMain: true
};

// eslint-disable-next-line no-unused-vars
let sut = new DependencyInclusion(bundle, description);

sut.traceResources()
Expand Down

0 comments on commit 1cb60d4

Please sign in to comment.