Skip to content

Commit

Permalink
Merge branch 'main' into alsh/debug-asset-graph-dot
Browse files Browse the repository at this point in the history
  • Loading branch information
alshdavid committed Dec 31, 2024
2 parents 5272219 + d444767 commit 547ec82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
11 changes: 8 additions & 3 deletions packages/core/core/src/requests/BundleGraphRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
} from '../types';
import type {ConfigAndCachePath} from './AtlaspackConfigRequest';

import fs from 'fs';
import invariant from 'assert';
import assert from 'assert';
import nullthrows from 'nullthrows';
Expand Down Expand Up @@ -57,7 +58,11 @@ import createAssetGraphRequestJS from './AssetGraphRequest';
import {createAssetGraphRequestRust} from './AssetGraphRequestRust';
import {tracer, PluginTracer} from '@atlaspack/profiler';
import {requestTypes} from '../RequestTracker';
import {assetGraphToDot, getDebugAssetGraphDotPath} from './asset-graph-dot';
import {
assetGraphToDot,
getDebugAssetGraphDotPath,
getDebugAssetGraphDotPathOptions,
} from './asset-graph-dot';

type BundleGraphRequestInput = {|
requestedAssetIds: Set<string>,
Expand Down Expand Up @@ -122,9 +127,9 @@ export default function createBundleGraphRequest(

let debugAssetGraphDotPath = getDebugAssetGraphDotPath();
if (debugAssetGraphDotPath !== null) {
require('fs').writeFileSync(
await fs.promises.writeFile(
debugAssetGraphDotPath,
assetGraphToDot(assetGraph),
assetGraphToDot(assetGraph, getDebugAssetGraphDotPathOptions()),
'utf8',
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/requests/asset-graph-dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function getDebugAssetGraphDotPathOptions(): AssetGraphToDotOptions {

let style = process.env.DEBUG_ASSET_GRAPH_DOT_STYLE;
if (style !== undefined) {
options.sort = style === 'true';
options.style = style === 'true';
}

let sort = process.env.DEBUG_ASSET_GRAPH_DOT_SORT;
Expand Down
5 changes: 0 additions & 5 deletions packages/runtimes/js/src/JSRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ export default (new Runtime({
)})(${getAbsoluteUrlExpr(
relativePathExpr,
bundle,
referencedBundle,
config.domainSharding,
)})`;
assets.push({
Expand Down Expand Up @@ -497,7 +496,6 @@ function getLoaderRuntime({
absoluteUrlExpr = getAbsoluteUrlExpr(
relativePathExpr,
bundle,
to,
shardingConfig,
);
}
Expand Down Expand Up @@ -696,7 +694,6 @@ function getHintLoaders(
`require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(
relativePathExpr,
from,
bundleToPreload,
)}, ${priority ? JSON.stringify(priority) : 'null'}, ${JSON.stringify(
bundleToPreload.target.env.outputFormat === 'esmodule',
)})`,
Expand Down Expand Up @@ -759,7 +756,6 @@ function getURLRuntime(
code = `module.exports = ${getAbsoluteUrlExpr(
relativePathExpr,
from,
to,
shardingConfig,
)};`;
}
Expand Down Expand Up @@ -834,7 +830,6 @@ function getRelativePathExpr(
function getAbsoluteUrlExpr(
relativePathExpr: string,
fromBundle: NamedBundle,
toBundle: NamedBundle,
shardingConfig: JSRuntimeConfig['domainSharding'],
) {
if (
Expand Down

0 comments on commit 547ec82

Please sign in to comment.