@savvy-web/bundler 2.6.2 → 2.7.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/og.js +1 -1
- package/package.json +5 -4
- package/run.js +5 -4
- package/runtime-env.js +27 -0
package/og.js
CHANGED
|
@@ -121,7 +121,7 @@ const ogImage = { satori(options = {}) {
|
|
|
121
121
|
};
|
|
122
122
|
const cacheSalt = JSON.stringify({
|
|
123
123
|
renderer: "@savvy-web/bundler/og#satori",
|
|
124
|
-
version: "2.
|
|
124
|
+
version: "2.7.0",
|
|
125
125
|
satori: peerVersion("satori"),
|
|
126
126
|
resvg: peerVersion("@resvg/resvg-js"),
|
|
127
127
|
colors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/bundler",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Zero-config tsdown-based bundler for Silk Suite TypeScript packages",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/bundler",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@
|
|
40
|
+
"@effected/env": "^0.6.0",
|
|
41
|
+
"@savvy-web/tsdown-plugins": "^2.11.2",
|
|
41
42
|
"@tsdown/exe": "^0.23.2",
|
|
42
43
|
"effect": "^4.0.6",
|
|
43
44
|
"rolldown": "^1.2.15",
|
|
@@ -50,8 +51,8 @@
|
|
|
50
51
|
"@types/react-dom": "^19.3.0",
|
|
51
52
|
"react": "^19.3.0",
|
|
52
53
|
"react-dom": "^19.3.0",
|
|
53
|
-
"satori": "^0.
|
|
54
|
-
"typescript": "
|
|
54
|
+
"satori": "^0.63.2",
|
|
55
|
+
"typescript": "7.1.0-beta"
|
|
55
56
|
},
|
|
56
57
|
"peerDependenciesMeta": {
|
|
57
58
|
"@types/react": {
|
package/run.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineBuild, parseArgs } from "./config.js";
|
|
2
|
+
import { ProcessStdoutTerminal, isCi, reportNoColor } from "./runtime-env.js";
|
|
2
3
|
import { BuildCollector, ConfigValidationError, ConfigValidator, ReportPipeline, assertNoEntryCollisions, buildEmittedManifest, buildTargetGroups, computeExeFileName, createEntryName, deriveExportPaths, extractAmbientDts, normalizeExeOptions, normalizeLooseFiles, packageJsonEntries, readTsconfigJsx, releaseWarnings, removeDeclarationMaps, renderReport, resolveJsxConfig, resolveTargets, runExeBuild, runMetaPass, writeIssuesArtifact, writeResolvedTsconfig, writeTargetsBinding } from "@savvy-web/tsdown-plugins";
|
|
3
4
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { dirname, join } from "node:path";
|
|
@@ -238,11 +239,11 @@ async function runBuild(config, options) {
|
|
|
238
239
|
const explicitFormat = config.output?.format;
|
|
239
240
|
const writeOutput = options.writeOutput ?? ((o) => process.stdout.write(`${o.content}\n`));
|
|
240
241
|
renderAndWrite = async () => {
|
|
241
|
-
const rendered = await Effect.runPromise(renderReport(collector.snapshot(packageName), {
|
|
242
|
+
const rendered = await Effect.runPromise(Effect.flatMap(reportNoColor, (noColor) => renderReport(collector.snapshot(packageName), {
|
|
242
243
|
...explicitFormat !== void 0 ? { explicitFormat } : {},
|
|
243
244
|
verbose,
|
|
244
|
-
noColor
|
|
245
|
-
}).pipe(Effect.provide(ReportPipeline)));
|
|
245
|
+
noColor
|
|
246
|
+
})).pipe(Effect.provide(ReportPipeline), Effect.provide(ProcessStdoutTerminal)));
|
|
246
247
|
for (const output of rendered) writeOutput(output);
|
|
247
248
|
};
|
|
248
249
|
if (hasJsEntries || config.exe === void 0) await build({
|
|
@@ -274,7 +275,7 @@ async function runBuild(config, options) {
|
|
|
274
275
|
});
|
|
275
276
|
if (target === "prod" && resolution !== void 0) writeBinding(cwd, resolution);
|
|
276
277
|
if (target === "prod" && config.meta !== false && config.emitDts !== false && (config.exe === void 0 || hasJsEntries)) {
|
|
277
|
-
const ci =
|
|
278
|
+
const ci = isCi();
|
|
278
279
|
await runMetaPass({
|
|
279
280
|
cwd,
|
|
280
281
|
packageName,
|
package/runtime-env.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Effect, Option, Stdio } from "effect";
|
|
2
|
+
import { RuntimeEnv, TerminalEnv } from "@effected/env";
|
|
3
|
+
|
|
4
|
+
// src/runtime-env.ts
|
|
5
|
+
/**
|
|
6
|
+
* Whether the build runs under CI, by `@effected/env`'s one rule (a known provider's marker, or a truthy `CI` /
|
|
7
|
+
* `CONTINUOUS_INTEGRATION`) — the same rule `@savvy-web/tsdown-plugins` and `@savvy-web/github-action-builder` use.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
const isCi = (env = process.env) => Option.isSome(RuntimeEnv.fromRecord(env).ci);
|
|
12
|
+
/**
|
|
13
|
+
* Whether the build report must be painted without colour: `@effected/env`'s stdout colour level is `none`.
|
|
14
|
+
* `FORCE_COLOR` decides alone when set, then a non-TTY stdout, `NO_COLOR` / `TERM=dumb`, and the terminal table.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
const reportNoColor = Effect.map(TerminalEnv.colorLevel("stdout"), (level) => level === "none");
|
|
19
|
+
/**
|
|
20
|
+
* The one `Stdio` fact the colour decision reads — whether `process.stdout` is a TTY — without taking a runtime
|
|
21
|
+
* dependency on `@effect/platform-node`. Every other `Stdio` member is inert and never used.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
const ProcessStdoutTerminal = Stdio.layerTest({ stdoutIsTerminal: Effect.sync(() => process.stdout.isTTY === true) });
|
|
26
|
+
|
|
27
|
+
export { ProcessStdoutTerminal, isCi, reportNoColor };
|