@mschauer5/spfx-toolkit 1.0.27 → 1.0.28

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 (52) hide show
  1. package/.vscode/settings.json +22 -22
  2. package/LICENSE +21 -21
  3. package/README.md +72 -72
  4. package/lib/common/util.js +2 -1
  5. package/lib/common/util.js.map +1 -1
  6. package/package.json +3 -2
  7. package/src/commands/env.commands.ts +63 -63
  8. package/src/commands/index.ts +12 -12
  9. package/src/commands/installer.command.ts +134 -134
  10. package/src/commands/nvmrc.command.ts +76 -76
  11. package/src/commands/projects.command.ts +37 -37
  12. package/src/commands/repo.command.ts +206 -206
  13. package/src/commands/scripts.command.ts +139 -139
  14. package/src/common/index.ts +5 -5
  15. package/src/common/util.ts +114 -113
  16. package/src/index.ts +261 -261
  17. package/lib/commands/install.command.js +0 -28
  18. package/lib/commands/install.command.js.map +0 -1
  19. package/lib/commands/open-solution.command.js +0 -30
  20. package/lib/commands/open-solution.command.js.map +0 -1
  21. package/lib/commands/serve.command.js +0 -27
  22. package/lib/commands/serve.command.js.map +0 -1
  23. package/lib/commands/settings.js +0 -68
  24. package/lib/commands/settings.js.map +0 -1
  25. package/lib/package.json +0 -45
  26. package/lib/src/commands/alias.command.js +0 -104
  27. package/lib/src/commands/alias.command.js.map +0 -1
  28. package/lib/src/commands/build.command.js +0 -61
  29. package/lib/src/commands/build.command.js.map +0 -1
  30. package/lib/src/commands/bundle.command.js +0 -70
  31. package/lib/src/commands/bundle.command.js.map +0 -1
  32. package/lib/src/commands/eslint.command.js +0 -34
  33. package/lib/src/commands/eslint.command.js.map +0 -1
  34. package/lib/src/commands/index.js +0 -49
  35. package/lib/src/commands/index.js.map +0 -1
  36. package/lib/src/commands/serve.command.js +0 -27
  37. package/lib/src/commands/serve.command.js.map +0 -1
  38. package/lib/src/commands/version.command.js +0 -98
  39. package/lib/src/commands/version.command.js.map +0 -1
  40. package/lib/src/common/constants.js +0 -10
  41. package/lib/src/common/constants.js.map +0 -1
  42. package/lib/src/common/index.js +0 -43
  43. package/lib/src/common/index.js.map +0 -1
  44. package/lib/src/common/logger.js +0 -42
  45. package/lib/src/common/logger.js.map +0 -1
  46. package/lib/src/common/util.js +0 -80
  47. package/lib/src/common/util.js.map +0 -1
  48. package/lib/src/index.js +0 -146
  49. package/lib/src/index.js.map +0 -1
  50. package/lib/test/index.test.js +0 -17
  51. package/lib/test/index.test.js.map +0 -1
  52. package/mschauer5-spfx-toolkit-1.0.25.tgz +0 -0
