create-fs-app 1.1.10 → 2.0.1

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 (47) hide show
  1. package/README.md +340 -57
  2. package/dist/core/health-check.d.ts +15 -0
  3. package/dist/core/health-check.js +138 -0
  4. package/dist/core/health-check.js.map +1 -0
  5. package/dist/core/presets.d.ts +48 -0
  6. package/dist/core/presets.js +220 -0
  7. package/dist/core/presets.js.map +1 -0
  8. package/dist/core/registry-fetch.d.ts +20 -0
  9. package/dist/core/registry-fetch.js +121 -0
  10. package/dist/core/registry-fetch.js.map +1 -0
  11. package/dist/core/scaffold.d.ts +40 -0
  12. package/dist/core/scaffold.js +104 -0
  13. package/dist/core/scaffold.js.map +1 -0
  14. package/dist/core/template-cache.d.ts +38 -0
  15. package/dist/core/template-cache.js +233 -0
  16. package/dist/core/template-cache.js.map +1 -0
  17. package/dist/core/template-clone.d.ts +27 -0
  18. package/dist/core/template-clone.js +808 -0
  19. package/dist/core/template-clone.js.map +1 -0
  20. package/dist/core/template-list.d.ts +45 -0
  21. package/dist/core/template-list.js +191 -0
  22. package/dist/core/template-list.js.map +1 -0
  23. package/dist/core/template-registry.d.ts +78 -0
  24. package/dist/core/template-registry.js +238 -0
  25. package/dist/core/template-registry.js.map +1 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +964 -0
  28. package/dist/index.js.bak +872 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/types/index.d.ts +102 -0
  31. package/dist/types/index.js +85 -0
  32. package/dist/types/index.js.map +1 -0
  33. package/dist/utils/errors.d.ts +15 -0
  34. package/dist/utils/errors.js +50 -0
  35. package/dist/utils/errors.js.map +1 -0
  36. package/dist/utils/logger.d.ts +37 -0
  37. package/dist/utils/logger.js +62 -0
  38. package/dist/utils/logger.js.map +1 -0
  39. package/dist/utils/validation.d.ts +48 -0
  40. package/dist/utils/validation.js +100 -0
  41. package/dist/utils/validation.js.map +1 -0
  42. package/package.json +81 -35
  43. package/.github/workflows/npm-publish-github-packages.yml +0 -36
  44. package/SECURITY.md +0 -21
  45. package/assets/logo.png +0 -0
  46. package/assets/s1.png +0 -0
  47. package/create-fs-app.js +0 -181
