diff --git a/packages/cli-module-auth/bin/backstage-cli-module-auth b/packages/cli-module-auth/bin/backstage-cli-module-auth index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-auth/bin/backstage-cli-module-auth +++ b/packages/cli-module-auth/bin/backstage-cli-module-auth @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-auth/src/cli.ts b/packages/cli-module-auth/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-auth/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-build/bin/backstage-cli-module-build b/packages/cli-module-build/bin/backstage-cli-module-build index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-build/bin/backstage-cli-module-build +++ b/packages/cli-module-build/bin/backstage-cli-module-build @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-build/src/cli.ts b/packages/cli-module-build/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-build/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-config/bin/backstage-cli-module-config b/packages/cli-module-config/bin/backstage-cli-module-config index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-config/bin/backstage-cli-module-config +++ b/packages/cli-module-config/bin/backstage-cli-module-config @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-config/src/cli.ts b/packages/cli-module-config/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-config/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-github/bin/backstage-cli-module-github b/packages/cli-module-github/bin/backstage-cli-module-github index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-github/bin/backstage-cli-module-github +++ b/packages/cli-module-github/bin/backstage-cli-module-github @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-github/src/cli.ts b/packages/cli-module-github/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-github/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-info/bin/backstage-cli-module-info b/packages/cli-module-info/bin/backstage-cli-module-info index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-info/bin/backstage-cli-module-info +++ b/packages/cli-module-info/bin/backstage-cli-module-info @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-info/src/cli.ts b/packages/cli-module-info/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-info/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-lint/bin/backstage-cli-module-lint b/packages/cli-module-lint/bin/backstage-cli-module-lint index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-lint/bin/backstage-cli-module-lint +++ b/packages/cli-module-lint/bin/backstage-cli-module-lint @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-lint/src/cli.ts b/packages/cli-module-lint/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-lint/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-maintenance/bin/backstage-cli-module-maintenance b/packages/cli-module-maintenance/bin/backstage-cli-module-maintenance index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-maintenance/bin/backstage-cli-module-maintenance +++ b/packages/cli-module-maintenance/bin/backstage-cli-module-maintenance @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-maintenance/src/cli.ts b/packages/cli-module-maintenance/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-maintenance/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-migrate/bin/backstage-cli-module-migrate b/packages/cli-module-migrate/bin/backstage-cli-module-migrate index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-migrate/bin/backstage-cli-module-migrate +++ b/packages/cli-module-migrate/bin/backstage-cli-module-migrate @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-migrate/src/cli.ts b/packages/cli-module-migrate/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-migrate/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-new/bin/backstage-cli-module-new b/packages/cli-module-new/bin/backstage-cli-module-new index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-new/bin/backstage-cli-module-new +++ b/packages/cli-module-new/bin/backstage-cli-module-new @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-new/src/cli.ts b/packages/cli-module-new/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-new/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-test-jest/bin/backstage-cli-module-test-jest b/packages/cli-module-test-jest/bin/backstage-cli-module-test-jest index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-test-jest/bin/backstage-cli-module-test-jest +++ b/packages/cli-module-test-jest/bin/backstage-cli-module-test-jest @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-test-jest/src/cli.ts b/packages/cli-module-test-jest/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-test-jest/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -}); diff --git a/packages/cli-module-translations/bin/backstage-cli-module-translations b/packages/cli-module-translations/bin/backstage-cli-module-translations index 885c06db9f..68bdc76a4a 100755 --- a/packages/cli-module-translations/bin/backstage-cli-module-translations +++ b/packages/cli-module-translations/bin/backstage-cli-module-translations @@ -22,12 +22,11 @@ const isLocal = require('node:fs').existsSync( path.resolve(__dirname, '../src'), ); -if (!isLocal) { - const { runCliModule } = require('@backstage/cli-node'); - const cliModule = require('..').default; - const pkg = require('../package.json'); - runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); -} else { +if (isLocal) { require('@backstage/cli-node/config/nodeTransform.cjs'); - require('../src/cli'); } + +const { runCliModule } = require('@backstage/cli-node'); +const cliModule = require(isLocal ? '../src/index' : '..').default; +const pkg = require('../package.json'); +runCliModule({ module: cliModule, name: pkg.name, version: pkg.version }); diff --git a/packages/cli-module-translations/src/cli.ts b/packages/cli-module-translations/src/cli.ts deleted file mode 100644 index 6d4b925cf1..0000000000 --- a/packages/cli-module-translations/src/cli.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * 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 { runCliModule } from '@backstage/cli-node'; -import cliModule from './index'; - -const pkg = require('../package.json') as { name: string; version: string }; - -runCliModule({ - module: cliModule, - name: pkg.name, - version: pkg.version, -});