@atlaspack/cli 2.14.17-dev-compiled-hash-e5f8a1735.0 → 2.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @atlaspack/cli
2
2
 
3
+ ## 2.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#892](https://github.com/atlassian-labs/atlaspack/pull/892) [`617a318`](https://github.com/atlassian-labs/atlaspack/commit/617a318ddc9419b38360257353fec50b9051ee13) Thanks [@marcins](https://github.com/marcins)! - Added a new `shouldProfileNative` option that provides a way to pause and connect a native profiler to Atlaspack.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`7dd5bd8`](https://github.com/atlassian-labs/atlaspack/commit/7dd5bd89ff60c7b324347d772729eb4c3314f01e), [`8eb84ee`](https://github.com/atlassian-labs/atlaspack/commit/8eb84ee61a42bfe87c58079b610802b07a6a13e4), [`73168c2`](https://github.com/atlassian-labs/atlaspack/commit/73168c275a5d9abff9907bcf536b340bca1ed5f0), [`617a318`](https://github.com/atlassian-labs/atlaspack/commit/617a318ddc9419b38360257353fec50b9051ee13)]:
12
+ - @atlaspack/core@2.28.0
13
+ - @atlaspack/feature-flags@2.27.0
14
+ - @atlaspack/utils@3.2.0
15
+ - @atlaspack/config-default@9.0.0
16
+ - @atlaspack/fs@2.15.34
17
+ - @atlaspack/logger@2.14.31
18
+ - @atlaspack/reporter-cli@2.17.21
19
+ - @atlaspack/package-manager@2.14.39
20
+ - @atlaspack/reporter-dev-server@2.14.39
21
+ - @atlaspack/reporter-tracer@2.14.39
22
+
23
+ ## 2.14.17
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`ec3abe4`](https://github.com/atlassian-labs/atlaspack/commit/ec3abe4dffc98560a850fd2f71fb566577e6c99c), [`c7fe3f7`](https://github.com/atlassian-labs/atlaspack/commit/c7fe3f76f247e9e20299e205e2df0a16c418eaf2), [`cfb4707`](https://github.com/atlassian-labs/atlaspack/commit/cfb4707087498e4fa4dcf10753fe984a248d196b), [`33d4c26`](https://github.com/atlassian-labs/atlaspack/commit/33d4c261ceb8d585d56b0a446ed6e28cf7f1126d), [`f31b041`](https://github.com/atlassian-labs/atlaspack/commit/f31b04107e9077c9946aadb99f6f91bb69703bb7), [`8180981`](https://github.com/atlassian-labs/atlaspack/commit/8180981be14c00f9570adb70d3f350bd91d6ec0a), [`119210b`](https://github.com/atlassian-labs/atlaspack/commit/119210b597eb993c50445df87a36b70bd49cd414), [`7d7a55d`](https://github.com/atlassian-labs/atlaspack/commit/7d7a55dd6395ec391a2e4c33b3dec0d1ea477d4c)]:
28
+ - @atlaspack/feature-flags@2.26.2
29
+ - @atlaspack/core@2.27.0
30
+ - @atlaspack/utils@3.1.2
31
+ - @atlaspack/fs@2.15.33
32
+ - @atlaspack/reporter-cli@2.17.20
33
+ - @atlaspack/config-default@8.0.0
34
+ - @atlaspack/logger@2.14.30
35
+ - @atlaspack/package-manager@2.14.38
36
+ - @atlaspack/reporter-dev-server@2.14.38
37
+ - @atlaspack/reporter-tracer@2.14.38
38
+
3
39
  ## 2.14.16
4
40
 
5
41
  ### Patch Changes
@@ -13,7 +13,6 @@ const normalizeOptions_1 = require("./normalizeOptions");
13
13
  const applyOptions_1 = require("./applyOptions");
14
14
  const options_1 = require("./options");
15
15
  const handleUncaughtException_1 = require("./handleUncaughtException");
16
- const compareCompiledCommand_1 = require("./compareCompiledCommand");
17
16
  function makeDebugCommand() {
18
17
  const debug = new commander_1.default.Command('debug').description('Debug commands for atlaspack');
19
18
  const getInstance = async (args, opts, command) => {
@@ -95,6 +94,5 @@ function makeDebugCommand() {
95
94
  }
96
95
  });
97
96
  (0, applyOptions_1.applyOptions)(compactCache, options_1.commonOptions);
98
- debug.addCommand((0, compareCompiledCommand_1.makeCompareCompiledCommand)());
99
97
  return debug;
100
98
  }