package/package.json CHANGED
@@ -1,35 +1,81 @@
1
- {
2
- "name": "create-fs-app",
3
- "version": "1.1.10",
4
- "description": "A command line tool to create Full Stack templates",
5
- "main": "./create-fs-app",
6
- "bin": "./create-fs-app.js",
7
- "keywords": [
8
- "full Stack",
9
- "full",
10
- "Stack",
11
- "mern",
12
- "mean",
13
- "react",
14
- "express",
15
- "mongodb",
16
- "mongo"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/Om-jannu/create-fs-app.git"
21
- },
22
- "type": "module",
23
- "author": "Om Jannu",
24
- "license": "ISC",
25
- "dependencies": {
26
- "chalk": "^5.2.0",
27
- "chalk-animation": "^2.0.3",
28
- "figlet": "^1.5.2",
29
- "gradient-string": "^2.0.2",
30
- "inquirer": "^9.1.4",
31
- "nanospinner": "^1.1.0",
32
- "ora": "^8.0.1",
33
- "prompts": "^2.4.2"
34
- }
35
- }
1
+ {
2
+ "name": "create-fs-app",
3
+ "version": "2.0.1",
4
+ "description": "A CLI tool to create customizable full-stack monorepo applications",
5
+ "main": "./dist/index.js",
6
+ "bin": "./dist/index.js",
7
+ "type": "module",
8
+ "files": [
9
+ "dist/**/*",
10
+ "README.md",
11
+ "LICENSE"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "dev": "tsc -w",
16
+ "lint": "eslint . --ext .ts --max-warnings 200",
17
+ "lint:fix": "eslint . --ext .ts --fix",
18
+ "postbuild": "chmod +x dist/index.js",
19
+ "prepublishOnly": "npm run build",
20
+ "size": "npm pack --dry-run 2>&1 | grep -E 'package size|Tarball Contents'",
21
+ "size:full": "npm pack --dry-run",
22
+ "analyze": "node scripts/package-info.js",
23
+ "release:patch": "npm version patch -m 'Release v%s' && npm publish && git push --follow-tags",
24
+ "release:minor": "npm version minor -m 'Release v%s' && npm publish && git push --follow-tags",
25
+ "release:major": "npm version major -m 'Release v%s' && npm publish && git push --follow-tags",
26
+ "release:check": "npm run build && npm pack --dry-run",
27
+ "release:test": "npm run build && npm pack && echo 'Test the .tgz file before publishing'"
28
+ },
29
+ "keywords": [
30
+ "full-stack",
31
+ "monorepo",
32
+ "turborepo",
33
+ "nx",
34
+ "react",
35
+ "next.js",
36
+ "express",
37
+ "nest.js",
38
+ "typescript",
39
+ "cli",
40
+ "scaffolding",
41
+ "boilerplate"
42
+ ],
43
+ "author": "Om Jannu",
44
+ "license": "ISC",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/Om-jannu/create-fs-app.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/Om-jannu/create-fs-app/issues"
51
+ },
52
+ "homepage": "https://github.com/Om-jannu/create-fs-app#readme",
53
+ "dependencies": {
54
+ "boxen": "^8.0.1",
55
+ "chalk": "^5.6.2",
56
+ "cli-table3": "^0.6.5",
57
+ "commander": "^14.0.1",
58
+ "execa": "^9.6.0",
59
+ "figlet": "^1.9.3",
60
+ "gradient-string": "^3.0.0",
61
+ "ora": "^9.0.0",
62
+ "prompts": "^2.4.2",
63
+ "update-notifier": "^7.3.1",
64
+ "zod": "^4.1.12"
65
+ },
66
+ "devDependencies": {
67
+ "@eslint/js": "^9.39.2",
68
+ "@types/figlet": "^1.7.0",
69
+ "@types/gradient-string": "^1.1.6",
70
+ "@types/node": "^24.8.1",
71
+ "@types/prompts": "^2.4.9",
72
+ "@types/update-notifier": "^6.0.8",
73
+ "@typescript-eslint/eslint-plugin": "^8.46.1",
74
+ "@typescript-eslint/parser": "^8.46.1",
75
+ "eslint": "^9.38.0",
76
+ "typescript": "^5.9.3"
77
+ },
78
+ "engines": {
79
+ "node": ">=18.0.0"
80
+ }
81
+ }
@@ -1,36 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
16
- with:
17
- node-version: 16
18
- - run: npm ci
19
- - run: npm test
20
-
21
- publish-gpr:
22
- needs: build
23
- runs-on: ubuntu-latest
24
- permissions:
25
- contents: read
26
- packages: write
27
- steps:
28
- - uses: actions/checkout@v3
29
- - uses: actions/setup-node@v3
30
- with:
31
- node-version: 16
32
- registry-url: https://npm.pkg.github.com/
33
- - run: npm ci
34
- - run: npm publish
35
- env:
36
- NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/SECURITY.md DELETED
@@ -1,21 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- Use this section to tell people about which versions of your project are
6
- currently being supported with security updates.
7
-
8
- | Version | Supported |
9
- | ------- | ------------------ |
10
- | 5.1.x | :white_check_mark: |
11
- | 5.0.x | :x: |
12
- | 4.0.x | :white_check_mark: |
13
- | < 4.0 | :x: |
14
-
15
- ## Reporting a Vulnerability
16
-
17
- Use this section to tell people how to report a vulnerability.
18
-
19
- Tell them where to go, how often they can expect to get an update on a
20
- reported vulnerability, what to expect if the vulnerability is accepted or
21
- declined, etc.
package/assets/logo.png DELETED
Binary file
package/assets/s1.png DELETED
Binary file
package/create-fs-app.js DELETED
@@ -1,181 +0,0 @@
1
- import fs from 'fs';
2
- import child_process from 'child_process';
3
- import path from 'path';
4
- import chalk from 'chalk';
5
- import chalkAnimation from 'chalk-animation';
6
- import inquirer from 'inquirer';
7
- import { createSpinner } from 'nanospinner';
8
- import figlet from 'figlet';
9
- import gradient from 'gradient-string';
10
- import ora from 'ora';
11
- import prompts from 'prompts';
12
-
13
- const currentDirectory = process.cwd();
14
-
15
- // Git repositories
16
- const mernGitRepo = 'https://github.com/Om-jannu/mern-template.git';
17
- const meanGitRepo = 'https://github.com/your-username/mean-template.git';
18
- const mevnGitRepo = 'https://github.com/your-username/mevn-template.git';
19
-
20
- // Sleep function
21
- const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
22
-
23
-
24
- const installMyPackage = async () => {
25
- const response = await prompts({
26
- type: 'confirm',
27
- name: 'confirm',
28
- message: 'This script needs to install the create-fs-app package globally. Do you want to proceed?',
29
- initial: false,
30
- });
31
-
32
- if (response.confirm) {
33
- const spinner = ora('Installing create-fs-app package...').start();
34
- try {
35
- child_process.execSync('npm i create-fs-app -g');
36
- spinner.succeed('create-fs-app package installed successfully');
37
- } catch (error) {
38
- spinner.fail('Error installing create-fs-app package');
39
- console.error(chalk.red('Error installing create-fs-app package:', error.message));
40
- process.exit(1);
41
- }
42
- } else {
43
- console.log(chalk.yellow('Package installation canceled. Exiting...'));
44
- process.exit(0);
45
- }
46
- };
47
-
48
- // Welcome function
49
- const welcome = async () => {
50
- const msg = 'create-fs-app';
51
- const welcomeMsg = figlet(msg, (err, data) => {
52
- console.log(gradient.pastel.multiline(data));
53
- });
54
- welcomeMsg;
55
- await sleep();
56
- console.log(`
57
- I am your personal FullStack template generator
58
- I can create Full Stack Templates for you ${chalk.green('in seconds')}😉
59
- Let's get started...
60
- `);
61
- };
62
-
63
- // Question function
64
- const askFsName = async () => {
65
- const answers = await inquirer.prompt({
66
- name: 'fs_app',
67
- type: 'list',
68
- message: 'Which FullStack App do you want to build?',
69
- choices: ['MERN app', 'MEAN app', 'MEVN app'],
70
- });
71
- return handleAnswer(answers.fs_app);
72
- };
73
-
74
- // Completion screen
75
- const completion = async (appName) => {
76
- const completion_msg = chalkAnimation.rainbow(
77
- '\nSuccessfully created your Full Stack Template'
78
- );
79
- await sleep();
80
- completion_msg.stop();
81
- console.log(chalk.bold.yellow('To access your folder :'));
82
- console.log(chalk.bold.blue(`cd ${appName === '.' ? currentDirectory : appName}`));
83
- console.log(chalk.bold.blue('code .'));
84
- console.log(chalk.bold.yellow(`\nNOTE : ${chalk.bold.blue('code .')} is for opening folder in ${chalk.bold.blue('vs-code')} for different IDE use different Keyword`));
85
- };
86
-
87
- // Answer handler
88
- const handleAnswer = async (fs_app) => {
89
- const spinner = createSpinner(chalk.bold.green('Creating your Project Structure...')).start();
90
- await sleep();
91
- spinner.stop();
92
-
93
- try {
94
- let repoUrl;
95
- switch (fs_app) {
96
- case 'MERN app':
97
- console.log(chalk.bold.bgGreen('\nBuilding MERN structure'));
98
- repoUrl = mernGitRepo;
99
- break;
100
- case 'MEAN app':
101
- console.log(chalk.bold.bgBlue('\nBuilding MEAN structure'));
102
- repoUrl = meanGitRepo;
103
- break;
104
- case 'MEVN app':
105
- console.log(chalk.bold.bgMagenta('\nBuilding MEVN structure'));
106
- repoUrl = mevnGitRepo;
107
- break;
108
- default:
109
- console.error(chalk.red('Invalid choice. Please try again.'));
110
- process.exit(1);
111
- }
112
-
113
- const appName = process.argv[2] || '.';
114
- await buildStructure(fs_app, repoUrl, appName);
115
- await completion(appName);
116
- } catch (error) {
117
- console.error(chalk.red('Error creating project structure:', error.message));
118
- process.exit(1);
119
- }
120
- };
121
-
122
- // Function to build the project structure
123
- const buildStructure = async (selectedApp, repoUrl, appName) => {
124
- try {
125
- // Function to create a folder
126
- const createFolder = async (folderName) => {
127
- try {
128
- if (!fs.existsSync(folderName)) {
129
- fs.mkdirSync(folderName);
130
- console.log(chalk.bold.green(`Creating a ${selectedApp} in ~/${folderName}`));
131
- } else {
132
- console.log(chalk.italic.red(`Folder ${folderName} already exists.`));
133
- console.log(chalk.bold.yellow(`Try : cd ${folderName} && npx create-fs-app .`));
134
- }
135
- } catch (err) {
136
- throw new Error(`Error creating folder ${err}`);
137
- }
138
- };
139
-
140
- // Function to clone a repository
141
- const cloneRepository = async (dirName, custdir, repo) => {
142
- try {
143
- child_process.execSync(`git clone ${repo} ${dirName}`, { stdio: 'inherit' });
144
- console.log(chalk.bold.green('\nRepository cloned successfully to ' + custdir));
145
- } catch (err) {
146
- throw new Error('Error cloning repository:', err);
147
- }
148
- };
149
-
150
- if (!appName) {
151
- throw new Error('Error: Please provide a directory name');
152
- } else if (appName === '.') {
153
- cloneRepository('.', currentDirectory, repoUrl);
154
- } else {
155
- await createFolder(appName);
156
- await cloneRepository(appName, path.join(currentDirectory, appName), repoUrl);
157
- }
158
- } catch (error) {
159
- throw error;
160
- }
161
- };
162
-
163
- const run = async () => {
164
- try {
165
- if (process.argv.length > 3) {
166
- console.log(chalk.italic.red('Error: Please provide a valid directory name'));
167
- console.log(chalk.italic.red('Note: directory name should not contain spaces'));
168
- console.log(chalk.bold.yellow('Try : npx create-fs-app app_name'));
169
- process.exit(1);
170
- }
171
-
172
- // await installMyPackage();
173
- await welcome();
174
- await askFsName();
175
- } catch (error) {
176
- console.error(chalk.red('An error occurred:', error.message));
177
- process.exit(1);
178
- }
179
- };
180
-
181
- run();