-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1348 from david-heidema/feat/migrate-scaffolder-b…
…ackend-module-utils-to-new-backend Feat/migrate scaffolder backend module utils to new backend
- Loading branch information
Showing
6 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@roadiehq/scaffolder-backend-module-utils': minor | ||
--- | ||
|
||
Update to new backend system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2021 Larder Software Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export * from './zip'; | ||
export * from './fs'; | ||
export * from './merge'; | ||
export * from './sleep'; | ||
export * from './jsonata'; | ||
export * from './serialize'; |
51 changes: 51 additions & 0 deletions
51
plugins/scaffolder-actions/scaffolder-backend-module-utils/src/module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2024 Larder Software Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { createBackendModule } from '@backstage/backend-plugin-api'; | ||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha'; | ||
import * as backendModuleUtils from './actions'; | ||
|
||
/** | ||
* @public | ||
* The Roadie Module for the Scaffolder Backend | ||
*/ | ||
export const scaffolderBackendModuleUtils = createBackendModule({ | ||
pluginId: 'scaffolder', | ||
moduleId: 'scaffolder-backend-module-utils', | ||
register({ registerInit }) { | ||
registerInit({ | ||
deps: { | ||
scaffolder: scaffolderActionsExtensionPoint, | ||
}, | ||
async init({ scaffolder }) { | ||
scaffolder.addActions( | ||
backendModuleUtils.createAppendFileAction(), | ||
backendModuleUtils.createJSONataAction(), | ||
backendModuleUtils.createJsonJSONataTransformAction(), | ||
backendModuleUtils.createMergeAction(), | ||
backendModuleUtils.createMergeJSONAction({}), | ||
backendModuleUtils.createParseFileAction(), | ||
backendModuleUtils.createReplaceInFileAction(), | ||
backendModuleUtils.createSerializeJsonAction(), | ||
backendModuleUtils.createSerializeYamlAction(), | ||
backendModuleUtils.createSleepAction(), | ||
backendModuleUtils.createWriteFileAction(), | ||
backendModuleUtils.createYamlJSONataTransformAction(), | ||
backendModuleUtils.createZipAction(), | ||
); | ||
}, | ||
}); | ||
}, | ||
}); |
17 changes: 17 additions & 0 deletions
17
plugins/scaffolder-actions/scaffolder-backend-module-utils/src/new-backend.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright 2024 Larder Software Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export * from './module'; | ||
export { scaffolderBackendModuleUtils as default } from './module'; |