@@ -8,6 +8,7 @@ const diagnostic_1 = __importDefault(require("@atlaspack/diagnostic"));
8
8
  const get_port_1 = __importDefault(require("get-port"));
9
9
  const logger_1 = require("@atlaspack/logger");
10
10
  const path_1 = __importDefault(require("path"));
11
+ const os_1 = __importDefault(require("os"));
11
12
  function parsePort(portValue) {
12
13
  let parsedPort = Number(portValue);
13
14
  // Throw an error if port value is invalid...
@@ -114,6 +115,22 @@ async function normalizeOptions(command, inputFS) {
114
115
  return [];
115
116
  return input.split(',').map((value) => value.trim());
116
117
  };
118
+ let nativeProfiler;
119
+ if (typeof command.profileNative === 'string') {
120
+ if (command.profileNative === 'instruments' ||
121
+ command.profileNative === 'samply') {
122
+ nativeProfiler = command.profileNative;
123
+ }
124
+ else {
125
+ nativeProfiler = undefined;
126
+ }
127
+ }
128
+ else if (command.profileNative) {
129
+ nativeProfiler = os_1.default.platform() === 'darwin' ? 'instruments' : 'samply';
130
+ }
131
+ else {
132
+ nativeProfiler = undefined;
133
+ }
117
134
  return {
118
135
  shouldDisableCache: command.cache === false,
119
136
  cacheDir: command.cacheDir,
@@ -131,6 +148,7 @@ async function normalizeOptions(command, inputFS) {
131
148
  shouldAutoInstall: command.autoinstall ?? true,
132
149
  logLevel: command.logLevel,
133
150
  shouldProfile: command.profile,
151
+ nativeProfiler,
134
152
  shouldTrace: command.trace,
135
153
  shouldBuildLazily: typeof command.lazy !== 'undefined',
136
154
  lazyIncludes: normalizeIncludeExcludeList(command.lazy),
package/dist/options.js CHANGED
@@ -53,6 +53,7 @@ exports.commonOptions = {
53
53
  '--dist-dir <dir>': 'output directory to write to when unspecified by targets',
54
54
  '--no-autoinstall': 'disable autoinstall',
55
55
  '--profile': 'enable sampling build profiling',
56
+ '--profile-native [instruments|samply]': 'enable native build profiling (defaults to instruments on macOS, samply otherwise)',
56
57
  '--trace': 'enable build tracing',
57
58
  '-V, --version': 'output the version number',
58
59
  '--detailed-report [count]': [
@@ -36,7 +36,6 @@ var _normalizeOptions = require("./normalizeOptions");
36
36
  var _applyOptions = require("./applyOptions");
37
37
  var _options = require("./options");
38
38
  var _handleUncaughtException = require("./handleUncaughtException");
39
- var _compareCompiledCommand = require("./compareCompiledCommand");
40
39
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
40
  // @ts-expect-error TS2305
42
41
 
@@ -109,6 +108,5 @@ function makeDebugCommand() {
109
108
  }
110
109
  });
111
110
  (0, _applyOptions.applyOptions)(compactCache, _options.commonOptions);
112
- debug.addCommand((0, _compareCompiledCommand.makeCompareCompiledCommand)());
113
111
  return debug;
114
112
  }
@@ -32,6 +32,13 @@ function _path() {
32
32
  };
33
33
  return data;
34
34
  }
35
+ function _os() {
36
+ const data = _interopRequireDefault(require("os"));
37
+ _os = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
35
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36
43
  function parsePort(portValue) {
37
44
  let parsedPort = Number(portValue);
@@ -143,6 +150,18 @@ async function normalizeOptions(command, inputFS) {
143
150
  if (typeof input !== 'string') return [];
144
151
  return input.split(',').map(value => value.trim());
145
152
  };
153
+ let nativeProfiler;
154
+ if (typeof command.profileNative === 'string') {
155
+ if (command.profileNative === 'instruments' || command.profileNative === 'samply') {
156
+ nativeProfiler = command.profileNative;
157
+ } else {
158
+ nativeProfiler = undefined;
159
+ }
160
+ } else if (command.profileNative) {
161
+ nativeProfiler = _os().default.platform() === 'darwin' ? 'instruments' : 'samply';
162
+ } else {
163
+ nativeProfiler = undefined;
164
+ }
146
165
  return {
147
166
  shouldDisableCache: command.cache === false,
148
167
  cacheDir: command.cacheDir,
@@ -160,6 +179,7 @@ async function normalizeOptions(command, inputFS) {
160
179
  shouldAutoInstall: command.autoinstall ?? true,
161
180
  logLevel: command.logLevel,
162
181
  shouldProfile: command.profile,
182
+ nativeProfiler,
163
183
  shouldTrace: command.trace,
164
184
  shouldBuildLazily: typeof command.lazy !== 'undefined',
165
185
  lazyIncludes: normalizeIncludeExcludeList(command.lazy),
package/lib/options.js CHANGED
@@ -70,6 +70,7 @@ const commonOptions = exports.commonOptions = {
70
70
  '--dist-dir <dir>': 'output directory to write to when unspecified by targets',
71
71
  '--no-autoinstall': 'disable autoinstall',
72
72
  '--profile': 'enable sampling build profiling',
73
+ '--profile-native [instruments|samply]': 'enable native build profiling (defaults to instruments on macOS, samply otherwise)',
73
74
  '--trace': 'enable build tracing',
74
75
  '-V, --version': 'output the version number',
75
76
  '--detailed-report [count]': ['print the asset timings and sizes in the build report', parseOptionInt],
@@ -26,6 +26,7 @@ export interface Options {
26
26
  config?: string;
27
27
  logLevel?: LogLevel;
28
28
  profile?: boolean;
29
+ profileNative?: string | boolean;
29
30
  contentHash?: boolean;
30
31
  featureFlag?: Partial<FeatureFlags>;
31
32
  optimize?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/cli",
3
- "version": "2.14.17-dev-compiled-hash-e5f8a1735.0",
3
+ "version": "2.15.0",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "type": "commonjs",
@@ -24,26 +24,25 @@
24
24
  "node": ">= 16.0.0"
25
25
  },
26
26
  "dependencies": {
27
- "@atlaspack/config-default": "7.0.3-dev-compiled-hash-e5f8a1735.0",
28
- "@atlaspack/core": "2.26.3-dev-compiled-hash-e5f8a1735.0",
29
- "@atlaspack/diagnostic": "2.14.5-dev-compiled-hash-e5f8a1735.0",
30
- "@atlaspack/events": "2.14.5-dev-compiled-hash-e5f8a1735.0",
31
- "@atlaspack/feature-flags": "2.26.2-dev-compiled-hash-e5f8a1735.0",
32
- "@atlaspack/fs": "2.15.33-dev-compiled-hash-e5f8a1735.0",
33
- "@atlaspack/logger": "2.14.30-dev-compiled-hash-e5f8a1735.0",
34
- "@atlaspack/package-manager": "2.14.38-dev-compiled-hash-e5f8a1735.0",
35
- "@atlaspack/reporter-cli": "2.17.20-dev-compiled-hash-e5f8a1735.0",
36
- "@atlaspack/reporter-dev-server": "2.14.38-dev-compiled-hash-e5f8a1735.0",
37
- "@atlaspack/reporter-tracer": "2.14.38-dev-compiled-hash-e5f8a1735.0",
38
- "@atlaspack/utils": "3.1.2-dev-compiled-hash-e5f8a1735.0",
27
+ "@atlaspack/config-default": "9.0.0",
28
+ "@atlaspack/core": "2.28.0",
29
+ "@atlaspack/diagnostic": "2.14.4",
30
+ "@atlaspack/events": "2.14.4",
31
+ "@atlaspack/feature-flags": "2.27.0",
32
+ "@atlaspack/fs": "2.15.34",
33
+ "@atlaspack/logger": "2.14.31",
34
+ "@atlaspack/package-manager": "2.14.39",
35
+ "@atlaspack/reporter-cli": "2.17.21",
36
+ "@atlaspack/reporter-dev-server": "2.14.39",
37
+ "@atlaspack/reporter-tracer": "2.14.39",
38
+ "@atlaspack/utils": "3.2.0",
39
39
  "chalk": "^4.1.0",
40
40
  "commander": "^7.0.0",
41
41
  "get-port": "^4.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@atlaspack/babel-register": "2.14.5-dev-compiled-hash-e5f8a1735.0",
45
44
  "@babel/core": "^7.22.11",
45
+ "@atlaspack/babel-register": "2.14.4",
46
46
  "rimraf": "^5.0.5"
47
- },
48
- "gitHead": "e5f8a173505611c1fafafd6e7dddb2f6b483f67c"
47
+ }
49
48
  }
@@ -8,7 +8,6 @@ import type {CommandExt} from './normalizeOptions';
8
8
  import {applyOptions} from './applyOptions';
9
9
  import {commonOptions} from './options';
10
10
  import {handleUncaughtException} from './handleUncaughtException';
11
- import {makeCompareCompiledCommand} from './compareCompiledCommand';
12
11
 
13
12
  export function makeDebugCommand(): commander.Command {
14
13
  const debug = new commander.Command('debug').description(
@@ -105,7 +104,5 @@ export function makeDebugCommand(): commander.Command {
105
104
  });
106
105
  applyOptions(compactCache, commonOptions);
107
106
 
108
- debug.addCommand(makeCompareCompiledCommand());
109
-
110
107
  return debug;
111
108
  }
@@ -6,6 +6,7 @@ import type {FeatureFlags} from '@atlaspack/feature-flags';
6
6
  import type {InitialAtlaspackOptions, LogLevel} from '@atlaspack/types';
7
7
  import {INTERNAL_ORIGINAL_CONSOLE} from '@atlaspack/logger';
8
8
  import path from 'path';
9
+ import os from 'os';
9
10
 
10
11
  function parsePort(portValue: string): number {
11
12
  let parsedPort = Number(portValue);
@@ -47,6 +48,7 @@ export interface Options {
47
48
  config?: string;
48
49
  logLevel?: LogLevel;
49
50
  profile?: boolean;
51
+ profileNative?: string | boolean;
50
52
  contentHash?: boolean;
51
53
  featureFlag?: Partial<FeatureFlags>;
52
54
  optimize?: boolean;
@@ -175,6 +177,22 @@ export async function normalizeOptions(
175
177
  return input.split(',').map((value) => value.trim());
176
178
  };
177
179
 
180
+ let nativeProfiler: 'instruments' | 'samply' | undefined;
181
+ if (typeof command.profileNative === 'string') {
182
+ if (
183
+ command.profileNative === 'instruments' ||
184
+ command.profileNative === 'samply'
185
+ ) {
186
+ nativeProfiler = command.profileNative as 'instruments' | 'samply';
187
+ } else {
188
+ nativeProfiler = undefined;
189
+ }
190
+ } else if (command.profileNative) {
191
+ nativeProfiler = os.platform() === 'darwin' ? 'instruments' : 'samply';
192
+ } else {
193
+ nativeProfiler = undefined;
194
+ }
195
+
178
196
  return {
179
197
  shouldDisableCache: command.cache === false,
180
198
  cacheDir: command.cacheDir,
@@ -192,6 +210,7 @@ export async function normalizeOptions(
192
210
  shouldAutoInstall: command.autoinstall ?? true,
193
211
  logLevel: command.logLevel,
194
212
  shouldProfile: command.profile,
213
+ nativeProfiler,
195
214
  shouldTrace: command.trace,
196
215
  shouldBuildLazily: typeof command.lazy !== 'undefined',
197
216
  lazyIncludes: normalizeIncludeExcludeList(command.lazy),
package/src/options.ts CHANGED
@@ -60,6 +60,8 @@ export const commonOptions: OptionsDefinition = {
60
60
  'output directory to write to when unspecified by targets',
61
61
  '--no-autoinstall': 'disable autoinstall',
62
62
  '--profile': 'enable sampling build profiling',
63
+ '--profile-native [instruments|samply]':
64
+ 'enable native build profiling (defaults to instruments on macOS, samply otherwise)',
63
65
  '--trace': 'enable build tracing',
64
66
  '-V, --version': 'output the version number',
65
67
  '--detailed-report [count]': [