@storm-software/workspace-tools 1.30.9 → 1.30.10

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.30.9](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.30.8...workspace-tools-v1.30.9) (2023-12-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **workspace-tools:** Update package.json export to include new options ([480d5d0](https://github.com/storm-software/storm-ops/commit/480d5d06eee301206ac0ed7c03ae6d7a22835b84))
7
+
1
8
  ## [1.30.8](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.30.7...workspace-tools-v1.30.8) (2023-12-14)
2
9
 
3
10
 
package/index.js CHANGED
@@ -117280,12 +117280,82 @@ function modernConfig({
117280
117280
  outExtension
117281
117281
  };
117282
117282
  }
117283
+ function legacyConfig({
117284
+ entry,
117285
+ outDir,
117286
+ projectRoot,
117287
+ workspaceRoot,
117288
+ tsconfig = "tsconfig.json",
117289
+ splitting,
117290
+ treeshake,
117291
+ debug = false,
117292
+ external,
117293
+ banner = {},
117294
+ platform = "neutral",
117295
+ verbose = false,
117296
+ shims = true,
117297
+ define: define2,
117298
+ env: env2,
117299
+ plugins,
117300
+ generatePackageJson,
117301
+ dtsTsConfig
117302
+ }) {
117303
+ let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "legacy");
117304
+ return {
117305
+ name: "legacy",
117306
+ entry,
117307
+ format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
117308
+ target: ["es2022", "node18"],
117309
+ tsconfig,
117310
+ splitting,
117311
+ generatePackageJson,
117312
+ treeshake: treeshake ? {
117313
+ preset: "recommended"
117314
+ } : false,
117315
+ projectRoot,
117316
+ workspaceRoot,
117317
+ outDir: outputPath,
117318
+ silent: !verbose,
117319
+ metafile: true,
117320
+ shims,
117321
+ external,
117322
+ platform,
117323
+ banner,
117324
+ define: define2,
117325
+ env: env2,
117326
+ dts: false,
117327
+ experimentalDts: {
117328
+ entry,
117329
+ compilerOptions: {
117330
+ ...dtsTsConfig,
117331
+ options: {
117332
+ ...dtsTsConfig.options,
117333
+ outDir: outputPath
117334
+ }
117335
+ }
117336
+ },
117337
+ /*minify: debug ? false : "terser",
117338
+ terserOptions: {
117339
+ compress: true,
117340
+ ecma: 2020,
117341
+ keep_classnames: true,
117342
+ keep_fnames: true
117343
+ },*/
117344
+ apiReport: false,
117345
+ docModel: false,
117346
+ tsdocMetadata: false,
117347
+ sourcemap: debug,
117348
+ clean: false,
117349
+ tsconfigDecoratorMetadata: true,
117350
+ plugins,
117351
+ outExtension
117352
+ };
117353
+ }
117283
117354
  function getConfig(workspaceRoot, projectRoot, getConfigFn, {
117284
117355
  outputPath,
117285
117356
  tsConfig,
117286
117357
  additionalEntryPoints,
117287
117358
  platform,
117288
- emitOnAll = true,
117289
117359
  ...rest
117290
117360
  }) {
117291
117361
  return getConfigFn({
@@ -117494,15 +117564,15 @@ ${externalDependencies.map((dep) => {
117494
117564
  const pathToPackageJson = (0, import_path3.join)(context.root, projectRoot, "package.json");
117495
117565
  const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
117496
117566
  delete packageJson.dependencies;
117497
- externalDependencies.forEach((entry2) => {
117498
- const packageConfig = entry2.node.data;
117499
- if (packageConfig?.packageName && !!(projectGraph.externalNodes[entry2.node.name]?.type === "npm")) {
117567
+ externalDependencies.forEach((externalDependency) => {
117568
+ const packageConfig = externalDependency.node.data;
117569
+ if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
117500
117570
  const { packageName, version } = packageConfig;
117501
117571
  if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName]) {
117502
117572
  return;
117503
117573
  }
117504
117574
  packageJson.dependencies ??= {};
117505
- packageJson.dependencies[packageName] = !!projectGraph.nodes[entry2.node.name] ? "latest" : version;
117575
+ packageJson.dependencies[packageName] = !!projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
117506
117576
  }
117507
117577
  });
117508
117578
  internalDependencies.forEach((packageName) => {
@@ -117541,7 +117611,8 @@ ${externalDependencies.map((dep) => {
117541
117611
  };
117542
117612
  packageJson.exports = Object.keys(entry).reduce(
117543
117613
  (ret, key) => {
117544
- const packageJsonKey = key.startsWith("./") ? key : `./${key}`;
117614
+ let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
117615
+ packageJsonKey = packageJsonKey.replaceAll("/index", "");
117545
117616
  if (!ret[packageJsonKey]) {
117546
117617
  ret[packageJsonKey] = {
117547
117618
  import: {
@@ -117650,47 +117721,51 @@ ${(0, import_fs3.readFileSync)(file, "utf-8")}`,
117650
117721
  options.plugins.push(environmentPlugin(stormEnv));
117651
117722
  const config = (0, import_tsup.defineConfig)([
117652
117723
  ...Object.keys(entry).reduce((ret, key) => {
117653
- ret.push(
117654
- getConfig(context.root, projectRoot, modernConfig, {
117655
- ...options,
117656
- define: {
117657
- __STORM_CONFIG: JSON.stringify(stormEnv)
117658
- },
117659
- env: {
117660
- __STORM_CONFIG: JSON.stringify(stormEnv),
117661
- ...stormEnv
117662
- },
117663
- dtsTsConfig: getNormalizedTsConfig(
117664
- context.root,
117665
- options.outputPath,
117666
- (0, import_tsc.createTypeScriptCompilationOptions)(
117667
- (0, import_normalize_options.normalizeOptions)(
117668
- {
117669
- ...options,
117670
- watch: false,
117671
- main: key,
117672
- transformers: []
117673
- },
117674
- context.root,
117675
- sourceRoot,
117676
- workspaceRoot
117677
- ),
117678
- context
117679
- )
117680
- ),
117681
- banner: options.banner ? {
117682
- js: `${options.banner}
117724
+ const getConfigOptions = {
117725
+ ...options,
117726
+ define: {
117727
+ __STORM_CONFIG: JSON.stringify(stormEnv)
117728
+ },
117729
+ env: {
117730
+ __STORM_CONFIG: JSON.stringify(stormEnv),
117731
+ ...stormEnv
117732
+ },
117733
+ dtsTsConfig: getNormalizedTsConfig(
117734
+ context.root,
117735
+ options.outputPath,
117736
+ (0, import_tsc.createTypeScriptCompilationOptions)(
117737
+ (0, import_normalize_options.normalizeOptions)(
117738
+ {
117739
+ ...options,
117740
+ watch: false,
117741
+ main: entry[key],
117742
+ transformers: []
117743
+ },
117744
+ context.root,
117745
+ sourceRoot,
117746
+ workspaceRoot
117747
+ ),
117748
+ context
117749
+ )
117750
+ ),
117751
+ banner: options.banner ? {
117752
+ js: `${options.banner}
117683
117753
 
117684
117754
  `,
117685
- css: `/*
117755
+ css: `/*
117686
117756
  ${options.banner}
117687
117757
  */
117688
117758
 
117689
117759
  `
117690
- } : void 0,
117691
- outputPath: options.outputPath,
117692
- entry: key
117693
- })
117760
+ } : void 0,
117761
+ outputPath: options.outputPath,
117762
+ entry: entry[key]
117763
+ };
117764
+ ret.push(
117765
+ getConfig(context.root, projectRoot, legacyConfig, getConfigOptions)
117766
+ );
117767
+ ret.push(
117768
+ getConfig(context.root, projectRoot, modernConfig, getConfigOptions)
117694
117769
  );
117695
117770
  return ret;
117696
117771
  }, [])