@@ -1,22 +1,22 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.activeBackground": "#3399ff",
4
- "activityBar.background": "#3399ff",
5
- "activityBar.foreground": "#15202b",
6
- "activityBar.inactiveForeground": "#15202b99",
7
- "activityBarBadge.background": "#bf0060",
8
- "activityBarBadge.foreground": "#e7e7e7",
9
- "commandCenter.border": "#e7e7e799",
10
- "sash.hoverBorder": "#3399ff",
11
- "statusBar.background": "#007fff",
12
- "statusBar.foreground": "#e7e7e7",
13
- "statusBarItem.hoverBackground": "#3399ff",
14
- "statusBarItem.remoteBackground": "#007fff",
15
- "statusBarItem.remoteForeground": "#e7e7e7",
16
- "titleBar.activeBackground": "#007fff",
17
- "titleBar.activeForeground": "#e7e7e7",
18
- "titleBar.inactiveBackground": "#007fff99",
19
- "titleBar.inactiveForeground": "#e7e7e799"
20
- },
21
- "peacock.color": "#007fff"
22
- }
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "activityBar.activeBackground": "#3399ff",
4
+ "activityBar.background": "#3399ff",
5
+ "activityBar.foreground": "#15202b",
6
+ "activityBar.inactiveForeground": "#15202b99",
7
+ "activityBarBadge.background": "#bf0060",
8
+ "activityBarBadge.foreground": "#e7e7e7",
9
+ "commandCenter.border": "#e7e7e799",
10
+ "sash.hoverBorder": "#3399ff",
11
+ "statusBar.background": "#007fff",
12
+ "statusBar.foreground": "#e7e7e7",
13
+ "statusBarItem.hoverBackground": "#3399ff",
14
+ "statusBarItem.remoteBackground": "#007fff",
15
+ "statusBarItem.remoteForeground": "#e7e7e7",
16
+ "titleBar.activeBackground": "#007fff",
17
+ "titleBar.activeForeground": "#e7e7e7",
18
+ "titleBar.inactiveBackground": "#007fff99",
19
+ "titleBar.inactiveForeground": "#e7e7e799"
20
+ },
21
+ "peacock.color": "#007fff"
22
+ }
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Matt Schauer
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Matt Schauer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,72 +1,72 @@
1
- # SPFx Toolkit
2
-
3
- A CLI toolkit to help with SharePoint Framework (SPFx) project development, supporting both classic (gulp) and modern (Heft) build systems.
4
-
5
- ## Features
6
-
7
- - Add and clear shell aliases for the toolkit
8
- - Build and bundle SPFx projects (auto-detects Gulp or Heft)
9
- - Serve/start the SPFx dev server
10
- - Backup and restore ESLint config
11
- - Version management for SPFx projects
12
-
13
- ## Installation
14
-
15
- ```sh
16
- npm install -g @mschauer5/spfx-toolkit
17
- ```
18
-
19
- ## Usage
20
-
21
- After installation, run:
22
-
23
- ```sh
24
- spfx-toolkit --help
25
- ```
26
-
27
- ### Common Commands
28
-
29
- - `spfx-toolkit build` — Build the project (auto-detects Gulp or Heft)
30
- - `spfx-toolkit bundle [--increment <part>]` — Bundle the project (auto-detects Gulp or Heft, optionally increment version)
31
- - `spfx-toolkit serve` — Start the SPFx dev server
32
- - `spfx-toolkit add-alias <name>` — Add a shell alias for the toolkit
33
- - `spfx-toolkit clear-alias` — Remove the shell alias for the toolkit
34
- - `spfx-toolkit run <name>` — Run a script from package.json by name
35
- - `spfx-toolkit open-global-config` — Open the global package.json for toolkit scripts in VS Code
36
- - `spfx-toolkit global-config-init [--force]` — Initialize global package.json with default scripts (use --force to overwrite)
37
- - `spfx-toolkit sync-script <name> <global|local>` — Sync a script name between global and local package.json
38
- - `spfx-toolkit open-solution` — Open the solution folder in VS Code
39
- - `spfx-toolkit set-heft-dotenv-plugin` — Installs and configures dotenv plugin for Heft
40
- - `spfx-toolkit eslint --backup|--restore` — Backup or restore ESLint config
41
- - `spfx-toolkit version --list|--sync|--increment <part>` — Version management
42
-
43
- ## Example
44
-
45
- ```sh
46
- spfx-toolkit build
47
- spfx-toolkit bundle
48
- spfx-toolkit serve
49
- spfx-toolkit add-alias st
50
- spfx-toolkit clear-alias
51
- ```
52
-
53
- ## Requirements
54
-
55
- - Node.js 18+
56
- - For SPFx 1.22+ projects, Heft must be installed in your project
57
- - For older SPFx projects, Gulp must be installed
58
- - npm install -g @rushstack/heft to run heft commands from this tool
59
-
60
- ## License
61
-
62
- MIT
63
-
64
- ---
65
-
66
- **Disclaimer:**
67
-
68
- This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
69
-
70
- ---
71
-
72
- Developed by Matt Schauer
1
+ # SPFx Toolkit
2
+
3
+ A CLI toolkit to help with SharePoint Framework (SPFx) project development, supporting both classic (gulp) and modern (Heft) build systems.
4
+
5
+ ## Features
6
+
7
+ - Add and clear shell aliases for the toolkit
8
+ - Build and bundle SPFx projects (auto-detects Gulp or Heft)
9
+ - Serve/start the SPFx dev server
10
+ - Backup and restore ESLint config
11
+ - Version management for SPFx projects
12
+
13
+ ## Installation
14
+
15
+ ```sh
16
+ npm install -g @mschauer5/spfx-toolkit
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ After installation, run:
22
+
23
+ ```sh
24
+ spfx-toolkit --help
25
+ ```
26
+
27
+ ### Common Commands
28
+
29
+ - `spfx-toolkit build` — Build the project (auto-detects Gulp or Heft)
30
+ - `spfx-toolkit bundle [--increment <part>]` — Bundle the project (auto-detects Gulp or Heft, optionally increment version)
31
+ - `spfx-toolkit serve` — Start the SPFx dev server
32
+ - `spfx-toolkit add-alias <name>` — Add a shell alias for the toolkit
33
+ - `spfx-toolkit clear-alias` — Remove the shell alias for the toolkit
34
+ - `spfx-toolkit run <name>` — Run a script from package.json by name
35
+ - `spfx-toolkit open-global-config` — Open the global package.json for toolkit scripts in VS Code
36
+ - `spfx-toolkit global-config-init [--force]` — Initialize global package.json with default scripts (use --force to overwrite)
37
+ - `spfx-toolkit sync-script <name> <global|local>` — Sync a script name between global and local package.json
38
+ - `spfx-toolkit open-solution` — Open the solution folder in VS Code
39
+ - `spfx-toolkit set-heft-dotenv-plugin` — Installs and configures dotenv plugin for Heft
40
+ - `spfx-toolkit eslint --backup|--restore` — Backup or restore ESLint config
41
+ - `spfx-toolkit version --list|--sync|--increment <part>` — Version management
42
+
43
+ ## Example
44
+
45
+ ```sh
46
+ spfx-toolkit build
47
+ spfx-toolkit bundle
48
+ spfx-toolkit serve
49
+ spfx-toolkit add-alias st
50
+ spfx-toolkit clear-alias
51
+ ```
52
+
53
+ ## Requirements
54
+
55
+ - Node.js 18+
56
+ - For SPFx 1.22+ projects, Heft must be installed in your project
57
+ - For older SPFx projects, Gulp must be installed
58
+ - npm install -g @rushstack/heft to run heft commands from this tool
59
+
60
+ ## License
61
+
62
+ MIT
63
+
64
+ ---
65
+
66
+ **Disclaimer:**
67
+
68
+ This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
69
+
70
+ ---
71
+
72
+ Developed by Matt Schauer
@@ -51,6 +51,7 @@ function ensureGlobalPackageJsonExists() {
51
51
  const { configDir, configPath } = getGlobalConfigPaths();
52
52
  const exists = yield checkIfFileExistsAsync(configPath, false);
53
53
  if (!exists) {
54
+ logger_1.logger.info('Global package.json for spfx-toolkit not found. Creating one...');
54
55
  // Create the directory if it doesn't exist and then create an empty package.json
55
56
  yield fs_1.promises.mkdir(configDir, { recursive: true });
56
57
  yield fs_1.promises.writeFile(configPath, JSON.stringify({ scripts: {} }, null, 2), 'utf-8');
@@ -72,7 +73,7 @@ function openGlobalPackageJsonInEditor() {
72
73
  function initGlobalPackageJsonWithDefaults(force) {
73
74
  return __awaiter(this, void 0, void 0, function* () {
74
75
  const { configPath } = getGlobalConfigPaths();
75
- ensureGlobalPackageJsonExists();
76
+ yield ensureGlobalPackageJsonExists();
76
77
  const defaultScripts = {
77
78
  'build:gulp': 'gulp build',
78
79
  'build:heft': 'heft build',
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,wDASC;AAED,oDAKC;AAED,kCAGC;AAED,sEAWC;AAED,sEAUC;AAED,8EAiDC;AAvGD,2BAA4C;AAC5C,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,qCAAkC;AAElC,SAAsB,sBAAsB;yDAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;QACxE,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,IAAI,YAAY,EAAE,CAAC;gBACjB,eAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,SAAS,CAAC,CAAC;YACxC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAED,SAAgB,oBAAoB;IAClC,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,eAAe,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAExD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACnC,CAAC;AAED,SAAsB,WAAW;;QAC/B,M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AI,EAAE,CAAC;QAClD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;YAC3D,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC5C,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpC,CAAC;QACH,CAAC;QAED,MAAM,aAAU,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACtF,eAAM,CAAC,OAAO,CAAC,sCAAsC,UAAU,EAAE,CAAC,CAAC;IACrE,CAAC;CAAA;AAEM,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;IAC7C,yCAAyC;IACzC,KAAK,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE;QACrE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,qBAAqB,yBAOhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschauer5/spfx-toolkit",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Toolkit for SPFx projects",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -13,13 +13,14 @@
13
13
  "test:clear-alias": "npm run build && node lib/index.js clear-alias",
14
14
  "test:serve": "npm run build && node lib/index.js serve",
15
15
  "test:build": "npm run build && node lib/index.js build",
16
- "test:configInit": "npm run build && node lib/index.js ogci",
16
+ "test:ogci": "npm run build && node lib/index.js ogci",
17
17
  "test:addProject": "npm run build && node lib/index.js add-project",
18
18
  "test:openProject": "npm run build && node lib/index.js open-project admin-links",
19
19
  "test:od": "npm run build && node lib/index.js od",
20
20
  "test:vs": "npm run build && node lib/index.js vs",
21
21
  "push": "npm run build && npm publish --access public",
22
22
  "test:env": "npm run build && node lib/index.js set-env",
23
+ "package": "npm run build && npm pack .",
23
24
  "prepublish": "npm run build && npm uninstall .\\mschauer5-spfx-toolkit-1.0.27.tgz -g && npm pack . && npm install .\\mschauer5-spfx-toolkit-1.0.27.tgz -g"
24
25
  },
25
26
  "repository": {
@@ -1,63 +1,63 @@
1
- import { logger } from '../common/logger';
2
- var readlineSync = require('readline-sync');
3
-
4
- export const setEnv = async (tenantDomain?: string) => {
5
- const lines = [];
6
-
7
- let td = tenantDomain;
8
-
9
- // if tenantDomain is provided, set it in the .env file
10
- if (!tenantDomain) {
11
- // check env variable first
12
- if (process.env['SPFX_SERVE_TENANT_DOMAIN']) {
13
- // if they want to use this env variable
14
-
15
- // add default of yes
16
- const inputDomain = readlineSync.question(
17
- `Do you want to use global tenant domain of ${process.env['SPFX_SERVE_TENANT_DOMAIN']}? (yes/no) : Default is 'yes' `
18
- );
19
- if (inputDomain.toLowerCase() === 'yes' || inputDomain.toLowerCase() === 'y' || inputDomain === '') {
20
- td = `${process.env['SPFX_SERVE_TENANT_DOMAIN']}`;
21
- } else {
22
- td = undefined;
23
- }
24
- }
25
- }
26
-
27
- if (td) {
28
- if (td.startsWith('https://')) {
29
- td = td.replace('https://', '');
30
- }
31
- } else {
32
- // otherwise, prompt the user for it
33
-
34
- const inputDomain = readlineSync.question('Enter the tenant domain (e.g., contoso.sharepoint.com): ');
35
- td = inputDomain;
36
- }
37
- td = `tenantDomain=${td}`;
38
-
39
- lines.push(td);
40
-
41
- // if file exists, read existing lines except tenantDomain
42
- const fsPromises = require('fs').promises;
43
- const path = require('path');
44
- const envFilePath = path.join(process.cwd(), '.env');
45
- const fileExists = require('fs').existsSync(envFilePath);
46
- if (fileExists) {
47
- const existingContent = await fsPromises.readFile(envFilePath, 'utf-8');
48
- const existingLines = existingContent.split(/\r?\n/);
49
- for (const line of existingLines) {
50
- if (!line.startsWith('tenantDomain=')) {
51
- lines.push(line);
52
- }
53
- }
54
-
55
- const fs = require('fs');
56
- fs.writeFileSync('.env', lines.join('\n'), { encoding: 'utf-8' });
57
- logger.success(`.env file updated with: ${lines.join('\n')}`);
58
- } else {
59
- const fs = require('fs');
60
- fs.writeFileSync('.env', lines.join('\n'), { encoding: 'utf-8' });
61
- logger.success(`.env file created with: ${lines.join('\n')}`);
62
- }
63
- };
1
+ import { logger } from '../common/logger';
2
+ var readlineSync = require('readline-sync');
3
+
4
+ export const setEnv = async (tenantDomain?: string) => {
5
+ const lines = [];
6
+
7
+ let td = tenantDomain;
8
+
9
+ // if tenantDomain is provided, set it in the .env file
10
+ if (!tenantDomain) {
11
+ // check env variable first
12
+ if (process.env['SPFX_SERVE_TENANT_DOMAIN']) {
13
+ // if they want to use this env variable
14
+
15
+ // add default of yes
16
+ const inputDomain = readlineSync.question(
17
+ `Do you want to use global tenant domain of ${process.env['SPFX_SERVE_TENANT_DOMAIN']}? (yes/no) : Default is 'yes' `
18
+ );
19
+ if (inputDomain.toLowerCase() === 'yes' || inputDomain.toLowerCase() === 'y' || inputDomain === '') {
20
+ td = `${process.env['SPFX_SERVE_TENANT_DOMAIN']}`;
21
+ } else {
22
+ td = undefined;
23
+ }
24
+ }
25
+ }
26
+
27
+ if (td) {
28
+ if (td.startsWith('https://')) {
29
+ td = td.replace('https://', '');
30
+ }
31
+ } else {
32
+ // otherwise, prompt the user for it
33
+
34
+ const inputDomain = readlineSync.question('Enter the tenant domain (e.g., contoso.sharepoint.com): ');
35
+ td = inputDomain;
36
+ }
37
+ td = `tenantDomain=${td}`;
38
+
39
+ lines.push(td);
40
+
41
+ // if file exists, read existing lines except tenantDomain
42
+ const fsPromises = require('fs').promises;
43
+ const path = require('path');
44
+ const envFilePath = path.join(process.cwd(), '.env');
45
+ const fileExists = require('fs').existsSync(envFilePath);
46
+ if (fileExists) {
47
+ const existingContent = await fsPromises.readFile(envFilePath, 'utf-8');
48
+ const existingLines = existingContent.split(/\r?\n/);
49
+ for (const line of existingLines) {
50
+ if (!line.startsWith('tenantDomain=')) {
51
+ lines.push(line);
52
+ }
53
+ }
54
+
55
+ const fs = require('fs');
56
+ fs.writeFileSync('.env', lines.join('\n'), { encoding: 'utf-8' });
57
+ logger.success(`.env file updated with: ${lines.join('\n')}`);
58
+ } else {
59
+ const fs = require('fs');
60
+ fs.writeFileSync('.env', lines.join('\n'), { encoding: 'utf-8' });
61
+ logger.success(`.env file created with: ${lines.join('\n')}`);
62
+ }
63
+ };
@@ -1,12 +1,12 @@
1
- import * as alias from './alias.command';
2
- import * as eslint from './eslint.command';
3
- import * as version from './version.command';
4
- import * as scripts from './scripts.command';
5
- import * as open from './open.command';
6
- import * as installer from './installer.command';
7
- import * as nvmrc from './nvmrc.command';
8
- import * as envCommands from './env.commands';
9
- import * as repo from './repo.command';
10
- import * as projects from './projects.command';
11
-
12
- export { alias, eslint as env, version, scripts, open, installer, nvmrc, envCommands, repo, projects };
1
+ import * as alias from './alias.command';
2
+ import * as eslint from './eslint.command';
3
+ import * as version from './version.command';
4
+ import * as scripts from './scripts.command';
5
+ import * as open from './open.command';
6
+ import * as installer from './installer.command';
7
+ import * as nvmrc from './nvmrc.command';
8
+ import * as envCommands from './env.commands';
9
+ import * as repo from './repo.command';
10
+ import * as projects from './projects.command';
11
+
12
+ export { alias, eslint as env, version, scripts, open, installer, nvmrc, envCommands, repo, projects };