@backstage/cli-module-build 0.1.3 → 0.1.4-next.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @backstage/cli-module-build
|
|
2
2
|
|
|
3
|
+
## 0.1.4-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a1971ea: Suppress false-positive `@protobufjs/inquire` "Critical dependency" warning in the bundler. Since `protobufjs` 7.5.9, the dynamic require path in inquire is no longer exercised, but webpack/rspack still flags it during static analysis.
|
|
8
|
+
- 8007b58: Updated dependency `embedded-postgres` to `18.3.0-beta.17`.
|
|
9
|
+
|
|
3
10
|
## 0.1.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -300,16 +300,26 @@ async function createConfig(paths, options) {
|
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
302
|
plugins,
|
|
303
|
-
|
|
303
|
+
ignoreWarnings: [
|
|
304
|
+
// @protobufjs/inquire uses require(moduleName) with a dynamic argument.
|
|
305
|
+
// Since protobufjs >=7.5.9 this code path is never exercised (the
|
|
306
|
+
// bundler-safe optional module lookups backport replaced all call sites),
|
|
307
|
+
// but webpack/rspack still statically analyzes the source and emits a
|
|
308
|
+
// "Critical dependency" warning. Safe to suppress.
|
|
309
|
+
// See https://github.com/protobufjs/protobuf.js/issues/2057
|
|
310
|
+
{
|
|
311
|
+
module: /@protobufjs[\\/]inquire/,
|
|
312
|
+
message: /Critical dependency: the request of a dependency is an expression/
|
|
313
|
+
},
|
|
304
314
|
// TODO: remove this warning skipping as soon as the corresponding bundler limitation
|
|
305
315
|
// described in issue https://github.com/web-infra-dev/rspack/issues/13635 is fixed
|
|
306
316
|
// when PR: https://github.com/web-infra-dev/rspack/pull/13636 is merged.
|
|
307
|
-
|
|
317
|
+
...options.moduleFederationRemote ? [
|
|
308
318
|
{
|
|
309
319
|
message: /No version specified and unable to automatically determine one\. No version in description file/
|
|
310
320
|
}
|
|
311
|
-
]
|
|
312
|
-
|
|
321
|
+
] : []
|
|
322
|
+
]
|
|
313
323
|
};
|
|
314
324
|
}
|
|
315
325
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs.js","sources":["../../../src/lib/bundler/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve as resolvePath } from 'node:path';\nimport { BundlingOptions, ModuleFederationRemoteOptions } from './types';\nimport { rspack, Configuration } from '@rspack/core';\n\nimport { BundlingPaths } from './paths';\nimport { Config } from '@backstage/config';\nimport ESLintRspackPlugin from 'eslint-rspack-plugin';\nimport { TsCheckerRspackPlugin } from 'ts-checker-rspack-plugin';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport ModuleScopePlugin from 'react-dev-utils/ModuleScopePlugin';\nimport { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';\n\nimport fs from 'fs-extra';\nimport { optimization as optimizationConfig } from './optimization';\nimport pickBy from 'lodash/pickBy';\nimport { findOwnPaths, runOutput, targetPaths } from '@backstage/cli-common';\n\nimport { transforms } from './transforms';\nimport { version } from '../../../package.json';\nimport yn from 'yn';\nimport { hasReactDomClient } from './hasReactDomClient';\nimport { createWorkspaceLinkingPlugins } from './linkWorkspaces';\nimport { ConfigInjectingHtmlWebpackPlugin } from './ConfigInjectingHtmlWebpackPlugin';\n\nexport function resolveBaseUrl(\n config: Config,\n moduleFederationRemote?: ModuleFederationRemoteOptions,\n): URL {\n const baseUrl = config.getOptionalString('app.baseUrl');\n\n const defaultBaseUrl = moduleFederationRemote\n ? `http://localhost:${process.env.PORT ?? '3000'}`\n : 'http://localhost:3000';\n\n try {\n return new URL(baseUrl ?? '/', defaultBaseUrl);\n } catch (error) {\n throw new Error(`Invalid app.baseUrl, ${error}`);\n }\n}\n\nexport function resolveEndpoint(\n config: Config,\n moduleFederationRemote?: ModuleFederationRemoteOptions,\n): {\n host: string;\n port: number;\n} {\n const url = resolveBaseUrl(config, moduleFederationRemote);\n\n return {\n host: config.getOptionalString('app.listen.host') ?? url.hostname,\n port:\n config.getOptionalNumber('app.listen.port') ??\n Number(url.port) ??\n (url.protocol === 'https:' ? 443 : 80),\n };\n}\n\nasync function readBuildInfo() {\n const timestamp = Date.now();\n\n let commit: string | undefined;\n try {\n commit = await runOutput(['git', 'rev-parse', 'HEAD']);\n } catch (error) {\n // ignore, see below\n }\n\n let gitVersion: string | undefined;\n try {\n gitVersion = await runOutput(['git', 'describe', '--always']);\n } catch (error) {\n // ignore, see below\n }\n\n if (commit === undefined || gitVersion === undefined) {\n console.info(\n 'NOTE: Did not compute git version or commit hash, could not execute the git command line utility',\n );\n }\n\n const { version: packageVersion } = await fs.readJson(\n targetPaths.resolve('package.json'),\n );\n\n return {\n cliVersion: version,\n gitVersion: gitVersion ?? 'unknown',\n packageVersion,\n timestamp,\n commit: commit ?? 'unknown',\n };\n}\n\nexport async function createConfig(\n paths: BundlingPaths,\n options: BundlingOptions,\n): Promise<Configuration> {\n const {\n checksEnabled,\n isDev,\n frontendConfig,\n moduleFederationRemote,\n publicSubPath = '',\n webpack,\n } = options;\n\n const { plugins, loaders } = transforms(options);\n // Any package that is part of the monorepo but outside the monorepo root dir need\n // separate resolution logic.\n\n const validBaseUrl = resolveBaseUrl(frontendConfig, moduleFederationRemote);\n let publicPath = validBaseUrl.pathname.replace(/\\/$/, '');\n if (publicSubPath) {\n publicPath = `${publicPath}${publicSubPath}`.replace('//', '/');\n }\n\n if (isDev) {\n const { host, port } = resolveEndpoint(\n options.frontendConfig,\n options.moduleFederationRemote,\n );\n\n const refreshOptions = {\n overlay: {\n sockProtocol: 'ws',\n sockHost: host,\n sockPort: port,\n },\n } as const;\n\n if (webpack) {\n const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');\n plugins.push(new ReactRefreshPlugin(refreshOptions));\n } else {\n const RspackReactRefreshPlugin = require('@rspack/plugin-react-refresh');\n plugins.push(new RspackReactRefreshPlugin(refreshOptions));\n }\n }\n\n if (checksEnabled) {\n const TsCheckerPlugin = webpack\n ? (require('fork-ts-checker-webpack-plugin') as typeof import('fork-ts-checker-webpack-plugin'))\n : TsCheckerRspackPlugin;\n const ESLintPlugin = webpack\n ? (require('eslint-webpack-plugin') as typeof import('eslint-webpack-plugin'))\n : ESLintRspackPlugin;\n plugins.push(\n new TsCheckerPlugin({\n typescript: { configFile: paths.targetTsConfig, memoryLimit: 8192 },\n }),\n new ESLintPlugin({\n cache: false, // Cache seems broken\n context: paths.targetPath,\n files: ['**/*.(ts|tsx|mts|cts|js|jsx|mjs|cjs)'],\n }),\n );\n }\n\n const bundler = webpack ? (webpack as unknown as typeof rspack) : rspack;\n\n // TODO(blam): process is no longer auto polyfilled by webpack in v5.\n // we use the provide plugin to provide this polyfill, but lets look\n // to remove this eventually!\n plugins.push(\n new bundler.ProvidePlugin({\n process: require.resolve('process/browser'),\n Buffer: ['buffer', 'Buffer'],\n }),\n );\n\n if (!options.moduleFederationRemote) {\n const templateOptions = {\n meta: {\n 'backstage-app-mode': options?.appMode ?? 'public',\n },\n template: paths.targetHtml,\n templateParameters: {\n publicPath,\n config: frontendConfig,\n },\n };\n if (webpack) {\n // Config injection via index.html doesn't work across reloads with\n // WebPack, so we rely on the APP_CONFIG injection instead\n plugins.push(new HtmlWebpackPlugin(templateOptions));\n } else {\n // With Rspack we inject config via index.html, this is both because we\n // can't use APP_CONFIG due to the lack of support for runtime values, but\n // also because we are able to do it and it lines up better with what the\n // app-backend is doing.\n //\n // We still use the html plugin from WebPack, since the Rspack one won't\n // let us inject complex objects like the config.\n plugins.push(\n new ConfigInjectingHtmlWebpackPlugin(\n templateOptions,\n options.getFrontendAppConfigs,\n ),\n );\n }\n plugins.push(\n new HtmlWebpackPlugin({\n meta: {\n 'backstage-app-mode': options?.appMode ?? 'public',\n // This is added to be written in the later step, and finally read by the extra entry point\n 'backstage-public-path': '<%= publicPath %>/',\n },\n minify: false,\n publicPath: '<%= publicPath %>',\n filename: 'index.html.tmpl',\n template: `${require.resolve('raw-loader')}!${paths.targetHtml}`,\n }),\n );\n }\n\n if (options.moduleFederationRemote) {\n const AdaptedModuleFederationPlugin = webpack\n ? (require('@module-federation/enhanced/webpack')\n .ModuleFederationPlugin as unknown as typeof ModuleFederationPlugin)\n : ModuleFederationPlugin;\n\n const exposes = options.moduleFederationRemote.exposes\n ? Object.fromEntries(\n Object.entries(options.moduleFederationRemote?.exposes).map(\n ([k, v]) => [k, resolvePath(paths.targetPath, v)],\n ),\n )\n : {\n '.': paths.targetEntry,\n };\n\n plugins.push(\n new AdaptedModuleFederationPlugin({\n filename: 'remoteEntry.js',\n exposes,\n name: options.moduleFederationRemote.name,\n runtime: false,\n shared: options.moduleFederationRemote.sharedDependencies,\n }),\n );\n }\n\n const buildInfo = await readBuildInfo();\n\n plugins.push(\n webpack\n ? new webpack.DefinePlugin({\n 'process.env.BUILD_INFO': JSON.stringify(buildInfo),\n 'process.env.APP_CONFIG': webpack.DefinePlugin.runtimeValue(\n () => JSON.stringify(options.getFrontendAppConfigs()),\n true,\n ),\n // This allows for conditional imports of react-dom/client, since there's no way\n // to check for presence of it in source code without module resolution errors.\n 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(\n hasReactDomClient(),\n ),\n })\n : new bundler.DefinePlugin({\n 'process.env.BUILD_INFO': JSON.stringify(buildInfo),\n 'process.env.APP_CONFIG': JSON.stringify([]), // Inject via index.html instead\n // This allows for conditional imports of react-dom/client, since there's no way\n // to check for presence of it in source code without module resolution errors.\n 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(\n hasReactDomClient(),\n ),\n }),\n );\n\n if (options.linkedWorkspace) {\n plugins.push(\n ...(await createWorkspaceLinkingPlugins(\n bundler,\n options.linkedWorkspace,\n )),\n );\n }\n\n // These files are required by the transpiled code when using React Refresh.\n // They need to be excluded to the module scope plugin which ensures that files\n // that exist in the package are required.\n const reactRefreshFiles = webpack\n ? [\n require.resolve(\n '@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js',\n ),\n require.resolve(\n '@pmmmwh/react-refresh-webpack-plugin/overlay/index.js',\n ),\n require.resolve('react-refresh'),\n ]\n : [];\n\n const mode = isDev ? 'development' : 'production';\n const optimization = optimizationConfig(options);\n\n return {\n mode,\n profile: false,\n ...(isDev\n ? {\n watchOptions: {\n ignored: /node_modules\\/(?!__backstage-autodetected-plugins__)/,\n },\n }\n : {}),\n optimization,\n bail: false,\n performance: {\n hints: false, // we check the gzip size instead\n },\n devtool: isDev ? 'eval-cheap-module-source-map' : 'source-map',\n context: paths.targetPath,\n entry: [\n /* eslint-disable-next-line no-restricted-syntax */\n findOwnPaths(__dirname).resolve('config/webpack-public-path'),\n ...(options.additionalEntryPoints ?? []),\n paths.targetEntry,\n ],\n resolve: {\n extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.wasm'],\n mainFields: ['browser', 'module', 'main'],\n fallback: {\n ...pickBy(require('node-stdlib-browser')),\n module: false,\n dgram: false,\n dns: false,\n fs: false,\n http2: false,\n net: false,\n tls: false,\n child_process: false,\n\n /* new ignores */\n path: false,\n https: false,\n http: false,\n util: require.resolve('util/'),\n },\n // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408\n ...(webpack && {\n plugins: [\n new ModuleScopePlugin(\n [paths.targetSrc, paths.targetDev],\n [paths.targetPackageJson, ...reactRefreshFiles],\n ),\n ],\n }),\n },\n module: {\n rules: loaders,\n },\n output: {\n uniqueName: options.moduleFederationRemote?.name,\n path: paths.targetDist,\n publicPath: options.moduleFederationRemote ? 'auto' : `${publicPath}/`,\n filename: isDev ? '[name].js' : 'static/[name].[contenthash:8].js',\n chunkFilename: isDev\n ? '[name].chunk.js'\n : 'static/[name].[contenthash:8].chunk.js',\n ...(isDev\n ? {\n devtoolModuleFilenameTemplate: (info: any) =>\n `file:///${resolvePath(info.absoluteResourcePath).replace(\n /\\\\/g,\n '/',\n )}`,\n }\n : {}),\n },\n experiments: {\n lazyCompilation: yn(process.env.EXPERIMENTAL_LAZY_COMPILATION),\n ...(!webpack && {\n // We're still using `style-loader` for custom `insert` option\n css: false,\n }),\n },\n plugins,\n ...(options.moduleFederationRemote && {\n // TODO: remove this warning skipping as soon as the corresponding bundler limitation\n // described in issue https://github.com/web-infra-dev/rspack/issues/13635 is fixed\n // when PR: https://github.com/web-infra-dev/rspack/pull/13636 is merged.\n ignoreWarnings: [\n {\n message:\n /No version specified and unable to automatically determine one\\. No version in description file/,\n },\n ],\n }),\n };\n}\n"],"names":["runOutput","fs","targetPaths","version","transforms","TsCheckerRspackPlugin","ESLintRspackPlugin","rspack","HtmlWebpackPlugin","ConfigInjectingHtmlWebpackPlugin","ModuleFederationPlugin","resolvePath","hasReactDomClient","createWorkspaceLinkingPlugins","optimization","optimizationConfig","findOwnPaths","pickBy","ModuleScopePlugin","yn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCO,SAAS,cAAA,CACd,QACA,sBAAA,EACK;AACL,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,iBAAA,CAAkB,aAAa,CAAA;AAEtD,EAAA,MAAM,iBAAiB,sBAAA,GACnB,CAAA,iBAAA,EAAoB,QAAQ,GAAA,CAAI,IAAA,IAAQ,MAAM,CAAA,CAAA,GAC9C,uBAAA;AAEJ,EAAA,IAAI;AACF,IAAA,OAAO,IAAI,GAAA,CAAI,OAAA,IAAW,GAAA,EAAK,cAAc,CAAA;AAAA,EAC/C,SAAS,KAAA,EAAO;AACd,IAAA,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|
1
|
+
{"version":3,"file":"config.cjs.js","sources":["../../../src/lib/bundler/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve as resolvePath } from 'node:path';\nimport { BundlingOptions, ModuleFederationRemoteOptions } from './types';\nimport { rspack, Configuration } from '@rspack/core';\n\nimport { BundlingPaths } from './paths';\nimport { Config } from '@backstage/config';\nimport ESLintRspackPlugin from 'eslint-rspack-plugin';\nimport { TsCheckerRspackPlugin } from 'ts-checker-rspack-plugin';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport ModuleScopePlugin from 'react-dev-utils/ModuleScopePlugin';\nimport { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';\n\nimport fs from 'fs-extra';\nimport { optimization as optimizationConfig } from './optimization';\nimport pickBy from 'lodash/pickBy';\nimport { findOwnPaths, runOutput, targetPaths } from '@backstage/cli-common';\n\nimport { transforms } from './transforms';\nimport { version } from '../../../package.json';\nimport yn from 'yn';\nimport { hasReactDomClient } from './hasReactDomClient';\nimport { createWorkspaceLinkingPlugins } from './linkWorkspaces';\nimport { ConfigInjectingHtmlWebpackPlugin } from './ConfigInjectingHtmlWebpackPlugin';\n\nexport function resolveBaseUrl(\n config: Config,\n moduleFederationRemote?: ModuleFederationRemoteOptions,\n): URL {\n const baseUrl = config.getOptionalString('app.baseUrl');\n\n const defaultBaseUrl = moduleFederationRemote\n ? `http://localhost:${process.env.PORT ?? '3000'}`\n : 'http://localhost:3000';\n\n try {\n return new URL(baseUrl ?? '/', defaultBaseUrl);\n } catch (error) {\n throw new Error(`Invalid app.baseUrl, ${error}`);\n }\n}\n\nexport function resolveEndpoint(\n config: Config,\n moduleFederationRemote?: ModuleFederationRemoteOptions,\n): {\n host: string;\n port: number;\n} {\n const url = resolveBaseUrl(config, moduleFederationRemote);\n\n return {\n host: config.getOptionalString('app.listen.host') ?? url.hostname,\n port:\n config.getOptionalNumber('app.listen.port') ??\n Number(url.port) ??\n (url.protocol === 'https:' ? 443 : 80),\n };\n}\n\nasync function readBuildInfo() {\n const timestamp = Date.now();\n\n let commit: string | undefined;\n try {\n commit = await runOutput(['git', 'rev-parse', 'HEAD']);\n } catch (error) {\n // ignore, see below\n }\n\n let gitVersion: string | undefined;\n try {\n gitVersion = await runOutput(['git', 'describe', '--always']);\n } catch (error) {\n // ignore, see below\n }\n\n if (commit === undefined || gitVersion === undefined) {\n console.info(\n 'NOTE: Did not compute git version or commit hash, could not execute the git command line utility',\n );\n }\n\n const { version: packageVersion } = await fs.readJson(\n targetPaths.resolve('package.json'),\n );\n\n return {\n cliVersion: version,\n gitVersion: gitVersion ?? 'unknown',\n packageVersion,\n timestamp,\n commit: commit ?? 'unknown',\n };\n}\n\nexport async function createConfig(\n paths: BundlingPaths,\n options: BundlingOptions,\n): Promise<Configuration> {\n const {\n checksEnabled,\n isDev,\n frontendConfig,\n moduleFederationRemote,\n publicSubPath = '',\n webpack,\n } = options;\n\n const { plugins, loaders } = transforms(options);\n // Any package that is part of the monorepo but outside the monorepo root dir need\n // separate resolution logic.\n\n const validBaseUrl = resolveBaseUrl(frontendConfig, moduleFederationRemote);\n let publicPath = validBaseUrl.pathname.replace(/\\/$/, '');\n if (publicSubPath) {\n publicPath = `${publicPath}${publicSubPath}`.replace('//', '/');\n }\n\n if (isDev) {\n const { host, port } = resolveEndpoint(\n options.frontendConfig,\n options.moduleFederationRemote,\n );\n\n const refreshOptions = {\n overlay: {\n sockProtocol: 'ws',\n sockHost: host,\n sockPort: port,\n },\n } as const;\n\n if (webpack) {\n const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');\n plugins.push(new ReactRefreshPlugin(refreshOptions));\n } else {\n const RspackReactRefreshPlugin = require('@rspack/plugin-react-refresh');\n plugins.push(new RspackReactRefreshPlugin(refreshOptions));\n }\n }\n\n if (checksEnabled) {\n const TsCheckerPlugin = webpack\n ? (require('fork-ts-checker-webpack-plugin') as typeof import('fork-ts-checker-webpack-plugin'))\n : TsCheckerRspackPlugin;\n const ESLintPlugin = webpack\n ? (require('eslint-webpack-plugin') as typeof import('eslint-webpack-plugin'))\n : ESLintRspackPlugin;\n plugins.push(\n new TsCheckerPlugin({\n typescript: { configFile: paths.targetTsConfig, memoryLimit: 8192 },\n }),\n new ESLintPlugin({\n cache: false, // Cache seems broken\n context: paths.targetPath,\n files: ['**/*.(ts|tsx|mts|cts|js|jsx|mjs|cjs)'],\n }),\n );\n }\n\n const bundler = webpack ? (webpack as unknown as typeof rspack) : rspack;\n\n // TODO(blam): process is no longer auto polyfilled by webpack in v5.\n // we use the provide plugin to provide this polyfill, but lets look\n // to remove this eventually!\n plugins.push(\n new bundler.ProvidePlugin({\n process: require.resolve('process/browser'),\n Buffer: ['buffer', 'Buffer'],\n }),\n );\n\n if (!options.moduleFederationRemote) {\n const templateOptions = {\n meta: {\n 'backstage-app-mode': options?.appMode ?? 'public',\n },\n template: paths.targetHtml,\n templateParameters: {\n publicPath,\n config: frontendConfig,\n },\n };\n if (webpack) {\n // Config injection via index.html doesn't work across reloads with\n // WebPack, so we rely on the APP_CONFIG injection instead\n plugins.push(new HtmlWebpackPlugin(templateOptions));\n } else {\n // With Rspack we inject config via index.html, this is both because we\n // can't use APP_CONFIG due to the lack of support for runtime values, but\n // also because we are able to do it and it lines up better with what the\n // app-backend is doing.\n //\n // We still use the html plugin from WebPack, since the Rspack one won't\n // let us inject complex objects like the config.\n plugins.push(\n new ConfigInjectingHtmlWebpackPlugin(\n templateOptions,\n options.getFrontendAppConfigs,\n ),\n );\n }\n plugins.push(\n new HtmlWebpackPlugin({\n meta: {\n 'backstage-app-mode': options?.appMode ?? 'public',\n // This is added to be written in the later step, and finally read by the extra entry point\n 'backstage-public-path': '<%= publicPath %>/',\n },\n minify: false,\n publicPath: '<%= publicPath %>',\n filename: 'index.html.tmpl',\n template: `${require.resolve('raw-loader')}!${paths.targetHtml}`,\n }),\n );\n }\n\n if (options.moduleFederationRemote) {\n const AdaptedModuleFederationPlugin = webpack\n ? (require('@module-federation/enhanced/webpack')\n .ModuleFederationPlugin as unknown as typeof ModuleFederationPlugin)\n : ModuleFederationPlugin;\n\n const exposes = options.moduleFederationRemote.exposes\n ? Object.fromEntries(\n Object.entries(options.moduleFederationRemote?.exposes).map(\n ([k, v]) => [k, resolvePath(paths.targetPath, v)],\n ),\n )\n : {\n '.': paths.targetEntry,\n };\n\n plugins.push(\n new AdaptedModuleFederationPlugin({\n filename: 'remoteEntry.js',\n exposes,\n name: options.moduleFederationRemote.name,\n runtime: false,\n shared: options.moduleFederationRemote.sharedDependencies,\n }),\n );\n }\n\n const buildInfo = await readBuildInfo();\n\n plugins.push(\n webpack\n ? new webpack.DefinePlugin({\n 'process.env.BUILD_INFO': JSON.stringify(buildInfo),\n 'process.env.APP_CONFIG': webpack.DefinePlugin.runtimeValue(\n () => JSON.stringify(options.getFrontendAppConfigs()),\n true,\n ),\n // This allows for conditional imports of react-dom/client, since there's no way\n // to check for presence of it in source code without module resolution errors.\n 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(\n hasReactDomClient(),\n ),\n })\n : new bundler.DefinePlugin({\n 'process.env.BUILD_INFO': JSON.stringify(buildInfo),\n 'process.env.APP_CONFIG': JSON.stringify([]), // Inject via index.html instead\n // This allows for conditional imports of react-dom/client, since there's no way\n // to check for presence of it in source code without module resolution errors.\n 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(\n hasReactDomClient(),\n ),\n }),\n );\n\n if (options.linkedWorkspace) {\n plugins.push(\n ...(await createWorkspaceLinkingPlugins(\n bundler,\n options.linkedWorkspace,\n )),\n );\n }\n\n // These files are required by the transpiled code when using React Refresh.\n // They need to be excluded to the module scope plugin which ensures that files\n // that exist in the package are required.\n const reactRefreshFiles = webpack\n ? [\n require.resolve(\n '@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js',\n ),\n require.resolve(\n '@pmmmwh/react-refresh-webpack-plugin/overlay/index.js',\n ),\n require.resolve('react-refresh'),\n ]\n : [];\n\n const mode = isDev ? 'development' : 'production';\n const optimization = optimizationConfig(options);\n\n return {\n mode,\n profile: false,\n ...(isDev\n ? {\n watchOptions: {\n ignored: /node_modules\\/(?!__backstage-autodetected-plugins__)/,\n },\n }\n : {}),\n optimization,\n bail: false,\n performance: {\n hints: false, // we check the gzip size instead\n },\n devtool: isDev ? 'eval-cheap-module-source-map' : 'source-map',\n context: paths.targetPath,\n entry: [\n /* eslint-disable-next-line no-restricted-syntax */\n findOwnPaths(__dirname).resolve('config/webpack-public-path'),\n ...(options.additionalEntryPoints ?? []),\n paths.targetEntry,\n ],\n resolve: {\n extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.wasm'],\n mainFields: ['browser', 'module', 'main'],\n fallback: {\n ...pickBy(require('node-stdlib-browser')),\n module: false,\n dgram: false,\n dns: false,\n fs: false,\n http2: false,\n net: false,\n tls: false,\n child_process: false,\n\n /* new ignores */\n path: false,\n https: false,\n http: false,\n util: require.resolve('util/'),\n },\n // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408\n ...(webpack && {\n plugins: [\n new ModuleScopePlugin(\n [paths.targetSrc, paths.targetDev],\n [paths.targetPackageJson, ...reactRefreshFiles],\n ),\n ],\n }),\n },\n module: {\n rules: loaders,\n },\n output: {\n uniqueName: options.moduleFederationRemote?.name,\n path: paths.targetDist,\n publicPath: options.moduleFederationRemote ? 'auto' : `${publicPath}/`,\n filename: isDev ? '[name].js' : 'static/[name].[contenthash:8].js',\n chunkFilename: isDev\n ? '[name].chunk.js'\n : 'static/[name].[contenthash:8].chunk.js',\n ...(isDev\n ? {\n devtoolModuleFilenameTemplate: (info: any) =>\n `file:///${resolvePath(info.absoluteResourcePath).replace(\n /\\\\/g,\n '/',\n )}`,\n }\n : {}),\n },\n experiments: {\n lazyCompilation: yn(process.env.EXPERIMENTAL_LAZY_COMPILATION),\n ...(!webpack && {\n // We're still using `style-loader` for custom `insert` option\n css: false,\n }),\n },\n plugins,\n ignoreWarnings: [\n // @protobufjs/inquire uses require(moduleName) with a dynamic argument.\n // Since protobufjs >=7.5.9 this code path is never exercised (the\n // bundler-safe optional module lookups backport replaced all call sites),\n // but webpack/rspack still statically analyzes the source and emits a\n // \"Critical dependency\" warning. Safe to suppress.\n // See https://github.com/protobufjs/protobuf.js/issues/2057\n {\n module: /@protobufjs[\\\\/]inquire/,\n message:\n /Critical dependency: the request of a dependency is an expression/,\n },\n // TODO: remove this warning skipping as soon as the corresponding bundler limitation\n // described in issue https://github.com/web-infra-dev/rspack/issues/13635 is fixed\n // when PR: https://github.com/web-infra-dev/rspack/pull/13636 is merged.\n ...(options.moduleFederationRemote\n ? [\n {\n message:\n /No version specified and unable to automatically determine one\\. No version in description file/,\n },\n ]\n : []),\n ],\n };\n}\n"],"names":["runOutput","fs","targetPaths","version","transforms","TsCheckerRspackPlugin","ESLintRspackPlugin","rspack","HtmlWebpackPlugin","ConfigInjectingHtmlWebpackPlugin","ModuleFederationPlugin","resolvePath","hasReactDomClient","createWorkspaceLinkingPlugins","optimization","optimizationConfig","findOwnPaths","pickBy","ModuleScopePlugin","yn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCO,SAAS,cAAA,CACd,QACA,sBAAA,EACK;AACL,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,iBAAA,CAAkB,aAAa,CAAA;AAEtD,EAAA,MAAM,iBAAiB,sBAAA,GACnB,CAAA,iBAAA,EAAoB,QAAQ,GAAA,CAAI,IAAA,IAAQ,MAAM,CAAA,CAAA,GAC9C,uBAAA;AAEJ,EAAA,IAAI;AACF,IAAA,OAAO,IA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,MAOd;AAAA,QACE,MAAA,EAAQ,yBAAA;AAAA,QACR,OAAA,EACE;AAAA,OACJ;AAAA;AAAA;AAAA;AAAA,MAIA,GAAI,QAAQ,sBAAA,GACR;AAAA,QACE;AAAA,UACE,OAAA,EACE;AAAA;AACJ,UAEF;AAAC;AACP,GACF;AACF;;;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var name = "@backstage/cli-module-build";
|
|
6
|
-
var version = "0.1.
|
|
6
|
+
var version = "0.1.4-next.0";
|
|
7
7
|
var description = "CLI module for Backstage CLI";
|
|
8
8
|
var backstage = {
|
|
9
9
|
role: "cli-module"
|
|
@@ -111,7 +111,7 @@ var devDependencies = {
|
|
|
111
111
|
"@types/lodash": "^4.14.151",
|
|
112
112
|
"@types/npm-packlist": "^3.0.0",
|
|
113
113
|
"@types/shell-quote": "^1.7.5",
|
|
114
|
-
"embedded-postgres": "18.3.0-beta.
|
|
114
|
+
"embedded-postgres": "18.3.0-beta.17"
|
|
115
115
|
};
|
|
116
116
|
var peerDependencies = {
|
|
117
117
|
"embedded-postgres": "^18.3.0-beta.16"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-module-build",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-next.0",
|
|
4
4
|
"description": "CLI module for Backstage CLI",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli-module"
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@backstage/cli-common": "
|
|
44
|
-
"@backstage/cli-node": "
|
|
45
|
-
"@backstage/config": "
|
|
46
|
-
"@backstage/config-loader": "
|
|
47
|
-
"@backstage/errors": "
|
|
48
|
-
"@backstage/module-federation-common": "
|
|
43
|
+
"@backstage/cli-common": "0.2.2",
|
|
44
|
+
"@backstage/cli-node": "0.3.2",
|
|
45
|
+
"@backstage/config": "1.3.8",
|
|
46
|
+
"@backstage/config-loader": "1.10.11",
|
|
47
|
+
"@backstage/errors": "1.3.1",
|
|
48
|
+
"@backstage/module-federation-common": "0.1.4",
|
|
49
49
|
"@manypkg/get-packages": "^1.1.3",
|
|
50
50
|
"@module-federation/enhanced": "^2.3.3",
|
|
51
51
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
"yn": "^4.0.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@backstage/backend-test-utils": "
|
|
106
|
-
"@backstage/cli": "
|
|
105
|
+
"@backstage/backend-test-utils": "1.11.4-next.0",
|
|
106
|
+
"@backstage/cli": "0.36.3-next.0",
|
|
107
107
|
"@types/fs-extra": "^11.0.0",
|
|
108
108
|
"@types/lodash": "^4.14.151",
|
|
109
109
|
"@types/npm-packlist": "^3.0.0",
|
|
110
110
|
"@types/shell-quote": "^1.7.5",
|
|
111
|
-
"embedded-postgres": "18.3.0-beta.
|
|
111
|
+
"embedded-postgres": "18.3.0-beta.17"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
114
|
"embedded-postgres": "^18.3.0-beta.16"
|