sonda 0.8.1 → 0.8.2
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 +12 -0
- package/bin/sonda-angular.js +1 -0
- package/dist/entrypoints/angular.js +2 -2
- package/dist/entrypoints/astro.js +7 -4
- package/dist/entrypoints/next.js +1 -1
- package/dist/entrypoints/nuxt.js +5 -2
- package/dist/entrypoints/rolldown.js +2 -2
- package/dist/entrypoints/sveltekit.js +3 -3
- package/dist/index.d.ts +22 -9
- package/dist/index.html +3 -3
- package/dist/index.js +42 -27
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3ec00ae: (Performance) Prevent duplicate resolution of some imports in Rollup
|
|
8
|
+
- 9f34bbf: Add a search field to the Treemap view for filtering inputs
|
|
9
|
+
- 1c14126: Log report path after generation
|
|
10
|
+
- 5ae02e5: Fix edge case in Treemap where items fail to sort in descending order by size
|
|
11
|
+
- 9d25830: Always show input code when available, even if CSS Custom Highlighting API is unsupported
|
|
12
|
+
- b230643: Allow filtering inputs by "type" when inspecting asset in Treemap view
|
|
13
|
+
- ab2f385: Reintroduce the `filename` configuration option
|
|
14
|
+
|
|
3
15
|
## 0.8.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/bin/sonda-angular.js
CHANGED
|
@@ -8,6 +8,7 @@ const { values } = parseArgs( {
|
|
|
8
8
|
config: { type: 'string' },
|
|
9
9
|
projects: { type: 'string', multiple: true },
|
|
10
10
|
format: { type: 'string' },
|
|
11
|
+
filename: { type: 'string' },
|
|
11
12
|
outputDir: { type: 'string' },
|
|
12
13
|
'no-open': { type: 'boolean' },
|
|
13
14
|
deep: { type: 'boolean' },
|
|
@@ -6,7 +6,7 @@ import { Config, processEsbuildMetafile } from "sonda";
|
|
|
6
6
|
async function SondaAngular({ config = "angular.json", projects = [],...userOptions }) {
|
|
7
7
|
const options = new Config(userOptions, {
|
|
8
8
|
integration: "angular",
|
|
9
|
-
filename: "sonda_[
|
|
9
|
+
filename: "sonda_[env]_[index]"
|
|
10
10
|
});
|
|
11
11
|
const angularConfig = loadJson(config);
|
|
12
12
|
const projectsToGenerate = projects.length ? projects : Object.keys(angularConfig.projects);
|
|
@@ -18,7 +18,7 @@ async function SondaAngular({ config = "angular.json", projects = [],...userOpti
|
|
|
18
18
|
paths.server = resolve(paths.base, paths.server || "server");
|
|
19
19
|
const metafile = updateMetafile(loadJson(resolve(paths.base, "stats.json")), paths.base);
|
|
20
20
|
const sondaOptions = options.clone();
|
|
21
|
-
sondaOptions.filename = sondaOptions.filename.replace("[
|
|
21
|
+
sondaOptions.filename = sondaOptions.filename.replace("[env]", project);
|
|
22
22
|
sondaOptions.sourcesPathNormalizer = (path) => resolve(process.cwd(), path);
|
|
23
23
|
await processEsbuildMetafile(metafile, sondaOptions);
|
|
24
24
|
}
|
|
@@ -4,20 +4,23 @@ import { Config, SondaVitePlugin } from "sonda";
|
|
|
4
4
|
function SondaAstroPlugin(userOptions = {}) {
|
|
5
5
|
const options = new Config(userOptions, {
|
|
6
6
|
integration: "astro",
|
|
7
|
-
filename: "sonda_[env]"
|
|
7
|
+
filename: "sonda_[env]_[index]"
|
|
8
8
|
});
|
|
9
9
|
if (!options.enabled) return {
|
|
10
|
-
name: "sonda
|
|
10
|
+
name: "sonda/astro",
|
|
11
11
|
hooks: {}
|
|
12
12
|
};
|
|
13
13
|
return {
|
|
14
|
-
name: "sonda
|
|
14
|
+
name: "sonda/astro",
|
|
15
15
|
hooks: { "astro:build:setup"({ vite, target }) {
|
|
16
16
|
if (target === "server" && !options.server) return;
|
|
17
17
|
const sondaOptions = options.clone();
|
|
18
18
|
sondaOptions.filename = sondaOptions.filename.replace("[env]", target);
|
|
19
19
|
vite.plugins ??= [];
|
|
20
|
-
vite.plugins.push(
|
|
20
|
+
vite.plugins.push({
|
|
21
|
+
...SondaVitePlugin(sondaOptions),
|
|
22
|
+
name: "sonda/astro"
|
|
23
|
+
});
|
|
21
24
|
} }
|
|
22
25
|
};
|
|
23
26
|
}
|
package/dist/entrypoints/next.js
CHANGED
|
@@ -5,7 +5,7 @@ function SondaNextPlugin(userOptions = {}) {
|
|
|
5
5
|
return function Sonda(nextConfig = {}) {
|
|
6
6
|
const options = new Config(userOptions, {
|
|
7
7
|
integration: "next",
|
|
8
|
-
filename: "sonda_[env]"
|
|
8
|
+
filename: "sonda_[env]_[index]"
|
|
9
9
|
});
|
|
10
10
|
if (!options.enabled) return nextConfig;
|
|
11
11
|
return Object.assign({}, nextConfig, { webpack(config, { nextRuntime, isServer }) {
|
package/dist/entrypoints/nuxt.js
CHANGED
|
@@ -5,7 +5,7 @@ function SondaNuxtPlugin(userOptions = {}) {
|
|
|
5
5
|
return function SondaNuxtPlugin$1(_, nuxt) {
|
|
6
6
|
const options = new Config(userOptions, {
|
|
7
7
|
integration: "nuxt",
|
|
8
|
-
filename: "sonda_[env]"
|
|
8
|
+
filename: "sonda_[env]_[index]"
|
|
9
9
|
});
|
|
10
10
|
if (!options.enabled) return;
|
|
11
11
|
nuxt.hook("vite:extendConfig", (config, { isClient, isServer }) => {
|
|
@@ -14,7 +14,10 @@ function SondaNuxtPlugin(userOptions = {}) {
|
|
|
14
14
|
const sondaOptions = options.clone();
|
|
15
15
|
sondaOptions.filename = sondaOptions.filename.replace("[env]", env);
|
|
16
16
|
config.plugins ??= [];
|
|
17
|
-
config.plugins.push(
|
|
17
|
+
config.plugins.push({
|
|
18
|
+
...SondaVitePlugin(sondaOptions),
|
|
19
|
+
name: "sonda/nuxt"
|
|
20
|
+
});
|
|
18
21
|
});
|
|
19
22
|
};
|
|
20
23
|
}
|
|
@@ -3,10 +3,10 @@ import { Config, SondaRollupPlugin } from "sonda";
|
|
|
3
3
|
//#region src/entrypoints/rolldown.ts
|
|
4
4
|
function RolldownPlugin(userOptions = {}) {
|
|
5
5
|
const options = new Config(userOptions, { integration: "rolldown" });
|
|
6
|
-
if (!options.enabled) return { name: "sonda
|
|
6
|
+
if (!options.enabled) return { name: "sonda/rolldown" };
|
|
7
7
|
return {
|
|
8
8
|
...SondaRollupPlugin(options),
|
|
9
|
-
name: "sonda
|
|
9
|
+
name: "sonda/rolldown"
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -4,12 +4,12 @@ import { Config, SondaVitePlugin } from "sonda";
|
|
|
4
4
|
function SondaSvelteKitPlugin(userOptions = {}) {
|
|
5
5
|
const options = new Config(userOptions, {
|
|
6
6
|
integration: "sveltekit",
|
|
7
|
-
filename: "sonda_[env]"
|
|
7
|
+
filename: "sonda_[env]_[index]"
|
|
8
8
|
});
|
|
9
|
-
if (!options.enabled) return { name: "sonda
|
|
9
|
+
if (!options.enabled) return { name: "sonda/sveltekit" };
|
|
10
10
|
return {
|
|
11
11
|
...SondaVitePlugin(options),
|
|
12
|
-
name: "sonda
|
|
12
|
+
name: "sonda/sveltekit",
|
|
13
13
|
configResolved(config) {
|
|
14
14
|
const env = config.build.ssr ? "server" : "client";
|
|
15
15
|
const generateForServer = userOptions.server ?? false;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare class Config implements Required<IntegrationOptions> {
|
|
|
12
12
|
clone(): Config;
|
|
13
13
|
get enabled(): boolean;
|
|
14
14
|
get format(): Format;
|
|
15
|
+
get filename(): string;
|
|
15
16
|
get outputDir(): string;
|
|
16
17
|
get open(): boolean;
|
|
17
18
|
get deep(): boolean;
|
|
@@ -20,7 +21,6 @@ declare class Config implements Required<IntegrationOptions> {
|
|
|
20
21
|
get brotli(): boolean;
|
|
21
22
|
get server(): boolean;
|
|
22
23
|
get integration(): Integration;
|
|
23
|
-
get filename(): string;
|
|
24
24
|
get sourcesPathNormalizer(): SourcesPathNormalizer;
|
|
25
25
|
set filename(filename: string);
|
|
26
26
|
set sourcesPathNormalizer(normalizer: SourcesPathNormalizer);
|
|
@@ -39,6 +39,25 @@ interface UserOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
format?: Format;
|
|
41
41
|
/**
|
|
42
|
+
* Specifies the filename of the generated report. If this value is an absolute path,
|
|
43
|
+
* it will override the `outputDir` option.
|
|
44
|
+
*
|
|
45
|
+
* The default value includes placeholders like `[index]` and `[env]`, which are replaced
|
|
46
|
+
* during report generation.
|
|
47
|
+
*
|
|
48
|
+
* The `[index]` placeholder is replaced with a version number that increments each time
|
|
49
|
+
* a new report is generated. This allows you to keep multiple revisions of the report without
|
|
50
|
+
* overwriting previous ones. If you want to generate only a single report and always overwrite
|
|
51
|
+
* the previous one, you can set this option to a static value, such as `'sonda'`.
|
|
52
|
+
*
|
|
53
|
+
* Additionally, framework integrations that can generate reports for both the client and server
|
|
54
|
+
* (with the `server` option) will include the `[env]` placeholder in the filename. This is replaced with
|
|
55
|
+
* the environment name (e.g., `client`, `server`), allowing you to distinguish between client and server reports.
|
|
56
|
+
*
|
|
57
|
+
* @default `'sonda_[index]'` for bundler integrations and `'sonda_[env]_[index]'` for framework integrations.
|
|
58
|
+
*/
|
|
59
|
+
filename?: string;
|
|
60
|
+
/**
|
|
42
61
|
* Specifies the name of the directory where the report will be saved.
|
|
43
62
|
*
|
|
44
63
|
* @default '.sonda'
|
|
@@ -101,7 +120,7 @@ interface UserOptions {
|
|
|
101
120
|
/**
|
|
102
121
|
* Specifies whether to generate a report for the server build.
|
|
103
122
|
*
|
|
104
|
-
* This option is only available for
|
|
123
|
+
* This option is only available for framework integrations.
|
|
105
124
|
*
|
|
106
125
|
* @default false
|
|
107
126
|
*/
|
|
@@ -113,12 +132,6 @@ interface IntegrationOptions extends UserOptions {
|
|
|
113
132
|
*/
|
|
114
133
|
integration: Integration;
|
|
115
134
|
/**
|
|
116
|
-
* Specifies the name of the file where the report will be saved.
|
|
117
|
-
*
|
|
118
|
-
* @default 'sonda'
|
|
119
|
-
*/
|
|
120
|
-
filename?: string;
|
|
121
|
-
/**
|
|
122
135
|
* Normalizes the paths in source maps to a consistent format.
|
|
123
136
|
*
|
|
124
137
|
* @default null
|
|
@@ -412,7 +425,7 @@ declare class Report {
|
|
|
412
425
|
addResource(resource: Resource): void;
|
|
413
426
|
addConnection(connection: Connection): void;
|
|
414
427
|
addAsset(name: string, entrypoints?: Array<string>): void;
|
|
415
|
-
generate(): Promise<
|
|
428
|
+
generate(): Promise<string>;
|
|
416
429
|
addSourceMap(asset: string, sourcemap: DecodedReportSourceMap): void;
|
|
417
430
|
}
|
|
418
431
|
//#endregion
|