Skip to content

Commit

Permalink
ignore generated-config files
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Oct 11, 2023
1 parent c347e6d commit d4f7f3f
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions base-configs/base-cspell.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const baseConfig = {
'**/build/',
'**/coverage/',
'**/dist/',
'generated-config-*',
'**/docs-dist/',
'**/graphics/',
'**/node_modules/',
Expand Down
1 change: 1 addition & 0 deletions configs/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
coverage/
dist/
docs-dist/
generated-config-*
graphics/
node_modules/
package-lock.json
Expand Down
1 change: 1 addition & 0 deletions configs/gitignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
coverage/
dist/
docs-dist/
generated-config-*
graphics/
node_modules/
src/all-files-for-code-coverage.test.ts
1 change: 1 addition & 0 deletions configs/npmignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/www-static/
bash-scripts/
docs-dist/
generated-config-*
index.html
test-files/
tsconfig*.json
3 changes: 2 additions & 1 deletion configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"publish": "virmator publish \"npm run compile && npm run test:all\"",
"start": "npm install && virmator frontend",
"test": "virmator test",
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs \"npm run test:types\" \"npm run test:coverage\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\"",
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs,deps \"npm run test:types\" \"npm run test:coverage\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\" \"npm run test:deps\"",
"test:coverage": "npm run test coverage",
"test:deps": "virmator deps check",
"test:docs": "virmator docs check",
"test:format": "virmator format check",
"test:spelling": "virmator spellcheck",
Expand Down
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.0.0",
"version": "9.0.1",
"description": "Handle common package configs, commands, and dependencies.",
"keywords": [
"automation",
Expand Down
10 changes: 8 additions & 2 deletions src/augments/typescript-config-file.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {addSuffix, removeSuffix} from '@augment-vir/common';
import {unlink} from 'fs/promises';
import {basename, dirname, join} from 'path';

export async function withTypescriptConfigFile<T>(
configPath: string,
Expand All @@ -20,7 +20,13 @@ export async function withTypescriptConfigFile<T>(
}

function createOutfilePath(inputFilePath: string): string {
return addSuffix({value: removeSuffix({value: inputFilePath, suffix: '.ts'}), suffix: '.cjs'});
return join(
dirname(inputFilePath),
[
'generated-config',
basename(inputFilePath).replace(/\.ts$/, '.cjs'),
].join('-'),
);
}

export async function compileTs({
Expand Down
8 changes: 4 additions & 4 deletions test-files/test-expectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"exitCode": 1,
"key": "circular-deps-fail",
"stderr": "deps failed.",
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/circular/configs/dep-cruiser.config.cjs ./test-files/deps/circular/src error no-circular: src/one.ts → src/two.ts → src/one.ts ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 2 dependencies cruised."
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/circular/configs/generated-config-dep-cruiser.config.cjs ./test-files/deps/circular/src error no-circular: src/one.ts → src/two.ts → src/one.ts ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 2 dependencies cruised."
},
"multi-sub-command-fail": {
"dir": "deps/valid",
Expand All @@ -49,14 +49,14 @@
"exitCode": 1,
"key": "npn-npm-dep-fail",
"stderr": "deps failed.",
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/non-npm-dep/configs/dep-cruiser.config.cjs ./test-files/deps/non-npm-dep/src error no-non-package-json: src/index.ts → ../../../node_modules/@augment-vir/common/dist/cjs/index.js ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 1 dependencies cruised."
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/non-npm-dep/configs/generated-config-dep-cruiser.config.cjs ./test-files/deps/non-npm-dep/src error no-non-package-json: src/index.ts → ../../../node_modules/@augment-vir/common/dist/cjs/index.js ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 1 dependencies cruised."
},
"orphan-fail": {
"dir": "deps/orphan",
"exitCode": 1,
"key": "orphan-fail",
"stderr": "deps failed.",
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/orphan/configs/dep-cruiser.config.cjs ./test-files/deps/orphan/src error no-orphans: src/one.ts ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 0 dependencies cruised."
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/orphan/configs/generated-config-dep-cruiser.config.cjs ./test-files/deps/orphan/src error no-orphans: src/one.ts ✘ 1 dependency violations (1 errors, 0 warnings). 2 modules, 0 dependencies cruised."
},
"upgrades-deps": {
"dir": "deps/not-up-to-date",
Expand All @@ -70,7 +70,7 @@
"exitCode": 0,
"key": "valid",
"stderr": "",
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/valid/configs/dep-cruiser.config.cjs ./test-files/deps/valid/src ✔ no dependency violations found (1 modules, 0 dependencies cruised) deps succeeded."
"stdout": "Installing esbuild... Installing npm-check-updates... Installing dependency-cruiser... running deps... Successfully copied dep-cruiser.config.ts Successfully copied ncu.config.ts node_modules/.bin/depcruise --config ./test-files/deps/valid/configs/generated-config-dep-cruiser.config.cjs ./test-files/deps/valid/src ✔ no dependency violations found (1 modules, 0 dependencies cruised) deps succeeded."
}
},
"docs": {
Expand Down
1 change: 1 addition & 0 deletions test-files/update-configs/full-repo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
coverage/
dist/
docs-dist/
generated-config-*
graphics/
node_modules/
src/all-files-for-code-coverage.test.ts
Expand Down
1 change: 1 addition & 0 deletions test-files/update-configs/full-repo/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/www-static/
bash-scripts/
docs-dist/
generated-config-*
index.html
test-files/
tsconfig*.json
Expand Down
3 changes: 2 additions & 1 deletion test-files/update-configs/full-repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"publish": "virmator publish \"npm run compile && npm run test:all\"",
"start": "npm install && virmator frontend",
"test": "virmator test",
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs \"npm run test:types\" \"npm run test:coverage\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\"",
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs,deps \"npm run test:types\" \"npm run test:coverage\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\" \"npm run test:deps\"",
"test:coverage": "npm run test coverage",
"test:deps": "virmator deps check",
"test:docs": "virmator docs check",
"test:format": "virmator format check",
"test:spelling": "virmator spellcheck",
Expand Down

0 comments on commit d4f7f3f

Please sign in to comment.