Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/jsLibraryMappings.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/openapi-nodegen.iml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/php.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/vcs.xml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### 5.62.4 16/06/2025
fix: default ignore paths for copy and render now explicitly match the build & dist folder only, avoiding accidental matches with similarly named files (e.g., tsconfig.build.json).

### 5.62.3 04/03/2025
fix: template fetch fail message referred toa URL even when local path provided

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ The templates should be hosted on a publicly available https url, eg: [generate-
It is strongly recommended to use the OpenApi DSL package [boats](https://www.npmjs.com/package/boats) to standardize OpenAPI/AsyncAPI file architecture and operation IDs and more.
___

Generate-It is an opensource project from [acrontum](https://www.acrontum.de/) and [Liffery](https://www.liffery.com/) written in TypeScript and is tested on NodeJS 14 LTS.
Generate-It is an opensource project from [acrontum](https://www.acrontum.de/) and [Liffery](https://www.liffery.com/) written in TypeScript and is tested on NodeJS LTS.
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": "generate-it",
"version": "5.62.3",
"version": "5.62.4",
"description": "Generate-it, will generate servers, clients, web-socket and anything else you can template with nunjucks from yml files (openapi/asyncapi)",
"author": "Acrontum GmbH & Liffery Ltd",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/openapiNodegen_full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ it('Should have the correct file hashes', async () => {
// The app ts should be modified - the hash should match:
// test_server/.openapi-nodegen/git/httpsGithubComAcrontumOpenapiNodegenTypescriptInjectServerGit/src/app.ts
['test_server/src/app.ts', 'c8b383752c315a02043acdd40df63caf'],
// It should copy over build files like tsconfig.build.json
['test_server/tsconfig.build.json', 'a085d43ab78199c39acaaddd70696776'],
];

const mismatched: string[] = [];
Expand Down
46 changes: 46 additions & 0 deletions src/lib/helpers/__tests__/shouldCopyOrRenderFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@ import shouldCopyOrRenderFile from '@/lib/helpers/shouldCopyOrRenderFile';
import { NodegenRc } from '@/interfaces';

describe('File Ignore Functionality', () => {

it('should skip files in a build or dist folder but not if the file contains build or dist', () => {
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'copy',
directoryPathContainingFilename: 'build/something.ts',
filenameBeingProcessed: 'config'
})).toBe(false);
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'render',
directoryPathContainingFilename: 'build/something.ts',
filenameBeingProcessed: 'config'
})).toBe(false);
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'copy',
directoryPathContainingFilename: 'dist/something.ts',
filenameBeingProcessed: 'config'
})).toBe(false);
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'render',
directoryPathContainingFilename: 'dist/something.ts',
filenameBeingProcessed: 'config'
})).toBe(false);

expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'copy',
directoryPathContainingFilename: 'dist.something.ts',
filenameBeingProcessed: 'config'
})).toBe(true);
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'render',
directoryPathContainingFilename: 'dist.something.ts',
filenameBeingProcessed: 'config'
})).toBe(true);

expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'copy',
directoryPathContainingFilename: 'tsconfig.build.json',
filenameBeingProcessed: 'config'
})).toBe(true);
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'render',
directoryPathContainingFilename: 'tsconfig.build.json',
filenameBeingProcessed: 'config'
})).toBe(true);
});

it('should skip .git, node_modules, and editor files', () => {
expect(shouldCopyOrRenderFile({
ignoreForWhichAction: 'copy',
Expand Down
4 changes: 2 additions & 2 deletions src/lib/helpers/shouldCopyOrRenderFile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NodegenRc } from '@/interfaces';
import path from 'path';

const defaultCopyIgnoreList = [`(\\.idea|\\.git|\\.vscode|node_modules|build|dist|_tpl_testing_)\\b`];
const defaultRenderIgnoreList = [`(\\.idea|\\.git|\\.vscode|node_modules|build|dist)\\b`];
const defaultCopyIgnoreList = [`(\\.idea|\\.git|\\.vscode|node_modules|build\/|dist\/|_tpl_testing_)\\b`];
const defaultRenderIgnoreList = [`(\\.idea|\\.git|\\.vscode|node_modules|build\/|dist\/)\\b`];
let ignoreList: string;
let fullRegex: RegExp;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"types": ["node"],
"sourceMap": false,
"composite": true,
"incremental": true
},
"exclude": ["**/*.test.ts", "**/*.spec.ts"],
"include": ["src/**/*.ts", "migrations", "src/router.int.spec.ts", "package.json"]
}