Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"devDependencies": {
"@asyncapi/minimaltemplate": "./test/fixtures/minimaltemplate",
"@asyncapi/newtemplate": "./test/fixtures/newtemplate",
"@eslint/js": "^9.39.2",
"@oclif/test": "^3.2.15",
"@types/archiver": "^7.0.0",
"@types/body-parser": "^1.19.6",
Expand All @@ -76,18 +77,17 @@
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0",
"c8": "^10.1.3",
"chai": "^6.2.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.2",
"@eslint/js": "^9.39.2",
"eslint-config-oclif": "^6",
"eslint-plugin-github": "^6.0.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-sonarjs": "^3.0.5",
"markdown-toc": "^1.2.0",
"mocha": "^11.7.5",
"nodemon": "^3.1.11",
"c8": "^10.1.3",
"puppeteer": "^24.33.0",
"rimraf": "^6.1.2",
"simple-git": "^3.30.0",
Expand Down
2 changes: 2 additions & 0 deletions src/apps/cli/internal/base/BaseGeneratorCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GeneratorOptions {
forceWrite: boolean;
install: boolean;
debug: boolean;
compile: boolean;
templateParams: any;
noOverwriteGlobs: string[];
mapBaseUrlToFolder: any;
Expand Down Expand Up @@ -49,6 +50,7 @@ export abstract class BaseGeneratorCommand extends Command {
forceWrite: flags['force-write'],
install: flags.install,
debug: flags.debug,
compile: flags.compile,
templateParams: parsedFlags.params,
noOverwriteGlobs: flags['no-overwrite'],
mapBaseUrlToFolder: parsedFlags.mapBaseUrlToFolder,
Expand Down
5 changes: 5 additions & 0 deletions src/apps/cli/internal/flags/generate/sharedFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ export const sharedFlags = {
'registry-token': Flags.string({
description: 'The npm registry authentication token, that can be passed instead of base64 encoded username and password'
}),
compile: Flags.boolean({
default: true,
allowNo: true,
description: 'Compile the template (set to false to use cached transpiled version, defaults to true)'
}),
};
19 changes: 19 additions & 0 deletions test/integration/generate/fromTemplate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,23 @@ describe('template', () => {
}
);
});

describe('compile flag', () => {
test
.stdout()
.command([
...generalOptions,
'--output=./test/docs/9',
'--force-write',
'--no-compile',
nonInteractive
])
.it('should generate template with compile flag disabled', (ctx, done) => {
expect(ctx.stdout).to.contain(
'Check out your shiny new generated files at ./test/docs/9.\n\n'
);
cleanup('./test/docs/9');
done();
});
});
});