create-catalyst-app-internal 0.0.1-beta.5 → 0.0.1-beta.6

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-catalyst-app-internal",
3
3
  "bin": "scripts/cli.cjs",
4
- "version": "0.0.1-beta.5",
4
+ "version": "0.0.1-beta.6",
5
5
  "description": "cli package to scaffold Catalyst application",
6
6
  "main": "index.js",
7
7
  "scripts": {
package/scripts/cli.cjs CHANGED
@@ -35,9 +35,6 @@ const program = new Commander.Command()
35
35
  const projectDescription = await promptDescription()
36
36
  const stateManagement = cmd.stateManagement || (await promptStateManagement())
37
37
 
38
- const resolvedProjectPath = path.resolve(projectName.trim())
39
- const projectPath = path.basename(resolvedProjectPath)
40
- const root = path.resolve(projectPath)
41
38
 
42
39
  // Define mapping of options to repository suffixes
43
40
  const repositorySuffixes = {
@@ -56,30 +53,30 @@ const program = new Commander.Command()
56
53
  const subDirectoriesToExtract = [commonCodeDirectory, selectedTemplateCode]
57
54
  const extractionDestination = `/${projectName}/`
58
55
  let tempDir
59
- ;(() => {
60
- try {
61
- tempDir = createTempDir()
56
+ ; (() => {
57
+ try {
58
+ tempDir = createTempDir()
62
59
 
63
- const packageFilePath = packNpmPackage(packageName, packageVersion, tempDir)
60
+ const packageFilePath = packNpmPackage(packageName, packageVersion, tempDir)
64
61
 
65
- extractSubdirectory(packageFilePath)
62
+ extractSubdirectory(packageFilePath)
63
+ createGitignore(projectName)
66
64
 
67
- execSync(
68
- `cd ${projectName} && npm i && npm pkg set name=${projectName} ${
69
- projectDescription ? `description=${projectDescription}` : ""
70
- } && git init --quiet`,
71
- { stdio: "inherit" }
72
- )
65
+ execSync(
66
+ `cd ${projectName} && npm i && npm pkg set name=${projectName} ${projectDescription ? `description=${projectDescription}` : ""
67
+ } && git init --quiet`,
68
+ { stdio: "inherit" }
69
+ )
73
70
 
74
- console.log(cyan(`Installing Packages`))
71
+ console.log(cyan(`Installing Packages`))
75
72
 
76
- deleteDirectory(tempDir)
77
- } catch (error) {
78
- deleteDirectory(tempDir)
79
- console.error(`Error: ${error.message}`)
80
- process.exit(1)
81
- }
82
- })()
73
+ deleteDirectory(tempDir)
74
+ } catch (error) {
75
+ deleteDirectory(tempDir)
76
+ console.error(`Error: ${error.message}`)
77
+ process.exit(1)
78
+ }
79
+ })()
83
80
 
84
81
  function packNpmPackage(packageName, packageVersion, tempDir) {
85
82
  const tarballFileName = `${packageName}-${packageVersion}.tgz`
@@ -175,10 +172,10 @@ async function promptProjectName() {
175
172
  if (!res.path || projectName === "") {
176
173
  console.log(
177
174
  "\nPlease specify the project directory:\n" +
178
- ` ${cyan(program.name())} ${green("<project-directory>")}\n` +
179
- "For example:\n" +
180
- ` ${cyan(program.name())} ${green("my-next-app")}\n\n` +
181
- `Run ${cyan(`${program.name()} --help`)} to see all options.`
175
+ ` ${cyan(program.name())} ${green("<project-directory>")}\n` +
176
+ "For example:\n" +
177
+ ` ${cyan(program.name())} ${green("my-next-app")}\n\n` +
178
+ `Run ${cyan(`${program.name()} --help`)} to see all options.`
182
179
  )
183
180
  process.exit(1)
184
181
  }
@@ -221,3 +218,24 @@ function deleteDirectory(dirPath) {
221
218
  fs.rmdirSync(dirPath)
222
219
  }
223
220
  }
221
+
222
+ // Function to create a .gitignore file with the hardcoded patterns
223
+ function createGitignore(projectName) {
224
+
225
+ const gitiIgnorePatterns = [
226
+ 'node_modules/*',
227
+ 'build/*',
228
+ 'logs/*'
229
+ ];
230
+
231
+ const gitignorePath = path.join(process.cwd(), projectName, '.gitignore');
232
+
233
+ if (fs.existsSync(gitignorePath)) {
234
+ console.log('.gitignore already exists. Please rename or remove it before running the script.');
235
+ return;
236
+ }
237
+
238
+ fs.writeFileSync(gitignorePath, gitiIgnorePatterns.join('\n'));
239
+ }
240
+
241
+ // Create .gitignore with hardcoded patterns
@@ -21,7 +21,6 @@
21
21
  "NODE_ENV",
22
22
  "BUILD_ENV",
23
23
  "API_URL",
24
- "CLIENT_ENV_VARIABLES",
25
24
  "ANALYZE_BUNDLE",
26
25
  "ENABLE_DEBUG_LOGS",
27
26
  "ENABLE_FILE_LOGGING",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@loadable/component": "^5.16.3",
20
- "@tata1mg/router": "^0.0.1-alpha.13",
21
- "catalyst-core-internal": "0.0.1-beta.1"
20
+ "@tata1mg/router": "^0.0.1-beta.0",
21
+ "catalyst-core-internal": "^0.0.1-beta.2"
22
22
  }
23
23
  }
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@loadable/component": "^5.16.3",
20
- "@tata1mg/router": "^0.0.1-alpha.13",
21
- "catalyst-core-internal": "0.0.1-beta.1",
20
+ "@tata1mg/router": "^0.0.1-beta.0",
21
+ "catalyst-core-internal": "^0.0.1-beta.2",
22
22
  "@reduxjs/toolkit": "1.9.3",
23
23
  "react-redux": "^8.1.3"
24
24
  }
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@loadable/component": "^5.16.3",
20
- "@tata1mg/router": "^0.0.1-alpha.13",
21
- "catalyst-core-internal": "0.0.1-beta.1",
20
+ "@tata1mg/router": "^0.0.1-beta.0",
21
+ "catalyst-core-internal": "^0.0.1-beta.2",
22
22
  "@reduxjs/toolkit": "1.9.3",
