Skip to content

Commit

Permalink
chore(deps): update (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 15, 2024
1 parent 505ecd0 commit 82c54ca
Show file tree
Hide file tree
Showing 14 changed files with 7,991 additions and 16,632 deletions.
4 changes: 2 additions & 2 deletions bench/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Promise.resolve()
.run({ async: true });

return suite;
})
}),
)
.then(
resolveOnComplete(() => {
Expand All @@ -84,5 +84,5 @@ Promise.resolve()
.run({ async: true });

return suite;
})
}),
);
24,423 changes: 7,890 additions & 16,533 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,31 @@
"@babel/core": "^7.23.7",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.7",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^29.7.0",
"benchmark": "^2.1.4",
"bootstrap-styl": "^5.0.9",
"cross-env": "^7.0.3",
"cspell": "^6.31.2",
"cspell": "^8.3.2",
"css-loader": "^6.8.1",
"del": "^6.1.1",
"del-cli": "^4.0.1",
"del": "^7.1.0",
"del-cli": "^5.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^13.2.3",
"memfs": "^3.5.1",
"lint-staged": "^15.2.0",
"memfs": "^4.6.0",
"nib": "^1.1.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"prettier": "^3.2.2",
"raw-loader": "^4.0.2",
"standard-version": "^9.3.2",
"style-loader": "^3.3.3",
"stylus": "^0.57.0",
"stylus": "^0.62.0",
"webpack": "^5.89.0"
},
"keywords": [
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default async function stylusLoader(source) {
if (!implementation) {
callback(
new Error(
`The Stylus implementation "${options.implementation}" not found`
)
`The Stylus implementation "${options.implementation}" not found`,
),
);

return;
Expand Down Expand Up @@ -75,7 +75,7 @@ export default async function stylusLoader(source) {
sourceRoot: stylusOptions.dest,
basePath: this.rootContext,
}
: stylusOptions.sourcemap
: stylusOptions.sourcemap,
);
}

Expand All @@ -96,7 +96,7 @@ export default async function stylusLoader(source) {
item = require(resolved)(stylusOptions);
} catch (error) {
callback(
`Failed to load "${item}" Stylus plugin. Are you sure it's installed?\n${error}`
`Failed to load "${item}" Stylus plugin. Are you sure it's installed?\n${error}`,
);

return;
Expand Down Expand Up @@ -177,8 +177,8 @@ export default async function stylusLoader(source) {
try {
map.sourcesContent = await Promise.all(
map.sources.map(async (file) =>
(await readFile(this.fs, file)).toString()
)
(await readFile(this.fs, file)).toString(),
),
);
} catch (fsError) {
callback(fsError);
Expand Down
48 changes: 25 additions & 23 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function getStylusOptions(loaderContext, loaderOptions) {
typeof stylusOptions.resolveURL === "boolean" && !stylusOptions.resolveURL
? false
: typeof stylusOptions.resolveURL === "object"
? { ...stylusOptions.resolveURL }
: { nocheck: true };
? { ...stylusOptions.resolveURL }
: { nocheck: true };

if (
typeof stylusOptions.compress === "undefined" &&
Expand Down Expand Up @@ -89,7 +89,7 @@ async function resolveFilename(
globResolver,
isGlob,
context,
filename
filename,
) {
const possibleRequests = getPossibleRequests(loaderContext, filename);

Expand All @@ -103,13 +103,13 @@ async function resolveFilename(

if (globTask.base === ".") {
throw new Error(
'Glob resolving without a glob base ("~**/*") is not supported, please specify a glob base ("~package/**/*")'
'Glob resolving without a glob base ("~**/*") is not supported, please specify a glob base ("~package/**/*")',
);
}

const possibleGlobRequests = getPossibleRequests(
loaderContext,
globTask.base
globTask.base,
);

let globResult;
Expand All @@ -118,7 +118,7 @@ async function resolveFilename(
globResult = await resolveRequests(
context,
possibleGlobRequests,
globResolver
globResolver,
);
} catch (globError) {
throw globError;
Expand All @@ -128,7 +128,7 @@ async function resolveFilename(

const patterns = filename.replace(
new RegExp(`^${globTask.base}`),
normalizePath(globResult)
normalizePath(globResult),
);

const paths = await fastGlob(patterns, {
Expand Down Expand Up @@ -177,7 +177,7 @@ async function getDependencies(
seen,
code,
filename,
options
options,
) {
seen.add(filename);

Expand Down Expand Up @@ -254,7 +254,7 @@ async function getDependencies(
originalColumn: firstNode.column,
originalNodePath,
resolved: found.map((item) =>
path.isAbsolute(item) ? item : path.join(process.cwd(), item)
path.isAbsolute(item) ? item : path.join(process.cwd(), item),
),
});

Expand All @@ -271,7 +271,7 @@ async function getDependencies(
globResolver,
isGlob,
path.dirname(this.filename),
originalNodePath
originalNodePath,
),
});
}
Expand Down Expand Up @@ -338,14 +338,14 @@ async function getDependencies(
seen,
dependencyCode,
dependency,
options
options,
);
})()
})(),
);
}

await Promise.all(dependenciesOfDependencies);
})
}),
);

