@backstage/plugin-scaffolder-backend-module-workspace-database 0.1.2-next.0 → 0.1.2
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 +17 -0
- package/dist/module.cjs.js +2 -4
- package/dist/module.cjs.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-workspace-database
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6a0de59: Backend plugins now locate their database migrations relative to their own package directory, without requiring the package to be resolvable by name.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-plugin-api@1.12.0
|
|
10
|
+
- @backstage/plugin-scaffolder-node@1.0.0
|
|
11
|
+
|
|
12
|
+
## 0.1.2-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/backend-plugin-api@1.12.0-next.1
|
|
18
|
+
- @backstage/plugin-scaffolder-node@1.0.0-next.2
|
|
19
|
+
|
|
3
20
|
## 0.1.2-next.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/module.cjs.js
CHANGED
|
@@ -4,10 +4,8 @@ var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
|
4
4
|
var alpha = require('@backstage/plugin-scaffolder-node/alpha');
|
|
5
5
|
var DatabaseWorkspaceProvider = require('./provider/DatabaseWorkspaceProvider.cjs.js');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"migrations"
|
|
10
|
-
);
|
|
7
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
|
+
const migrationsDir = backendPluginApi.resolvePackagePath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs.js', document.baseURI).href)), "migrations");
|
|
11
9
|
const migrationsTable = "scaffolder_workspace_database_migrations";
|
|
12
10
|
const workspaceDatabaseModule = backendPluginApi.createBackendModule({
|
|
13
11
|
moduleId: "workspace-database",
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { resolvePackagePath } from '@backstage/backend-plugin-api';\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderWorkspaceProviderExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { DatabaseWorkspaceProvider } from './provider';\n\nconst migrationsDir = resolvePackagePath(
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { resolvePackagePath } from '@backstage/backend-plugin-api';\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderWorkspaceProviderExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { DatabaseWorkspaceProvider } from './provider';\n\nconst migrationsDir = resolvePackagePath(import.meta.url, 'migrations');\nconst migrationsTable = 'scaffolder_workspace_database_migrations';\n\n/**\n * @public\n * Database workspace provider module for the Scaffolder Backend.\n *\n * This module is intended for development use only. In production,\n * use an external storage provider like GCS.\n */\nexport const workspaceDatabaseModule = createBackendModule({\n moduleId: 'workspace-database',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolderWorkspaceProviders: scaffolderWorkspaceProviderExtensionPoint,\n database: coreServices.database,\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n },\n async init({ database, logger, scaffolderWorkspaceProviders, config }) {\n if (\n process.env.NODE_ENV === 'production' &&\n !config.getOptionalBoolean(\n 'scaffolder.taskRecovery.database.dangerouslyEnableInProduction',\n )\n ) {\n logger.warn(\n 'Database workspace provider is not supported in production and will not be enabled',\n );\n return;\n }\n\n const db = await database.getClient();\n\n // Run migrations for our table\n if (!database.migrations?.skip) {\n await db.migrate.latest({\n directory: migrationsDir,\n tableName: migrationsTable,\n });\n }\n\n scaffolderWorkspaceProviders.addProviders({\n database: DatabaseWorkspaceProvider.create({ db }),\n });\n },\n });\n },\n});\n"],"names":["resolvePackagePath","createBackendModule","scaffolderWorkspaceProviderExtensionPoint","coreServices","DatabaseWorkspaceProvider"],"mappings":";;;;;;;AAwBA,MAAM,aAAA,GAAgBA,mCAAA,CAAmB,+PAAY,EAAK,YAAY,CAAA;AACtE,MAAM,eAAA,GAAkB,0CAAA;AASjB,MAAM,0BAA0BC,oCAAA,CAAoB;AAAA,EACzD,QAAA,EAAU,oBAAA;AAAA,EACV,QAAA,EAAU,YAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAa,EAAG;AACzB,IAAA,YAAA,CAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,4BAAA,EAA8BC,+CAAA;AAAA,QAC9B,UAAUC,6BAAA,CAAa,QAAA;AAAA,QACvB,QAAQA,6BAAA,CAAa,MAAA;AAAA,QACrB,QAAQA,6BAAA,CAAa;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAU,MAAA,EAAQ,4BAAA,EAA8B,QAAO,EAAG;AACrE,QAAA,IACE,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,IACzB,CAAC,MAAA,CAAO,kBAAA;AAAA,UACN;AAAA,SACF,EACA;AACA,UAAA,MAAA,CAAO,IAAA;AAAA,YACL;AAAA,WACF;AACA,UAAA;AAAA,QACF;AAEA,QAAA,MAAM,EAAA,GAAK,MAAM,QAAA,CAAS,SAAA,EAAU;AAGpC,QAAA,IAAI,CAAC,QAAA,CAAS,UAAA,EAAY,IAAA,EAAM;AAC9B,UAAA,MAAM,EAAA,CAAG,QAAQ,MAAA,CAAO;AAAA,YACtB,SAAA,EAAW,aAAA;AAAA,YACX,SAAA,EAAW;AAAA,WACZ,CAAA;AAAA,QACH;AAEA,QAAA,4BAAA,CAA6B,YAAA,CAAa;AAAA,UACxC,QAAA,EAAUC,mDAAA,CAA0B,MAAA,CAAO,EAAE,IAAI;AAAA,SAClD,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-workspace-database",
|
|
3
|
-
"version": "0.1.2
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Database workspace provider module for @backstage/plugin-scaffolder-backend (development use only)",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"test": "backstage-cli package test"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@backstage/backend-plugin-api": "1.
|
|
56
|
-
"@backstage/plugin-scaffolder-node": "0.
|
|
55
|
+
"@backstage/backend-plugin-api": "^1.12.0",
|
|
56
|
+
"@backstage/plugin-scaffolder-node": "^1.0.0",
|
|
57
57
|
"knex": "^3.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@backstage/backend-defaults": "0.
|
|
61
|
-
"@backstage/backend-test-utils": "1.
|
|
62
|
-
"@backstage/cli": "0.36.8
|
|
63
|
-
"@backstage/config": "1.3.
|
|
60
|
+
"@backstage/backend-defaults": "^0.19.0",
|
|
61
|
+
"@backstage/backend-test-utils": "^1.12.0",
|
|
62
|
+
"@backstage/cli": "^0.36.8",
|
|
63
|
+
"@backstage/config": "^1.3.11",
|
|
64
64
|
"fs-extra": "^11.0.0"
|
|
65
65
|
},
|
|
66
66
|
"configSchema": "config.schema.json"
|