boilerforge 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/dist/cli.js +35856 -21740
  4. package/{src/templates/create-node-app/resource/gitignore.ts → dist/templates/create-node-app/app/.gitignore.hbs} +1 -14
  5. package/dist/templates/create-node-app/app/.prettierrc.json.hbs +15 -0
  6. package/dist/templates/create-node-app/app/README.md.hbs +54 -0
  7. package/dist/templates/create-node-app/app/package.json.hbs +30 -0
  8. package/dist/templates/create-node-app/app/src/index.js.hbs +5 -0
  9. package/dist/templates/create-node-app/app/src/index.ts.hbs +5 -0
  10. package/dist/templates/create-node-app/app/tsconfig.json.hbs +15 -0
  11. package/dist/templates/create-node-app/forge.config.json +14 -0
  12. package/dist/templates/create-node-app/forge.prompt.json +105 -0
  13. package/dist/templates/create-node-app/schema/prompt.schema.json +240 -0
  14. package/package.json +17 -2
  15. package/.commitlintrc.json +0 -3
  16. package/.github/workflows/release-pipeline.yml +0 -79
  17. package/.husky/commit-msg +0 -4
  18. package/.husky/pre-push +0 -4
  19. package/.release/latest/config.json +0 -16
  20. package/.release/latest/manifest.json +0 -3
  21. package/.release/rc/config.json +0 -19
  22. package/.release/rc/manifest.json +0 -3
  23. package/CHANGELOG.md +0 -68
  24. package/bin/cli.ts +0 -21
  25. package/esbuild.config.ts +0 -17
  26. package/prettier.config.mjs +0 -20
  27. package/src/config/cli-config.ts +0 -25
  28. package/src/lib/file.ts +0 -159
  29. package/src/lib/project.ts +0 -211
  30. package/src/lib/prompter.ts +0 -201
  31. package/src/lib/task.ts +0 -41
  32. package/src/templates/create-node-app/index.ts +0 -306
  33. package/src/templates/create-node-app/resource/editor-config.ts +0 -24
  34. package/src/templates/create-node-app/resource/eslint.ts +0 -62
  35. package/src/templates/create-node-app/resource/package-json.ts +0 -57
  36. package/src/templates/create-node-app/resource/prettier.ts +0 -45
  37. package/src/templates/create-node-app/resource/project-deps.ts +0 -30
  38. package/src/templates/create-node-app/resource/project-files.ts +0 -17
  39. package/src/templates/create-node-app/resource/tsconfig.ts +0 -20
  40. package/src/templates/index.ts +0 -1
  41. package/src/templates/utils/badges.ts +0 -13
  42. package/src/templates/utils/git.ts +0 -64
  43. package/src/templates/utils/package-manager.ts +0 -78
  44. package/src/templates/utils/readme.ts +0 -115
  45. package/src/utils/exec-cmd.ts +0 -80
  46. package/src/utils/index.ts +0 -60
  47. package/src/utils/logger.ts +0 -24
  48. package/tsconfig.json +0 -17
  49. /package/{.editorconfig → dist/templates/create-node-app/app/.editorconfig.hbs} +0 -0
  50. /package/{.prettierignore → dist/templates/create-node-app/app/.prettierignore.hbs} +0 -0
  51. /package/{eslint.config.mjs → dist/templates/create-node-app/app/eslint.config.mjs.hbs} +0 -0
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
- "packages": {
4
- ".": {
5
- "package-name": "boilerforge",
6
- "release-type": "node",
7
- "changelog-path": "CHANGELOG.md",
8
- "prerelease-type": "rc",
9
- "prerelease": true
10
- }
11
- },
12
- "include-v-in-tag": true,
13
- "bump-minor-pre-major": false,
14
- "pull-request-title-pattern": "release(rc): v${version}",
15
- "pull-request-header": "Release Notes",
16
- "separate-pull-requests": true,
17
- "bump-patch-for-minor-pre-major": true,
18
- "versioning": "prerelease"
19
- }
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.0.2"
3
- }
package/CHANGELOG.md DELETED
@@ -1,68 +0,0 @@
1
- # Changelog
2
-
3
- ## [1.1.3](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.1.2...boilerforge-v1.1.3) (2026-05-04)
4
-
5
-
6
- ### Bug Fixes
7
-
8
- * **ci:** cancelled in progress release-pipeline workflows ([#83](https://github.com/tspyder7/boilerforge/issues/83)) ([210daae](https://github.com/tspyder7/boilerforge/commit/210daae626de6758a01c57d8b45adca6f52c670f))
9
- * **ci:** fixed typo in workflow ([#82](https://github.com/tspyder7/boilerforge/issues/82)) ([8ea21cb](https://github.com/tspyder7/boilerforge/commit/8ea21cbae37b4ee17f08e100d59edd7ce4913754))
10
- * **ci:** updated release-pipeline to use node 24 & fixed release configuration prod -> latest ([#81](https://github.com/tspyder7/boilerforge/issues/81)) ([a36e469](https://github.com/tspyder7/boilerforge/commit/a36e469390d8187414474b0a7754b67209865842))
11
-
12
- ## [1.1.2](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.1.1...boilerforge-v1.1.2) (2026-05-04)
13
-
14
-
15
- ### Bug Fixes
16
-
17
- * updated node engine >= 24 and added keyword, repository configuation ([#79](https://github.com/tspyder7/boilerforge/issues/79)) ([8022e7a](https://github.com/tspyder7/boilerforge/commit/8022e7afb5cd7685c7650816a181d4131b0f8d8d))
18
-
19
- ## [1.1.1](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.1.0...boilerforge-v1.1.1) (2026-04-26)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * **ci:** added setup-release job ([#76](https://github.com/tspyder7/boilerforge/issues/76)) ([08afa65](https://github.com/tspyder7/boilerforge/commit/08afa65ed19d705ec684d3bcbd4c3bc2e41afbba))
25
- * **ci:** giving warning message when there is no release-type ([#77](https://github.com/tspyder7/boilerforge/issues/77)) ([d821871](https://github.com/tspyder7/boilerforge/commit/d821871eb63b1ebcaf6d8a2ff5a042e6e725bfe6))
26
-
27
- ## [1.1.0](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.0.2...boilerforge-v1.1.0) (2026-04-26)
28
-
29
-
30
- ### Features
31
-
32
- * updated readme description ([#74](https://github.com/tspyder7/boilerforge/issues/74)) ([4c44e35](https://github.com/tspyder7/boilerforge/commit/4c44e357eceada7e4a82326e4fd5a88757cf87ed))
33
-
34
- ## [1.0.2](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.0.1...boilerforge-v1.0.2) (2025-08-19)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * changed npm publish version and added mjs for prettier file ([#68](https://github.com/tspyder7/boilerforge/issues/68)) ([b977c77](https://github.com/tspyder7/boilerforge/commit/b977c77da6b092bad04cfb45eb27d46571bf88b0))
40
-
41
- ## [1.0.1](https://github.com/tspyder7/boilerforge/compare/boilerforge-v1.0.0...boilerforge-v1.0.1) (2025-08-19)
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * fixed release please pull request header ([770c831](https://github.com/tspyder7/boilerforge/commit/770c831063090bb740c5c5112bf88a86a4378bdc))
47
-
48
- ## 1.0.0 (2025-08-19)
49
-
50
-
51
- ### Features
52
-
53
- * added cli configuration for boilerforge ([21ad40d](https://github.com/tspyder7/boilerforge/commit/21ad40d15e1a5d469ee518d8b206d64b02e7b732))
54
- * added esbuild config file and injected pkg version ([7a57867](https://github.com/tspyder7/boilerforge/commit/7a57867f4fbadf9ff681bfce558137c1fd0d0214))
55
- * added github workflow for npm publish ([e913309](https://github.com/tspyder7/boilerforge/commit/e91330943bdfb40dfc7e891bbbed75017073d00a))
56
- * added restrict pr source branch workflow to restrict any pr to main except development ([25005ad](https://github.com/tspyder7/boilerforge/commit/25005adbc075054b3b2904028f7dda46ec5bfff1))
57
- * added utils and helper classes ([3389187](https://github.com/tspyder7/boilerforge/commit/338918734dec2e2b33c036e66e6d328d5a45e00e))
58
- * create node app template ([739c233](https://github.com/tspyder7/boilerforge/commit/739c233e73825d7f9189a2887e62fc98a8d50dc9))
59
- * created cli for bolierforge ([2839e40](https://github.com/tspyder7/boilerforge/commit/2839e40b79787837a1caf6604fe30140134378d7))
60
- * pnpm, eslint & prettier ([62d211e](https://github.com/tspyder7/boilerforge/commit/62d211e1ddf09bdbe0e763c20b9305d2d96fed71))
61
- * template utilities ([4a72ba5](https://github.com/tspyder7/boilerforge/commit/4a72ba534a0e87c07e5bd540c80bafe6f4390a25))
62
-
63
-
64
- ### Bug Fixes
65
-
66
- * added missing release please manifest file ([6b8e0e5](https://github.com/tspyder7/boilerforge/commit/6b8e0e5e5ba5e53e38c9a87f5791716a3786fbfe))
67
- * disable release pull request ([a66ffac](https://github.com/tspyder7/boilerforge/commit/a66ffac5610e1f0d5838c65277b453f8de0eaee1))
68
- * fixed project name generation in lib ([430e982](https://github.com/tspyder7/boilerforge/commit/430e982743a62fbb44a98e80fe3bc67c80212daf))
package/bin/cli.ts DELETED
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import cliConfig from '../src/config/cli-config';
5
- import { CreateNodeApp } from '../src/templates';
6
-
7
- (async function () {
8
- const program = new Command();
9
- program
10
- .name(cliConfig.name)
11
- .description(cliConfig.description)
12
- .version(
13
- cliConfig.version,
14
- '-v, --version',
15
- 'output the version number',
16
- );
17
-
18
- new CreateNodeApp({ program });
19
-
20
- program.parse();
21
- })();
package/esbuild.config.ts DELETED
@@ -1,17 +0,0 @@
1
- // esbuild.config.ts
2
- import { build } from 'esbuild';
3
- import { readFileSync } from 'fs';
4
-
5
- const { version } = JSON.parse(readFileSync('package.json', 'utf-8'));
6
-
7
- build({
8
- entryPoints: ['bin/cli.ts'],
9
- outfile: 'dist/cli.js',
10
- bundle: true,
11
- platform: 'node',
12
- format: 'cjs',
13
- logLevel: 'info',
14
- define: {
15
- VERSION: JSON.stringify(version), // injects into runtime
16
- },
17
- }).catch(() => process.exit(1));
@@ -1,20 +0,0 @@
1
- /**
2
- * @type {import('prettier').Config}
3
- */
4
- const config = {
5
- printWidth: 80,
6
- tabWidth: 4,
7
- useTabs: false,
8
- semi: true,
9
- singleQuote: true,
10
- quoteProps: 'as-needed',
11
- trailingComma: 'all',
12
- arrowParens: 'always',
13
- parser: 'typescript',
14
- proseWrap: 'always',
15
- endOfLine: 'auto',
16
- embeddedLanguageFormatting: 'auto',
17
- singleAttributePerLine: true,
18
- };
19
-
20
- export default config;
@@ -1,25 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- declare const VERSION: string;
3
-
4
- const runtimeVersion = typeof VERSION !== 'undefined' ? VERSION : '0.0.0-dev';
5
-
6
- type SemVersion =
7
- | `${number}.${number}.${number}`
8
- | `${number}.${number}.${number}-${string}`
9
- | `${number}.${number}.${number}+${string}`
10
- | `${number}.${number}.${number}-${string}+${string}`;
11
-
12
- type CLIConfiguration = {
13
- name: string;
14
- description: string;
15
- version: SemVersion;
16
- };
17
-
18
- const cliConfig: CLIConfiguration = {
19
- name: 'boilerforge',
20
- description:
21
- 'boilerforge is a blazing-fast CLI utility that scaffolds clean, ready-to-use project structures so you can skip the setup and start building instantly.',
22
- version: runtimeVersion as SemVersion,
23
- };
24
-
25
- export default cliConfig;
package/src/lib/file.ts DELETED
@@ -1,159 +0,0 @@
1
- import {
2
- createReadStream,
3
- createWriteStream,
4
- existsSync,
5
- mkdirSync,
6
- readdirSync,
7
- rmdirSync,
8
- unlinkSync,
9
- writeFileSync,
10
- } from 'fs';
11
- import { join, sep } from 'path';
12
-
13
- import { logger } from '../utils/logger';
14
-
15
- export class File {
16
- private fileName: string;
17
- private filePath: string;
18
- private fileExtension?: string;
19
- private dirPath: string;
20
- private contextPath: string;
21
- private relativeDirPath: string;
22
- private relativeFilePath: string;
23
- private content?: string;
24
-
25
- constructor(
26
- filePath: string,
27
- fileOptions?: { dirPath?: string; content?: string },
28
- ) {
29
- const { content = '', dirPath } = fileOptions ?? {};
30
-
31
- const filePathSplit = filePath.split('/');
32
-
33
- const relativeDirPath = join(
34
- ...filePathSplit.slice(0, filePathSplit.length - 1),
35
- );
36
-
37
- const fileName = filePathSplit[filePathSplit.length - 1];
38
-
39
- this.contextPath = dirPath ?? __dirname;
40
- this.fileName = fileName;
41
- this.content = content;
42
- this.dirPath = join(
43
- this.contextPath,
44
- relativeDirPath.length ? relativeDirPath : __dirname,
45
- );
46
- this.filePath = join(this.dirPath, fileName);
47
- this.fileExtension = fileName.split('.').at(1);
48
- this.relativeDirPath = relativeDirPath;
49
- this.relativeFilePath = join(relativeDirPath, fileName);
50
- }
51
-
52
- get getFileName(): string {
53
- return this.fileName;
54
- }
55
-
56
- get getFilePath(): string {
57
- return this.filePath;
58
- }
59
-
60
- get getFileExtension(): string | undefined {
61
- return this.fileExtension;
62
- }
63
-
64
- get getDirPath(): string {
65
- return this.dirPath;
66
- }
67
-
68
- get getContextPath(): string {
69
- return this.contextPath;
70
- }
71
-
72
- get getRelativeDirPath(): string {
73
- return this.relativeDirPath;
74
- }
75
-
76
- get getRelativeFilePath(): string {
77
- return this.relativeFilePath;
78
- }
79
-
80
- create(content?: string) {
81
- try {
82
- mkdirSync(this.dirPath, { recursive: true });
83
- writeFileSync(
84
- this.filePath,
85
- content || this.content || '',
86
- 'utf-8',
87
- );
88
- } catch (error) {
89
- logger.err(
90
- `Error while creating the file: ${this.filePath}, ${(error as Error).message}`,
91
- );
92
-
93
- throw new Error(`Error while creating the file ${this.filePath}`);
94
- }
95
- }
96
-
97
- isExists() {
98
- return existsSync(this.filePath);
99
- }
100
-
101
- delete() {
102
- if (!this.isExists())
103
- throw new Error(`File does not exists: ${this.filePath}`);
104
-
105
- try {
106
- unlinkSync(this.filePath);
107
- this.deleteDir();
108
- } catch (error) {
109
- logger.err(
110
- `Error while deleting the file: ${this.filePath}, ${(error as Error).message}`,
111
- );
112
-
113
- throw new Error(`Error while deleting the file ${this.filePath}`);
114
- }
115
- }
116
-
117
- async createFrom(file: File) {
118
- if (!file.isExists())
119
- throw new Error(
120
- `File to copy from does not exist: ${file.getFilePath}`,
121
- );
122
-
123
- if (this.isExists())
124
- throw new Error(`File already exists: ${this.filePath}`);
125
-
126
- await new Promise((resolve, reject) => {
127
- const readStream = createReadStream(file.getFilePath, 'utf-8');
128
- const writeStream = createWriteStream(this.filePath);
129
-
130
- readStream.pipe(writeStream);
131
-
132
- readStream.on('error', reject);
133
- writeStream.on('error', reject);
134
- writeStream.on('finish', () => resolve);
135
- });
136
- }
137
-
138
- private deleteDir() {
139
- try {
140
- const dirs = this.relativeDirPath.split(sep);
141
-
142
- for (let i = dirs.length; i > 0; i--) {
143
- const dirPath = join(this.contextPath, ...dirs.slice(0, i));
144
-
145
- if (readdirSync(dirPath).length) break;
146
-
147
- rmdirSync(dirPath);
148
- }
149
- } catch (error) {
150
- logger.err(
151
- `Error while deleting the dirs: ${this.relativeDirPath}, ${(error as Error).message}`,
152
- );
153
-
154
- throw new Error(
155
- `Error while deleting the dirs: ${this.relativeDirPath}`,
156
- );
157
- }
158
- }
159
- }
@@ -1,211 +0,0 @@
1
- import { Command } from 'commander';
2
- import { Listr, ListrTaskWrapper } from 'listr2';
3
- import { dirname, join, sep } from 'path';
4
- import { logger } from '../utils/logger';
5
- import { File } from './file';
6
- import { Task } from './task';
7
-
8
- export interface GitCheck {
9
- version?: string;
10
- configuration?: {
11
- username: string;
12
- email: string;
13
- };
14
- }
15
-
16
- export interface SystemCheck {
17
- git?: GitCheck;
18
- packageManager?: string;
19
- }
20
-
21
- export interface ProjectDependency {
22
- devDependencies: string[];
23
- dependencies: string[];
24
- }
25
-
26
- export interface Resource {
27
- filename: string;
28
- content: string;
29
- }
30
-
31
- export interface ProjectProps {
32
- name: string;
33
- packageManager: string;
34
- description?: string;
35
- version?: string;
36
- author?: string;
37
- }
38
-
39
- export interface BootstrapProps extends Partial<ProjectProps> {
40
- program: Command;
41
- showSubTasks?: boolean;
42
- showErrorMessage?: boolean;
43
- }
44
-
45
- export interface NodejsProjectProps extends BootstrapProps {}
46
-
47
- export abstract class Project {
48
- name: string = '';
49
- description: string = '';
50
- version: string = '';
51
- author: string = '';
52
- projectPath: string = '';
53
- parentDirPath: string = '';
54
- packageManager: string = '';
55
- packageManagerVersion: string = '';
56
-
57
- protected configureProject(projectProps: Partial<ProjectProps>) {
58
- const {
59
- name = this.name,
60
- description,
61
- version = '0.0.1',
62
- author,
63
- packageManager = '',
64
- } = projectProps;
65
-
66
- const cwd = process.cwd();
67
-
68
- this.name = !name.length ? cwd.split(sep).slice(-1)[0] : name;
69
- this.description = description?.length
70
- ? description
71
- : `Node.js application for ${this.name}`;
72
- this.version = version;
73
- this.author = author ?? '';
74
- this.packageManager = packageManager;
75
- this.projectPath = join(cwd, name.length ? name : '');
76
- this.parentDirPath = name.length ? cwd : dirname(cwd);
77
- this.packageManagerVersion = '';
78
- }
79
-
80
- getPackageManager() {
81
- return `${this.packageManager}@${this.packageManagerVersion}`;
82
- }
83
- }
84
-
85
- export abstract class Bootstrap extends Project {
86
- protected tasks: Task[];
87
- protected executedTasks: Task[];
88
- protected showSubTasks?: boolean;
89
- protected showErrorMessage?: boolean;
90
- protected taskExecutor: Listr;
91
- protected systemCheck: SystemCheck;
92
- protected files: File[];
93
- protected program: Command;
94
- protected cmdExecutedFromDir: string;
95
-
96
- constructor(props: BootstrapProps) {
97
- super();
98
- this.tasks = [];
99
- this.executedTasks = [];
100
- this.showSubTasks = props.showSubTasks ?? true;
101
- this.showErrorMessage = props.showErrorMessage ?? false;
102
- this.taskExecutor = new Listr([]);
103
- this.systemCheck = {};
104
- this.files = [];
105
- this.program = props.program;
106
- this.cmdExecutedFromDir = process.cwd();
107
- this.configureProject(props);
108
- }
109
-
110
- private async buildListrTask(
111
- taskHandler: Task,
112
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
113
- ): Promise<{ title: string; task: any; enabled?: any }> {
114
- if (!taskHandler.subTasks.length) {
115
- return {
116
- title: taskHandler.title,
117
- enabled: taskHandler.enabled,
118
- task: async () => {
119
- await taskHandler.task();
120
- this.executedTasks.push(taskHandler);
121
- },
122
- };
123
- }
124
-
125
- return {
126
- title: taskHandler.title,
127
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
- task: async (_: any, task: ListrTaskWrapper<any, any, any>) => {
129
- await taskHandler.task();
130
- this.executedTasks.push(taskHandler);
131
-
132
- const subTasks = [];
133
- for (const subTask of taskHandler.subTasks) {
134
- subTasks.push(await this.buildListrTask(subTask));
135
- }
136
-
137
- return task.newListr([...subTasks], {
138
- exitOnError: taskHandler.exitOnError,
139
- concurrent: taskHandler.concurrent,
140
- });
141
- },
142
- };
143
- }
144
-
145
- async bootstrap(): Promise<void> {
146
- try {
147
- const listrTasks = await Promise.all(
148
- this.tasks.map(
149
- async (taskHandler) =>
150
- await this.buildListrTask(taskHandler),
151
- ),
152
- );
153
-
154
- this.taskExecutor.add(listrTasks);
155
- this.taskExecutor.options = {
156
- rendererOptions: {
157
- showErrorMessage: this.showErrorMessage,
158
- showSubtasks: this.showSubTasks,
159
- },
160
- };
161
- await this.taskExecutor.run();
162
- } catch (error) {
163
- logger.err(error);
164
-
165
- const rollbacks = this.tasks
166
- .map(({ rollback }) => rollback)
167
- .reverse();
168
-
169
- await Promise.all(
170
- rollbacks.map(
171
- async (rollback) => rollback && (await rollback()),
172
- ),
173
- );
174
- }
175
- }
176
-
177
- async setup(): Promise<Bootstrap> {
178
- throw new Error('Not Implemented');
179
- }
180
-
181
- async configureCliCommand(): Promise<Bootstrap> {
182
- throw new Error('Not Implemented');
183
- }
184
-
185
- async promptUser() {
186
- throw new Error('Not Implemented');
187
- }
188
-
189
- getSystemCheck() {
190
- return this.systemCheck;
191
- }
192
- }
193
-
194
- export abstract class NodejsProject extends Bootstrap {
195
- protected isTypescript: boolean;
196
- protected isEslintPrettier: boolean;
197
-
198
- constructor(nodejsProjectProps: NodejsProjectProps) {
199
- super(nodejsProjectProps);
200
- this.isTypescript = false;
201
- this.isEslintPrettier = false;
202
- }
203
-
204
- get enabledTypescript() {
205
- return this.isTypescript;
206
- }
207
-
208
- get enabledEslintPrettier() {
209
- return this.isEslintPrettier;
210
- }
211
- }