if (dependencies.length > 0) {
Expand Down Expand Up @@ -401,7 +401,7 @@ async function createEvaluator(loaderContext, code, options) {
seen,
code,
loaderContext.resourcePath,
options
options,
);

const optionsImports = [];
Expand All @@ -417,7 +417,7 @@ async function createEvaluator(loaderContext, code, options) {
globResolve,
isGlob,
path.dirname(loaderContext.resourcePath),
importPath
importPath,
),
});
}
Expand Down Expand Up @@ -466,14 +466,14 @@ async function createEvaluator(loaderContext, code, options) {
seen,
dependencyCode,
dependency,
options
options,
);
})()
})(),
);
}

await Promise.all(dependenciesOfImportDependencies);
})
}),
);

return class CustomEvaluator extends Evaluator {
Expand All @@ -498,7 +498,7 @@ async function createEvaluator(loaderContext, code, options) {

if (!dependency) {
const dependencies = resolvedDependencies.get(
path.normalize(node.filename)
path.normalize(node.filename),
);

if (dependencies) {
Expand Down Expand Up @@ -570,13 +570,13 @@ async function createEvaluator(loaderContext, code, options) {
}${
webpackResolveError.missing
? `\n\nWebpack resolver error missing:\n${webpackResolveError.missing.join(
"\n"
"\n",
)}`
: ""
}`
: ""
}`
)
}`,
),
);

return imported;
Expand Down Expand Up @@ -642,7 +642,9 @@ function urlResolver(options = {}) {
res =
path.relative(
dest || path.dirname(this.filename),
options.nocheck ? path.join(path.dirname(filename), pathname) : pathname
options.nocheck
? path.join(path.dirname(filename), pathname)
: pathname,
) + tail;

if (path.sep === "\\") {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default (compiler) =>
}

return resolve(stats);
})
}),
);
2 changes: 1 addition & 1 deletion test/helpers/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default (code) => {
const module = new Module(resource, parentModule);
// eslint-disable-next-line no-underscore-dangle
module.paths = Module._nodeModulePaths(
path.resolve(__dirname, "../fixtures")
path.resolve(__dirname, "../fixtures"),
);
module.filename = resource;

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/getCodeFromBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getCodeFromBundle(stats, compiler, asset) {
`${code};\nmodule.exports = stylusLoaderExport;`,
{
module: {},
}
},
);

// eslint-disable-next-line no-underscore-dangle
Expand Down
26 changes: 13 additions & 13 deletions test/helpers/getCodeFromStylus.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,64 +21,64 @@ const pathMap = {
fixturesDir,
"node_modules",
"fakenib",
"index.styl"
"index.styl",
),
fakestylus: path.resolve(
fixturesDir,
"node_modules",
"fakestylus",
"main.styl"
"main.styl",
),
"~fakestylus": path.resolve(
fixturesDir,
"node_modules",
"fakestylus",
"main.styl"
"main.styl",
),
"~glob_package/*": path.resolve(
fixturesDir,
"node_modules",
"glob_package/*"
"glob_package/*",
),
"in-web-modules": path.resolve(
fixturesDir,
"web_modules",
"in-web-modules",
"index.styl"
"index.styl",
),
"~in-web-modules": path.resolve(
fixturesDir,
"web_modules",
"in-web-modules",
"index.styl"
"index.styl",
),
"~in-web-modules/index": path.resolve(
fixturesDir,
"web_modules",
"in-web-modules",
"index.styl"
"index.styl",
),
"~webpack-like-a-glob-package-name*": path.resolve(
fixturesDir,
"node_modules",
"webpack-like-a-glob-package-name*",
"index.styl"
"index.styl",
),
"~webpack-like-a-glob-package-name": path.resolve(
fixturesDir,
"node_modules",
"webpack-like-a-glob-package-name",
"index.styl"
"index.styl",
),
preferRelativeAlias: path.resolve(
fixturesDir,
"prefer-relative",
"style.styl"
"style.styl",
),
"custom-main-files": path.resolve(
fixturesDir,
"custom-main-files",
"custom.styl"
"custom.styl",
),
};

Expand Down Expand Up @@ -122,14 +122,14 @@ async function getCodeFromStylus(testId, options = {}, context = {}) {
__dirname,
"..",
"fixtures",
"node_modules/package-with-exports-and-custom-condition/style-1.styl"
"node_modules/package-with-exports-and-custom-condition/style-1.styl",
);
} else if (context.packageExportsCustomConditionTestVariant === 2) {
pathToFile = path.resolve(
__dirname,
"..",
"fixtures",
"node_modules/package-with-exports-and-custom-condition/style-2.styl"
"node_modules/package-with-exports-and-custom-condition/style-2.styl",
);
} else {
pathToFile = path.resolve(__dirname, "..", "fixtures", testId);
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/normalizeErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function removeCWD(str) {

export default (errors) =>
errors.map((error) =>
removeCWD(error.toString().split("\n").slice(0, 2).join("\n"))
removeCWD(error.toString().split("\n").slice(0, 2).join("\n")),
);

0 comments on commit 82c54ca

Please sign in to comment.