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
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.0 04/03/2025
feat: _tpl_testing_ added to the default ignore allowing a tpl to hold own test files
Copy link
Copy Markdown
Contributor

@p-mcgowan p-mcgowan Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here: \_tpl_testing_ will prevent it from being italic (just looking at the "rich diff" option in github
image


### 5.61.0 15/02/2025
chore: typescript bumped to latest major and quicktype to latest minor in the 15 major range

Expand Down
5 changes: 0 additions & 5 deletions docs/_pages/known-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ Below you can see the list of templates available for use with Generate-it
- [generate-it-typescript-server](https://github.com/acr-lfr/generate-it-typescript-server)
- All types derived from the openapi file
- Uses the express http engine
- [generate-it-typescript-api-test-rig](https://github.com/acr-lfr/generate-it-typescript-api-test-rig)
- Generates stub files to write tests for
- Uses jest and request promise
- Uses the out of the box Jest test coverage reporting
- Written in typescript
- [generate-it-typescript-server-client](https://github.com/acr-lfr/generate-it-typescript-server-client)
- A server side typescript client
- [generate-it-asyncapi-rabbitmq](https://github.com/acr-lfr/generate-it-asyncapi-rabbitmq)
Expand Down
6 changes: 6 additions & 0 deletions docs/_pages/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ NOTE: This is different to type OTHER which will always be added back if not fou
Named: Anything, with or without .njk file extension.

These files are every other file that is not one of the above special file types. They are also rendered by the templating engine unless the `renderOnlyExt` option is enabled.

### Testing template files

Generate-it will ignore any files in a folder called "\_tpl_testing\_". An example can be found in the https://github.com/j-d-carmichael/gen-it-ts-esm-server template.

This allows the developer of the template to build and test locally before publishing.
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.61.0",
"version": "5.62.0",
"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/lib/helpers/__tests__/isFileToIgnore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ describe('Should not allow directories on black list, eg git idea vscode, even a
expect(isFileToIgnore('som/dir/node_modules/blah', 'workspace')).toBe(true);
expect(isFileToIgnore('som/dir/node_modules', 'workspace')).toBe(true);
expect(isFileToIgnore('som/dir/node_modules/', 'workspace')).toBe(true);
expect(isFileToIgnore('som/dir/_tpl_testing_/', 'workspace')).toBe(true);
expect(isFileToIgnore('som/_tpl_testing_/nested/dir', 'workspace')).toBe(true);
});

it('should match exactly', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/isFileToIgnore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NodegenRc } from '@/interfaces';
import path from 'path';

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

Expand Down