@servicetitan/startup 28.4.0 → 28.5.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.
@@ -1,6 +1,4 @@
1
1
  import { CommandName } from '../../utils';
2
- import { Command } from './types';
3
- type Newable<T> = new (...args: any[]) => T;
2
+ import { Command, Newable } from './types';
4
3
  export declare function getCommand(name: CommandName): Newable<Command> | undefined;
5
- export {};
6
4
  //# sourceMappingURL=get-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/get-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,KAAK,OAAO,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAE5C,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CA+B1E"}
1
+ {"version":3,"file":"get-command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/get-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CA+B1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-command.js","sourceRoot":"","sources":["../../../src/cli/commands/get-command.ts"],"names":[],"mappings":";;AAoBA,gCA+BC;AAnDD,uCAA0C;AAE1C,mCAAgC;AAChC,qDAAiD;AACjD,qCAAyC;AACzC,iCAA8B;AAC9B,uCAAoC;AACpC,yDAAoD;AACpD,iCAA8B;AAC9B,2DAAsD;AACtD,+DAA0D;AAC1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AAsD;AACtD,+DAA0D;AAC1D,+CAA2C;AAC3C,uDAAmD;AACnD,mCAAgC;AAChC,iDAA6C;AAC7C,mCAAgC;AAGhC,SAAgB,UAAU,CAAC,IAAiB;IACxC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,mBAAW,CAAC,KAAK;YAClB,OAAO,aAAK,CAAC;QACjB,KAAK,mBAAW,CAAC,gBAAgB,CAAC;YAC9B,OAAO,8BAAa,CAAC;QACzB,KAAK,mBAAW,CAAC,MAAM;YACnB,OAAO,sBAAa,CAAC;QACzB,KAAK,mBAAW,CAAC,IAAI;YACjB,OAAO,WAAI,CAAC;QAChB,KAAK,mBAAW,CAAC,OAAO;YACpB,OAAO,iBAAO,CAAC;QACnB,KAAK,mBAAW,CAAC,kBAAkB,CAAC;YAChC,OAAO,iCAAc,CAAC;QAC1B,KAAK,mBAAW,CAAC,IAAI;YACjB,OAAO,WAAI,CAAC;QAChB,KAAK,mBAAW,CAAC,mBAAmB,CAAC;YACjC,OAAO,mCAAe,CAAC;QAC3B,KAAK,mBAAW,CAAC,qBAAqB,CAAC;YACnC,OAAO,uCAAiB,CAAC;QAC7B,KAAK,mBAAW,CAAC,aAAa,CAAC;YAC3B,OAAO,wBAAU,CAAC;QACtB,KAAK,mBAAW,CAAC,iBAAiB,CAAC;YAC/B,OAAO,gCAAc,CAAC;QAC1B,KAAK,mBAAW,CAAC,KAAK;YAClB,OAAO,aAAK,CAAC;QACjB,KAAK,mBAAW,CAAC,cAAc,CAAC;YAC5B,OAAO,0BAAW,CAAC;QACvB,KAAK,mBAAW,CAAC,IAAI;YACjB,OAAO,aAAK,CAAC;IACrB,CAAC;AACL,CAAC"}
@@ -2,4 +2,5 @@ export interface Command {
2
2
  execute(): Promise<void>;
3
3
  description(): string | undefined;
4
4
  }
5
+ export type Newable<T> = new (...args: any[]) => T;
5
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;CACrC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC"}
package/dist/cli/index.js CHANGED
@@ -23,7 +23,7 @@ if (!Command) {
23
23
  usage();
24
24
  process.exit(127);
25
25
  }