23
23
  "react-redux": "^8.1.3"
24
24
  }
@@ -1,53 +0,0 @@
1
- {
2
- "parser": "@babel/eslint-parser",
3
- "rules": {
4
- "prettier/prettier": "error",
5
- "no-console": "warn",
6
- "react/prop-types": 1,
7
- "react/display-name": [0, { "ignoreTranspilerName": true }],
8
- "react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
9
- "no-prototype-builtins": "off",
10
- "jam3/no-sanitizer-with-danger": 2,
11
- "react/jsx-no-target-blank": [0, {
12
- "enforceDynamicLinks": "never"
13
- }]
14
- },
15
- "env": {
16
- "browser": true,
17
- "es6": true,
18
- "jest": true,
19
- "node": true
20
- },
21
- "globals": {
22
- "expect": true,
23
- "__non_webpack_require__": true,
24
- "logger": "readonly",
25
- "AppCallbacks": "readonly"
26
- },
27
- "extends": ["eslint:recommended", "plugin:react/recommended"],
28
- "parserOptions": {
29
- "sourceType": "module",
30
- "ecmaFeatures": {
31
- "experimentalObjectRestSpread": true,
32
- "jsx": true
33
- },
34
- "babelOptions": {
35
- "configFile": "./babel.config.js"
36
- },
37
- "ecmaVersion": 6
38
- },
39
- "plugins": ["babel", "react", "react-hooks", "prettier", "jam3"],
40
- "settings": {
41
- "react": {
42
- "createClass": "createReactClass",
43
- "pragma": "React",
44
- "version": "detect"
45
- },
46
- "propWrapperFunctions": [
47
- "forbidExtraProps",
48
- { "property": "freeze", "object": "Object" },
49
- { "property": "myFavoriteWrapper" }
50
- ],
51
- "linkComponents": ["Hyperlink", { "name": "Link", "linkAttribute": "to" }]
52
- }
53
- }
@@ -1,7 +0,0 @@
1
- {
2
- "trailingComma": "es5",
3
- "tabWidth": 4,
4
- "semi": false,
5
- "arrowParens": "always",
6
- "printWidth": 110
7
- }