@backstage/cli-module-build 0.1.1-next.2 → 0.1.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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/cli-module-build
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2e5c5f8: Bumped `glob` dependency from v7/v8/v11 to v13 to address security vulnerabilities in older versions. Bumped `rollup` from v4.27 to v4.59+ to fix a high severity path traversal vulnerability (GHSA-mw96-cpmx-2vgc).
|
|
8
|
+
- f1b493f: Fixed the embedded-postgres PID file being written before database initialization, which prevented the database from initializing successfully.
|
|
9
|
+
- f52a296: Suppressed false-positive Module Federation warning for shared dependencies that use secondary entry points (e.g. `@mui/material/styles`). These sub-path `package.json` files lack a `version` field, causing the bundler to emit "No version specified" warnings that fail CI builds.
|
|
10
|
+
- c16c508: When building dist-workspaces with --always-pack, batch `yarn pack` operations to avoid packing packages and their dependencies simultaneously.
|
|
11
|
+
- f14df56: Added experimental support for using `embedded-postgres` as the database for local development. Set `backend.database.client` to `embedded-postgres` in your app config to enable this. The `embedded-postgres` package must be installed as an explicit dependency in your project.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/errors@1.3.0
|
|
14
|
+
- @backstage/cli-common@0.2.1
|
|
15
|
+
- @backstage/cli-node@0.3.1
|
|
16
|
+
- @backstage/config-loader@1.10.10
|
|
17
|
+
- @backstage/config@1.3.7
|
|
18
|
+
- @backstage/module-federation-common@0.1.3
|
|
19
|
+
|
|
3
20
|
## 0.1.1-next.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -299,7 +299,17 @@ async function createConfig(paths, options) {
|
|
|
299
299
|
css: false
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
|
-
plugins
|
|
302
|
+
plugins,
|
|
303
|
+
...options.moduleFederationRemote && {
|
|
304
|
+
// TODO: remove this warning skipping as soon as the corresponding bundler limitation
|
|
305
|
+
// described in issue https://github.com/web-infra-dev/rspack/issues/13635 is fixed
|
|
306
|
+
// when PR: https://github.com/web-infra-dev/rspack/pull/13636 is merged.
|
|
307
|
+
ignoreWarnings: [
|
|
308
|
+
{
|
|
309
|
+
message: /No version specified and unable to automatically determine one\. No version in description file/
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
303
313
|
};
|
|
304
314
|
}
|
|
305
315
|
|
|
@@ -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 };\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,MAAM,IAAI,KAAA,CAAM,CAA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EAAM,OAAA,CAAQ,OAAA,CAAQ,OAAO;AAAA,OAC/B;AAAA;AAAA,MAEA,GAAI,OAAA,IAAW;AAAA,QACb,OAAA,EAAS;AAAA,UACP,IAAIC,kCAAA;AAAA,YACF,CAAC,KAAA,CAAM,SAAA,EAAW,KAAA,CAAM,SAAS,CAAA;AAAA,YACjC,CAAC,KAAA,CAAM,iBAAA,EAAmB,GAAG,iBAAiB;AAAA;AAChD;AACF;AACF,KACF;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,KACT;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,QAAQ,sBAAA,EAAwB,IAAA;AAAA,MAC5C,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,UAAA,EAAY,OAAA,CAAQ,sBAAA,GAAyB,MAAA,GAAS,GAAG,UAAU,CAAA,CAAA,CAAA;AAAA,MACnE,QAAA,EAAU,QAAQ,WAAA,GAAc,kCAAA;AAAA,MAChC,aAAA,EAAe,QACX,iBAAA,GACA,wCAAA;AAAA,MACJ,GAAI,KAAA,GACA;AAAA,QACE,+BAA+B,CAAC,IAAA,KAC9B,WAAWP,iBAAA,CAAY,IAAA,CAAK,oBAAoB,CAAA,CAAE,OAAA;AAAA,UAChD,KAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA,UAEL;AAAC,KACP;AAAA,IACA,WAAA,EAAa;AAAA,MACX,eAAA,EAAiBQ,mBAAA,CAAG,OAAA,CAAQ,GAAA,CAAI,6BAA6B,CAAA;AAAA,MAC7D,GAAI,CAAC,OAAA,IAAW;AAAA;AAAA,QAEd,GAAA,EAAK;AAAA;AACP,KACF;AAAA,IACA;AAAA,GACF;AACF;;;;;;"}
|
|
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,MAAM,IAAI,KAAA,CAAM,CAAA,qBAAA,EAAwB,KAAK,CAAA,CAAE,CAAA;AAAA,EACjD;AACF;AAEO,SAAS,eAAA,CACd,QACA,sBAAA,EAIA;AACA,EAAA,MAAM,GAAA,GAAM,cAAA,CAAe,MAAA,EAAQ,sBAAsB,CAAA;AAEzD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA,CAAO,iBAAA,CAAkB,iBAAiB,KAAK,GAAA,CAAI,QAAA;AAAA,IACzD,IAAA,EACE,MAAA,CAAO,iBAAA,CA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AA,MACN,KAAA,EAAO;AAAA,KACT;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,QAAQ,sBAAA,EAAwB,IAAA;AAAA,MAC5C,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,UAAA,EAAY,OAAA,CAAQ,sBAAA,GAAyB,MAAA,GAAS,GAAG,UAAU,CAAA,CAAA,CAAA;AAAA,MACnE,QAAA,EAAU,QAAQ,WAAA,GAAc,kCAAA;AAAA,MAChC,aAAA,EAAe,QACX,iBAAA,GACA,wCAAA;AAAA,MACJ,GAAI,KAAA,GACA;AAAA,QACE,+BAA+B,CAAC,IAAA,KAC9B,WAAWP,iBAAA,CAAY,IAAA,CAAK,oBAAoB,CAAA,CAAE,OAAA;AAAA,UAChD,KAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA,UAEL;AAAC,KACP;AAAA,IACA,WAAA,EAAa;AAAA,MACX,eAAA,EAAiBQ,mBAAA,CAAG,OAAA,CAAQ,GAAA,CAAI,6BAA6B,CAAA;AAAA,MAC7D,GAAI,CAAC,OAAA,IAAW;AAAA;AAAA,QAEd,GAAA,EAAK;AAAA;AACP,KACF;AAAA,IACA,OAAA;AAAA,IACA,GAAI,QAAQ,sBAAA,IAA0B;AAAA;AAAA;AAAA;AAAA,MAIpC,cAAA,EAAgB;AAAA,QACd;AAAA,UACE,OAAA,EACE;AAAA;AACJ;AACF;AACF,GACF;AACF;;;;;;"}
|
|
@@ -59,7 +59,6 @@ async function startEmbeddedDb() {
|
|
|
59
59
|
const password = "password";
|
|
60
60
|
const port = await portfinder.getPortPromise();
|
|
61
61
|
const tmpDir = await fs__default.default.mkdtemp(node_path.resolve(os__default.default.tmpdir(), TEMP_DIR_PREFIX));
|
|
62
|
-
await fs__default.default.writeFile(node_path.resolve(tmpDir, PID_FILE), String(process.pid));
|
|
63
62
|
const pg = new EmbeddedPostgres({
|
|
64
63
|
databaseDir: tmpDir,
|
|
65
64
|
user,
|
|
@@ -74,6 +73,7 @@ async function startEmbeddedDb() {
|
|
|
74
73
|
});
|
|
75
74
|
try {
|
|
76
75
|
await pg.initialise();
|
|
76
|
+
await fs__default.default.writeFile(node_path.resolve(tmpDir, PID_FILE), String(process.pid));
|
|
77
77
|
await pg.start();
|
|
78
78
|
} catch (error) {
|
|
79
79
|
await pg.stop().catch(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startEmbeddedDb.cjs.js","sources":["../../../src/lib/runner/startEmbeddedDb.ts"],"sourcesContent":["/*\n * Copyright 2024 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 os from 'node:os';\nimport fs from 'fs-extra';\nimport { resolve as resolvePath } from 'node:path';\nimport { getPortPromise } from 'portfinder';\nimport { ForwardedError } from '@backstage/errors';\nimport chalk from 'chalk';\n\nconst TEMP_DIR_PREFIX = 'backstage-dev-db-';\nconst PID_FILE = 'backstage.pid';\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function cleanStaleDatabases() {\n const tmpBase = os.tmpdir();\n const entries = (await fs.readdir(tmpBase)).filter(d =>\n d.startsWith(TEMP_DIR_PREFIX),\n );\n await Promise.all(\n entries.map(async d => {\n const dir = resolvePath(tmpBase, d);\n const raw = await fs\n .readFile(resolvePath(dir, PID_FILE), 'utf8')\n .catch(() => undefined);\n const pid = raw ? Number(raw.trim()) : NaN;\n if (!pid || !isProcessAlive(pid)) {\n await fs.remove(dir);\n }\n }),\n );\n}\n\nexport async function startEmbeddedDb() {\n console.warn(\n chalk.yellow(\n 'WARNING: Using embedded-postgres for local development is experimental and subject to change',\n ),\n );\n\n const { default: EmbeddedPostgres } = await import('embedded-postgres').catch(\n error => {\n throw new ForwardedError(\n `Failed to load 'embedded-postgres' which is required when using ` +\n `'embedded-postgres' as the database client. It must be installed ` +\n `as an explicit dependency in your project`,\n error,\n );\n },\n );\n\n await cleanStaleDatabases();\n\n const host = 'localhost';\n const user = 'postgres';\n const password = 'password';\n const port = await getPortPromise();\n const tmpDir = await fs.mkdtemp(resolvePath(os.tmpdir(), TEMP_DIR_PREFIX));\n\n
|
|
1
|
+
{"version":3,"file":"startEmbeddedDb.cjs.js","sources":["../../../src/lib/runner/startEmbeddedDb.ts"],"sourcesContent":["/*\n * Copyright 2024 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 os from 'node:os';\nimport fs from 'fs-extra';\nimport { resolve as resolvePath } from 'node:path';\nimport { getPortPromise } from 'portfinder';\nimport { ForwardedError } from '@backstage/errors';\nimport chalk from 'chalk';\n\nconst TEMP_DIR_PREFIX = 'backstage-dev-db-';\nconst PID_FILE = 'backstage.pid';\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function cleanStaleDatabases() {\n const tmpBase = os.tmpdir();\n const entries = (await fs.readdir(tmpBase)).filter(d =>\n d.startsWith(TEMP_DIR_PREFIX),\n );\n await Promise.all(\n entries.map(async d => {\n const dir = resolvePath(tmpBase, d);\n const raw = await fs\n .readFile(resolvePath(dir, PID_FILE), 'utf8')\n .catch(() => undefined);\n const pid = raw ? Number(raw.trim()) : NaN;\n if (!pid || !isProcessAlive(pid)) {\n await fs.remove(dir);\n }\n }),\n );\n}\n\nexport async function startEmbeddedDb() {\n console.warn(\n chalk.yellow(\n 'WARNING: Using embedded-postgres for local development is experimental and subject to change',\n ),\n );\n\n const { default: EmbeddedPostgres } = await import('embedded-postgres').catch(\n error => {\n throw new ForwardedError(\n `Failed to load 'embedded-postgres' which is required when using ` +\n `'embedded-postgres' as the database client. It must be installed ` +\n `as an explicit dependency in your project`,\n error,\n );\n },\n );\n\n await cleanStaleDatabases();\n\n const host = 'localhost';\n const user = 'postgres';\n const password = 'password';\n const port = await getPortPromise();\n const tmpDir = await fs.mkdtemp(resolvePath(os.tmpdir(), TEMP_DIR_PREFIX));\n\n const pg = new EmbeddedPostgres({\n databaseDir: tmpDir,\n user,\n password,\n port,\n persistent: false,\n onError(messageOrError) {\n console.error(`[embedded-postgres]`, messageOrError);\n },\n onLog() {},\n });\n\n try {\n await pg.initialise();\n await fs.writeFile(resolvePath(tmpDir, PID_FILE), String(process.pid));\n await pg.start();\n } catch (error) {\n await pg.stop().catch(() => {});\n await fs.remove(tmpDir).catch(() => {});\n throw error;\n }\n\n return {\n connection: {\n host,\n user,\n password,\n port,\n },\n async close() {\n await pg.stop();\n await fs.remove(tmpDir);\n },\n };\n}\n"],"names":["os","fs","resolvePath","chalk","ForwardedError","getPortPromise"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAM,eAAA,GAAkB,mBAAA;AACxB,MAAM,QAAA,GAAW,eAAA;AAEjB,SAAS,eAAe,GAAA,EAAsB;AAC5C,EAAA,IAAI;AACF,IAAA,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAC,CAAA;AACnB,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEA,eAAe,mBAAA,GAAsB;AACnC,EAAA,MAAM,OAAA,GAAUA,oBAAG,MAAA,EAAO;AAC1B,EAAA,MAAM,OAAA,GAAA,CAAW,MAAMC,mBAAA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@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-module-build",
|
|
3
|
-
"version": "0.1.1
|
|
3
|
+
"version": "0.1.1",
|
|
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": "0.2.1
|
|
44
|
-
"@backstage/cli-node": "0.3.1
|
|
45
|
-
"@backstage/config": "1.3.7
|
|
46
|
-
"@backstage/config-loader": "1.10.10
|
|
47
|
-
"@backstage/errors": "1.3.0
|
|
48
|
-
"@backstage/module-federation-common": "0.1.3
|
|
43
|
+
"@backstage/cli-common": "^0.2.1",
|
|
44
|
+
"@backstage/cli-node": "^0.3.1",
|
|
45
|
+
"@backstage/config": "^1.3.7",
|
|
46
|
+
"@backstage/config-loader": "^1.10.10",
|
|
47
|
+
"@backstage/errors": "^1.3.0",
|
|
48
|
+
"@backstage/module-federation-common": "^0.1.3",
|
|
49
49
|
"@manypkg/get-packages": "^1.1.3",
|
|
50
50
|
"@module-federation/enhanced": "^0.21.6",
|
|
51
51
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"yn": "^4.0.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@backstage/backend-test-utils": "1.11.2
|
|
106
|
-
"@backstage/cli": "0.36.1
|
|
105
|
+
"@backstage/backend-test-utils": "^1.11.2",
|
|
106
|
+
"@backstage/cli": "^0.36.1",
|
|
107
107
|
"@types/fs-extra": "^11.0.0",
|
|
108
108
|
"@types/lodash": "^4.14.151",
|
|
109
109
|
"@types/npm-packlist": "^3.0.0",
|