26
- (0, maybe_create_git_folder_1.maybeCreateGitFolder)();
26
+ (0, maybe_create_git_folder_1.maybeCreateGitFolder)(Command);
27
27
  if ((0, utils_2.setNodeOptions)(name)) {
28
28
  // Run command in child process with amended NODE_OPTIONS
29
29
  (0, execa_1.default)(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iCAAwC;AACxC,oCAA+D;AAC/D,yCAAyD;AACzD,mCAAyC;AACzC,6EAAuE;AAEvE,MAAM,QAAQ,GAAG,YAAiB,CAAC;AACnC,MAAM,IAAI,GAAG,MAAA,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,0CAAE,QAAQ,EAAiB,CAAC;AACtD,IAAI,CAAC,IAAI,EAAE,CAAC;IACR,WAAG,CAAC,IAAI,CAAC,gBAAgB,IAAA,yBAAiB,GAAE,EAAE,CAAC,CAAC;IAChD,KAAK,EAAE,CAAC;IACR,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAA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,CAAC;AACP,CAAC;AAED,SAAS,KAAK,CAAC,IAAY;IACvB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,iCAAiC;AAChE,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { Command, Newable } from '../commands/types';
1
2
  /**
2
3
  * Create empty .git folder to workaround issue where Lerna does not
3
4
  * detect workspace packages on Windows systems. The empty .git folder
@@ -6,5 +7,5 @@
6
7
  * keeps reappearing (e.g., https://github.com/nrwl/nx/issues/9584 and
7
8
  * https://github.com/nrwl/nx/issues/18094)
8
9
  */
9
- export declare function maybeCreateGitFolder(): void;
10
+ export declare function maybeCreateGitFolder(command: Newable<Command>): void;
10
11
  //# sourceMappingURL=maybe-create-git-folder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-create-git-folder.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/maybe-create-git-folder.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,SAOnC"}
1
+ {"version":3,"file":"maybe-create-git-folder.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/maybe-create-git-folder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAU7D"}
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.maybeCreateGitFolder = maybeCreateGitFolder;
7
7
  const fs_1 = __importDefault(require("fs"));
8
+ const init_1 = require("../commands/init");
8
9
  /**
9
10
  * Create empty .git folder to workaround issue where Lerna does not
10
11
  * detect workspace packages on Windows systems. The empty .git folder
@@ -13,10 +14,13 @@ const fs_1 = __importDefault(require("fs"));
13
14
  * keeps reappearing (e.g., https://github.com/nrwl/nx/issues/9584 and
14
15
  * https://github.com/nrwl/nx/issues/18094)
15
16
  */
16
- function maybeCreateGitFolder() {
17
+ function maybeCreateGitFolder(command) {
17
18
  if (process.platform !== 'win32') {
18
19
  return;
19
20
  }
21
+ if (command === init_1.Init) {
22
+ return;
23
+ }
20
24
  if (!fs_1.default.existsSync('.git')) {
21
25
  fs_1.default.mkdirSync('.git');
22
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-create-git-folder.js","sourceRoot":"","sources":["../../../src/cli/utils/maybe-create-git-folder.ts"],"names":[],"mappings":";;;;;AAUA,oDAOC;AAjBD,4CAAoB;AAEpB;;;;;;;GAOG;AACH,SAAgB,oBAAoB;IAChC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO;IACX,CAAC;IACD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,YAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"maybe-create-git-folder.js","sourceRoot":"","sources":["../../../src/cli/utils/maybe-create-git-folder.ts"],"names":[],"mappings":";;;;;AAaA,oDAUC;AAvBD,4CAAoB;AAEpB,2CAAwC;AAGxC;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,OAAyB;IAC1D,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO;IACX,CAAC;IACD,IAAI,OAAO,KAAK,WAAI,EAAE,CAAC;QACnB,OAAO;IACX,CAAC;IACD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,YAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup",
3
- "version": "28.4.0",
3
+ "version": "28.5.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/startup",
6
6
  "repository": {
@@ -32,8 +32,8 @@
32
32
  "@jest/core": "~29.7.0",
33
33
  "@jest/types": "~29.6.3",
34
34
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
35
- "@servicetitan/eslint-config": "28.4.0",
36
- "@servicetitan/stylelint-config": "28.4.0",
35
+ "@servicetitan/eslint-config": "28.5.0",
36
+ "@servicetitan/stylelint-config": "28.5.0",
37
37
  "@svgr/webpack": "^8.1.0",
38
38
  "@swc/core": "1.10.7",
39
39
  "@types/debug": "^4.1.12",
@@ -45,7 +45,7 @@
45
45
  "css-minimizer-webpack-plugin": "^7.0.0",
46
46
  "debug": "^4.4.0",
47
47
  "deepmerge": "~4.3.1",
48
- "esbuild-loader": "~4.2.2",
48
+ "esbuild-loader": "~4.3.0",
49
49
  "eslint": "~8.57.0",
50
50
  "execa": "~5.1.1",
51
51
  "fork-ts-checker-webpack-plugin": "~9.0.2",
@@ -67,9 +67,9 @@
67
67
  "moment-locales-webpack-plugin": "~1.2.0",
68
68
  "multimatch": "~5.0.0",
69
69
  "portfinder": "~1.0.32",
70
- "postcss": "~8.5.1",
70
+ "postcss": "~8.5.2",
71
71
  "prettier": "~3.4.2",
72
- "sass": "~1.83.4",
72
+ "sass": "~1.84.0",
73
73
  "sass-loader": "~16.0.4",
74
74
  "source-map-loader": "~5.0.0",
75
75
  "style-loader": "~4.0.0",
@@ -102,5 +102,5 @@
102
102
  "cli": {
103
103
  "webpack": false
104
104
  },
105
- "gitHead": "051b5b2f70ae6be345aa08ffdd49d8c049272940"
105
+ "gitHead": "580ace3d4bce0472e985b1d4eb5e98e0be625f1d"
106
106
  }
@@ -14,9 +14,7 @@ import { PreparePackage } from './prepare-package';
14
14
  import { Start } from './start';
15
15
  import { StylesCheck } from './styles-check';
16
16
  import { Tests } from './tests';
17
- import { Command } from './types';
18
-
19
- type Newable<T> = new (...args: any[]) => T;
17
+ import { Command, Newable } from './types';
20
18
 
21
19
  export function getCommand(name: CommandName): Newable<Command> | undefined {
22
20
  switch (name) {
@@ -2,3 +2,5 @@ export interface Command {
2
2
  execute(): Promise<void>;
3
3
  description(): string | undefined;
4
4
  }
5
+
6
+ export type Newable<T> = new (...args: any[]) => T;
package/src/cli/index.ts CHANGED
@@ -20,7 +20,7 @@ if (!Command) {
20
20
  process.exit(127);
21
21
  }
22
22
 
23
- maybeCreateGitFolder();
23
+ maybeCreateGitFolder(Command);
24
24
 
25
25
  if (setNodeOptions(name)) {
26
26
  // Run command in child process with amended NODE_OPTIONS
@@ -1,18 +1,32 @@
1
1
  import { fs, vol } from 'memfs';
2
2
 
3
3
  import { maybeCreateGitFolder } from '../maybe-create-git-folder';
4
+ import { Init } from '../../commands/init';
5
+ import { Start } from '../../commands/start';
4
6
 
5
7
  jest.mock('fs', () => fs);
6
8
 
7
9
  describe(`[startup] Utils`, () => {
8
10
  describe(`${maybeCreateGitFolder.name}`, () => {
11
+ let command: Parameters<typeof maybeCreateGitFolder>[0];
9
12
  const mkdirSpy = jest.spyOn(fs, 'mkdirSync').mockImplementation(jest.fn());
10
13
 
11
- beforeEach(() => vol.fromJSON({}));
14
+ beforeEach(() => {
15
+ command = Start;
16
+ vol.fromJSON({});
17
+ });
12
18
 
13
19
  afterEach(() => vol.reset);
14
20
 
15
- const subject = () => maybeCreateGitFolder();
21
+ const subject = () => maybeCreateGitFolder(command);
22
+
23
+ function itDoesNotCreateGitFolder() {
24
+ test('does not create .git folder', () => {
25
+ subject();
26
+
27
+ expect(mkdirSpy).not.toHaveBeenCalledWith();
28
+ });
29
+ }
16
30
 
17
31
  describe('when running on Windows', () => {
18
32
  beforeEach(() => {
@@ -24,6 +38,12 @@ describe(`[startup] Utils`, () => {
24
38
 
25
39
  expect(mkdirSpy).toHaveBeenCalledWith('.git');
26
40
  });
41
+
42
+ describe('when command is Init', () => {
43
+ beforeEach(() => (command = Init));
44
+
45
+ itDoesNotCreateGitFolder();
46
+ });
27
47
  });
28
48
 
29
49
  describe('when not running on Windows', () => {
@@ -31,11 +51,7 @@ describe(`[startup] Utils`, () => {
31
51
  Object.defineProperty(process, 'platform', { value: 'linux' });
32
52
  });
33
53
 
34
- test('does not create .git folder', () => {
35
- subject();
36
-
37
- expect(mkdirSpy).not.toHaveBeenCalledWith();
38
- });
54
+ itDoesNotCreateGitFolder();
39
55
  });
40
56
  });
41
57
  });
@@ -1,5 +1,8 @@
1
1
  import fs from 'fs';
2
2
 
3
+ import { Init } from '../commands/init';
4
+ import { Command, Newable } from '../commands/types';
5
+
3
6
  /**
4
7
  * Create empty .git folder to workaround issue where Lerna does not
5
8
  * detect workspace packages on Windows systems. The empty .git folder
@@ -8,10 +11,13 @@ import fs from 'fs';
8
11
  * keeps reappearing (e.g., https://github.com/nrwl/nx/issues/9584 and
9
12
  * https://github.com/nrwl/nx/issues/18094)
10
13
  */
11
- export function maybeCreateGitFolder() {
14
+ export function maybeCreateGitFolder(command: Newable<Command>) {
12
15
  if (process.platform !== 'win32') {
13
16
  return;
14
17
  }
18
+ if (command === Init) {
19
+ return;
20
+ }
15
21
  if (!fs.existsSync('.git')) {
16
22
  fs.mkdirSync('.git');
17
23
  }