@autter/runtime-cli 1.0.0 → 1.2.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/README.md +97 -19
- package/dist/{build-BXFh_jbP.d.cts → build-BqjqqeLg.d.cts} +35 -9
- package/dist/{build-BXFh_jbP.d.ts → build-BqjqqeLg.d.ts} +35 -9
- package/dist/chunk-KIQRQY3X.js +1044 -0
- package/dist/{chunk-GGHHEUPQ.js → chunk-SIL3WZZ3.js} +26 -8
- package/dist/cli.js +2394 -154
- package/dist/index.cjs +817 -60
- package/dist/index.d.cts +111 -2
- package/dist/index.d.ts +111 -2
- package/dist/index.js +261 -2
- package/dist/next.cjs +645 -104
- package/dist/next.d.cts +3 -2
- package/dist/next.d.ts +3 -2
- package/dist/next.js +27 -8
- package/dist/vite.cjs +622 -95
- package/dist/vite.d.cts +3 -2
- package/dist/vite.d.ts +3 -2
- package/dist/vite.js +32 -6
- package/dist/webpack.cjs +615 -95
- package/dist/webpack.d.cts +11 -4
- package/dist/webpack.d.ts +11 -4
- package/dist/webpack.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-SIRFO2QU.js +0 -524
package/dist/next.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AutterSourceMapsOptions } from './build-
|
|
1
|
+
import { A as AutterSourceMapsOptions } from './build-BqjqqeLg.cjs';
|
|
2
2
|
|
|
3
3
|
type NextConfigObject = Record<string, any>;
|
|
4
4
|
type NextConfigFunction = (phase: string, context: {
|
|
@@ -9,7 +9,8 @@ declare function installedNextVersion(cwd?: string): string | null;
|
|
|
9
9
|
/**
|
|
10
10
|
* Next.js config wrapper: hidden source maps for client production builds,
|
|
11
11
|
* debug ids injected into every client chunk, maps uploaded after the build
|
|
12
|
-
* when AUTTER_RUNTIME_KEY (or `key`) is set
|
|
12
|
+
* when AUTTER_RUNTIME_KEY (or `key`) is set, then deleted whatever the
|
|
13
|
+
* upload's outcome (without a key, no maps are turned on at all). Works with webpack builds, and
|
|
13
14
|
* with Turbopack builds on Next.js 15.4.1+ (`compiler.runAfterProductionCompile`).
|
|
14
15
|
*
|
|
15
16
|
* ```js
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AutterSourceMapsOptions } from './build-
|
|
1
|
+
import { A as AutterSourceMapsOptions } from './build-BqjqqeLg.js';
|
|
2
2
|
|
|
3
3
|
type NextConfigObject = Record<string, any>;
|
|
4
4
|
type NextConfigFunction = (phase: string, context: {
|
|
@@ -9,7 +9,8 @@ declare function installedNextVersion(cwd?: string): string | null;
|
|
|
9
9
|
/**
|
|
10
10
|
* Next.js config wrapper: hidden source maps for client production builds,
|
|
11
11
|
* debug ids injected into every client chunk, maps uploaded after the build
|
|
12
|
-
* when AUTTER_RUNTIME_KEY (or `key`) is set
|
|
12
|
+
* when AUTTER_RUNTIME_KEY (or `key`) is set, then deleted whatever the
|
|
13
|
+
* upload's outcome (without a key, no maps are turned on at all). Works with webpack builds, and
|
|
13
14
|
* with Turbopack builds on Next.js 15.4.1+ (`compiler.runAfterProductionCompile`).
|
|
14
15
|
*
|
|
15
16
|
* ```js
|
package/dist/next.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AutterSourceMapsWebpackPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SIL3WZZ3.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
findMapFiles,
|
|
6
|
+
logMapsNotGenerated,
|
|
7
|
+
processBuildOutput,
|
|
8
|
+
shouldGenerateMaps
|
|
9
|
+
} from "./chunk-KIQRQY3X.js";
|
|
7
10
|
|
|
8
11
|
// src/next.ts
|
|
9
12
|
import { createRequire } from "module";
|
|
@@ -28,7 +31,15 @@ function hasAfterCompileHook(version) {
|
|
|
28
31
|
}
|
|
29
32
|
function wrapConfig(config, options) {
|
|
30
33
|
const publicMaps = config.productionBrowserSourceMaps === true;
|
|
34
|
+
const ownMaps = !publicMaps && shouldGenerateMaps(options);
|
|
31
35
|
const deleteAfterUpload = options.deleteAfterUpload ?? !publicMaps;
|
|
36
|
+
let notified = false;
|
|
37
|
+
const notifyNoMaps = () => {
|
|
38
|
+
if (!publicMaps && !ownMaps && !notified) {
|
|
39
|
+
notified = true;
|
|
40
|
+
logMapsNotGenerated(options);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
32
43
|
const base = String(config.assetPrefix || config.basePath || "").replace(/\/+$/, "");
|
|
33
44
|
const nextPrefix = `${base}/_next/`;
|
|
34
45
|
const useHook = hasAfterCompileHook(installedNextVersion());
|
|
@@ -38,11 +49,14 @@ function wrapConfig(config, options) {
|
|
|
38
49
|
webpack(webpackConfig, context) {
|
|
39
50
|
const result = typeof userWebpack === "function" ? userWebpack(webpackConfig, context) : webpackConfig;
|
|
40
51
|
if (!context.isServer && !context.dev) {
|
|
41
|
-
if (
|
|
52
|
+
if (ownMaps) result.devtool = "hidden-source-map";
|
|
42
53
|
if (!useHook) {
|
|
43
54
|
result.plugins = [
|
|
44
55
|
...result.plugins ?? [],
|
|
45
|
-
new AutterSourceMapsWebpackPlugin(
|
|
56
|
+
new AutterSourceMapsWebpackPlugin(
|
|
57
|
+
{ ...options, urlPrefix: options.urlPrefix ?? nextPrefix, deleteAfterUpload },
|
|
58
|
+
{ ownMaps }
|
|
59
|
+
)
|
|
46
60
|
];
|
|
47
61
|
}
|
|
48
62
|
}
|
|
@@ -50,19 +64,24 @@ function wrapConfig(config, options) {
|
|
|
50
64
|
}
|
|
51
65
|
};
|
|
52
66
|
if (useHook) {
|
|
53
|
-
wrapped.productionBrowserSourceMaps = true;
|
|
67
|
+
if (ownMaps) wrapped.productionBrowserSourceMaps = true;
|
|
54
68
|
const userHook = config.compiler?.runAfterProductionCompile;
|
|
55
69
|
wrapped.compiler = {
|
|
56
70
|
...config.compiler,
|
|
57
71
|
async runAfterProductionCompile(ctx = {}) {
|
|
58
72
|
if (typeof userHook === "function") await userHook(ctx);
|
|
59
73
|
const distDir = ctx.distDir ?? resolve(ctx.projectDir ?? process.cwd(), String(config.distDir ?? ".next"));
|
|
74
|
+
const staticDir = join(distDir, "static");
|
|
75
|
+
notifyNoMaps();
|
|
60
76
|
await processBuildOutput({
|
|
61
|
-
dir:
|
|
77
|
+
dir: staticDir,
|
|
62
78
|
urlPrefix: options.urlPrefix ?? `${nextPrefix}static/`,
|
|
63
79
|
options: { ...options, deleteAfterUpload },
|
|
64
80
|
deleteAfterUpload,
|
|
65
|
-
stripSourceMappingUrl: !publicMaps
|
|
81
|
+
stripSourceMappingUrl: !publicMaps,
|
|
82
|
+
ownMaps,
|
|
83
|
+
// Every client map (JS and CSS): .next/static is deployed as is.
|
|
84
|
+
maps: ownMaps ? await findMapFiles(staticDir) : void 0
|
|
66
85
|
});
|
|
67
86
|
}
|
|
68
87
|
};
|