Skip to content

Commit

Permalink
update deps checking configs
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Oct 11, 2023
1 parent 25a8d3a commit 2e44d97
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
6 changes: 5 additions & 1 deletion configs/configs/dep-cruiser.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {IConfiguration} from 'dependency-cruiser';
import {generateDepCruiserConfig} from 'virmator/dist/compiled-base-configs/base-dep-cruiser.config';

const depCruiserConfig: IConfiguration = generateDepCruiserConfig({
const baseConfig = generateDepCruiserConfig({
fileExceptions: {
// enter file exceptions by rule name here
'no-orphans': {
Expand All @@ -15,4 +15,8 @@ const depCruiserConfig: IConfiguration = generateDepCruiserConfig({
],
});

const depCruiserConfig: IConfiguration = {
...baseConfig,
};

module.exports = depCruiserConfig;
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "virmator",
"version": "9.1.0",
"version": "9.1.1",
"description": "Handle common package configs, commands, and dependencies.",
"keywords": [
"automation",
Expand Down
5 changes: 5 additions & 0 deletions src/commands/deps.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export const depsCommandDefinition = defineCommand(

const npmWorkspaces = await getNpmPackages(repoDir);

const otherFlags = filteredInputArgs.filter(
(arg) => arg.startsWith('-') && arg !== '--serial',
);

const nonFlagInputs = filteredInputArgs.filter((arg) => !arg.startsWith('-'));

const serial = filteredInputArgs.some((arg) => arg === '--serial');
Expand All @@ -132,6 +136,7 @@ export const depsCommandDefinition = defineCommand(
'--config',
compiledConfigPath,
...pathsToCheck,
...otherFlags,
].filter(isTruthy),
async postExecute() {
await unlink(compiledConfigPath);
Expand Down
11 changes: 9 additions & 2 deletions src/compiled-base-configs/base-dep-cruiser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export function generateDepCruiserConfig({
'npm-no-pkg',
'npm-unknown',
],
pathNot: [
'^src/',
],
},
},
{
Expand All @@ -127,10 +130,14 @@ export function generateDepCruiserConfig({
// as it's pretty common to have a type import be a type only import
// _and_ (e.g.) a devDependency - don't consider type-only dependency
// types for this rule
// dependencyTypesNot: ['type-only'],
dependencyTypesNot: [
'type-only',
],
pathNot: [
'^src/',
],
},
},

/* rules you might want to tweak for your specific situation: */
{
name: 'not-to-spec',
Expand Down

0 comments on commit 2e44d97

Please sign in to comment.