@storm-software/workspace-tools 1.177.2 → 1.178.1
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 +7 -0
- package/README.md +1 -1
- package/index.js +21 -16
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/rollup/executor.js +21 -16
- package/src/executors/rollup/utils/get-options.d.ts +2 -1
package/package.json
CHANGED
|
@@ -409522,7 +409522,7 @@ function analyze() {
|
|
|
409522
409522
|
}
|
|
409523
409523
|
};
|
|
409524
409524
|
}
|
|
409525
|
-
function withRollupConfig(rawOptions, rollupConfig = {}, dependencies) {
|
|
409525
|
+
function withRollupConfig(rawOptions, rollupConfig = {}, dependencies, config) {
|
|
409526
409526
|
const finalConfig = { ...rollupConfig };
|
|
409527
409527
|
const projectNode = getProjectNode();
|
|
409528
409528
|
const projectRoot = (0, import_node_path13.join)(import_devkit2.workspaceRoot, projectNode.data.root);
|
|
@@ -409659,13 +409659,14 @@ function withRollupConfig(rawOptions, rollupConfig = {}, dependencies) {
|
|
|
409659
409659
|
tsconfig: options.tsConfig,
|
|
409660
409660
|
tsconfigOverride: {
|
|
409661
409661
|
compilerOptions: createTsCompilerOptions(
|
|
409662
|
-
projectRoot,
|
|
409663
409662
|
tsConfig,
|
|
409664
409663
|
options,
|
|
409665
|
-
dependencies
|
|
409664
|
+
dependencies,
|
|
409665
|
+
config
|
|
409666
409666
|
)
|
|
409667
409667
|
},
|
|
409668
|
-
verbosity: 3
|
|
409668
|
+
verbosity: 3,
|
|
409669
|
+
useTsconfigDeclarationDir: true
|
|
409669
409670
|
}),
|
|
409670
409671
|
(0, import_type_definitions.typeDefinitions)({
|
|
409671
409672
|
projectRoot
|
|
@@ -409726,18 +409727,18 @@ function createInput(options) {
|
|
|
409726
409727
|
});
|
|
409727
409728
|
return input;
|
|
409728
409729
|
}
|
|
409729
|
-
function createTsCompilerOptions(
|
|
409730
|
+
function createTsCompilerOptions(parsedCommandLine, options, dependencies, config) {
|
|
409730
409731
|
const compilerOptionPaths = (0, import_buildable_libs_utils.computeCompilerOptionsPaths)(
|
|
409731
|
-
|
|
409732
|
+
parsedCommandLine,
|
|
409732
409733
|
dependencies ?? []
|
|
409733
409734
|
);
|
|
409734
409735
|
const compilerOptions = {
|
|
409735
|
-
rootDir:
|
|
409736
|
+
rootDir: config?.workspaceRoot,
|
|
409736
409737
|
allowJs: options.allowJs,
|
|
409737
409738
|
declaration: true,
|
|
409738
409739
|
paths: compilerOptionPaths
|
|
409739
409740
|
};
|
|
409740
|
-
if (
|
|
409741
|
+
if (parsedCommandLine.options.module === ts.ModuleKind.CommonJS) {
|
|
409741
409742
|
compilerOptions["module"] = "ESNext";
|
|
409742
409743
|
}
|
|
409743
409744
|
if (options.compiler === "swc") {
|
|
@@ -409848,7 +409849,11 @@ ${formatLogMessage2(options)}`, config);
|
|
|
409848
409849
|
perf: true,
|
|
409849
409850
|
treeshake: true
|
|
409850
409851
|
};
|
|
409851
|
-
const rollupOptions = await createRollupOptions(
|
|
409852
|
+
const rollupOptions = await createRollupOptions(
|
|
409853
|
+
normalizedOptions,
|
|
409854
|
+
context,
|
|
409855
|
+
config
|
|
409856
|
+
);
|
|
409852
409857
|
const outfile = resolveOutfile(context, normalizedOptions);
|
|
409853
409858
|
if (normalizedOptions.watch) {
|
|
409854
409859
|
return yield* (0, import_async_iterable.createAsyncIterable)(({ next }) => {
|
|
@@ -409901,7 +409906,7 @@ ${formatLogMessage2(options)}`, config);
|
|
|
409901
409906
|
}
|
|
409902
409907
|
}
|
|
409903
409908
|
}
|
|
409904
|
-
async function createRollupOptions(options, context) {
|
|
409909
|
+
async function createRollupOptions(options, context, config) {
|
|
409905
409910
|
const { dependencies } = (0, import_buildable_libs_utils2.calculateProjectBuildableDependencies)(
|
|
409906
409911
|
context.taskGraph,
|
|
409907
409912
|
context.projectGraph,
|
|
@@ -409911,7 +409916,7 @@ async function createRollupOptions(options, context) {
|
|
|
409911
409916
|
context.configurationName,
|
|
409912
409917
|
true
|
|
409913
409918
|
);
|
|
409914
|
-
const rollupConfig = withRollupConfig(options, {}, dependencies);
|
|
409919
|
+
const rollupConfig = withRollupConfig(options, {}, dependencies, config);
|
|
409915
409920
|
const generatePackageJsonPlugin = Array.isArray(rollupConfig.plugins) ? rollupConfig.plugins.find(
|
|
409916
409921
|
(p2) => p2?.["name"] === import_generate_package_json2.pluginName
|
|
409917
409922
|
) : null;
|
|
@@ -409920,16 +409925,16 @@ async function createRollupOptions(options, context) {
|
|
|
409920
409925
|
);
|
|
409921
409926
|
let finalConfig = rollupConfig;
|
|
409922
409927
|
for (const _config of userDefinedRollupConfigs) {
|
|
409923
|
-
const
|
|
409924
|
-
if (typeof
|
|
409925
|
-
finalConfig =
|
|
409928
|
+
const config2 = await _config;
|
|
409929
|
+
if (typeof config2 === "function") {
|
|
409930
|
+
finalConfig = config2(finalConfig, options);
|
|
409926
409931
|
} else {
|
|
409927
409932
|
finalConfig = {
|
|
409928
409933
|
...finalConfig,
|
|
409929
|
-
...
|
|
409934
|
+
...config2,
|
|
409930
409935
|
plugins: [
|
|
409931
409936
|
...Array.isArray(finalConfig.plugins) && finalConfig.plugins?.length > 0 ? finalConfig.plugins : [],
|
|
409932
|
-
...
|
|
409937
|
+
...config2.plugins?.length > 0 ? config2.plugins : []
|
|
409933
409938
|
]
|
|
409934
409939
|
};
|
|
409935
409940
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DependentBuildableProjectNode } from "@nx/js/src/utils/buildable-libs-utils";
|
|
2
|
+
import { StormConfig } from "@storm-software/config";
|
|
2
3
|
import * as rollup from "rollup";
|
|
3
4
|
import { RollupWithNxPluginOptions } from "./normalize-options";
|
|
4
|
-
export declare function withRollupConfig(rawOptions: RollupWithNxPluginOptions, rollupConfig?: rollup.RollupOptions, dependencies?: DependentBuildableProjectNode[]): rollup.RollupOptions;
|
|
5
|
+
export declare function withRollupConfig(rawOptions: RollupWithNxPluginOptions, rollupConfig?: rollup.RollupOptions, dependencies?: DependentBuildableProjectNode[], config?: StormConfig): rollup.RollupOptions;
|