diff --git a/packages/cli-module-auth/bin/cli-module-auth b/packages/cli-module-auth/bin/cli-module-auth new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-auth/bin/cli-module-auth @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-auth/package.json b/packages/cli-module-auth/package.json index d00b1010f6..c3f4b55d0e 100644 --- a/packages/cli-module-auth/package.json +++ b/packages/cli-module-auth/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -47,5 +48,6 @@ "@types/fs-extra": "^11.0.0", "@types/proper-lockfile": "^4", "cross-fetch": "^4.0.0" - } + }, + "bin": "bin/cli-module-auth" } diff --git a/packages/cli-module-auth/src/cli.ts b/packages/cli-module-auth/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-auth/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-build b/packages/cli-module-build/bin/cli-module-build new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-build/bin/cli-module-build @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-build/package.json b/packages/cli-module-build/package.json index 0a4849671c..dd59b6948f 100644 --- a/packages/cli-module-build/package.json +++ b/packages/cli-module-build/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -88,5 +89,6 @@ "cross-spawn": "^7.0.6", "rollup": "^4.59.0", "ts-morph": "^24.0.0" - } + }, + "bin": "bin/cli-module-build" } diff --git a/packages/cli-module-build/src/cli.ts b/packages/cli-module-build/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-build/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-config b/packages/cli-module-config/bin/cli-module-config new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-config/bin/cli-module-config @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-config/package.json b/packages/cli-module-config/package.json index 841f40de35..bcf5059280 100644 --- a/packages/cli-module-config/package.json +++ b/packages/cli-module-config/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -46,5 +47,6 @@ }, "devDependencies": { "@backstage/cli": "workspace:^" - } + }, + "bin": "bin/cli-module-config" } diff --git a/packages/cli-module-config/src/cli.ts b/packages/cli-module-config/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-config/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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-create-github-app/bin/cli-module-create-github-app b/packages/cli-module-create-github-app/bin/cli-module-create-github-app new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-create-github-app/bin/cli-module-create-github-app @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-create-github-app/package.json b/packages/cli-module-create-github-app/package.json index 878ac0b3f8..81daa72058 100644 --- a/packages/cli-module-create-github-app/package.json +++ b/packages/cli-module-create-github-app/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -46,5 +47,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@types/fs-extra": "^11.0.0" - } + }, + "bin": "bin/cli-module-create-github-app" } diff --git a/packages/cli-module-create-github-app/src/cli.ts b/packages/cli-module-create-github-app/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-create-github-app/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-info b/packages/cli-module-info/bin/cli-module-info new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-info/bin/cli-module-info @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-info/package.json b/packages/cli-module-info/package.json index 5e1dd894e9..50f79da6f0 100644 --- a/packages/cli-module-info/package.json +++ b/packages/cli-module-info/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -40,5 +41,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@types/fs-extra": "^11.0.0" - } + }, + "bin": "bin/cli-module-info" } diff --git a/packages/cli-module-info/src/cli.ts b/packages/cli-module-info/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-info/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-lint b/packages/cli-module-lint/bin/cli-module-lint new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-lint/bin/cli-module-lint @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-lint/package.json b/packages/cli-module-lint/package.json index 40839a0046..50edbae5eb 100644 --- a/packages/cli-module-lint/package.json +++ b/packages/cli-module-lint/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -44,5 +45,6 @@ "@backstage/cli": "workspace:^", "@types/fs-extra": "^11.0.0", "@types/shell-quote": "^1.7.5" - } + }, + "bin": "bin/cli-module-lint" } diff --git a/packages/cli-module-lint/src/cli.ts b/packages/cli-module-lint/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-lint/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-maintenance b/packages/cli-module-maintenance/bin/cli-module-maintenance new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-maintenance/bin/cli-module-maintenance @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-maintenance/package.json b/packages/cli-module-maintenance/package.json index 5d321f88f0..69888e502f 100644 --- a/packages/cli-module-maintenance/package.json +++ b/packages/cli-module-maintenance/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -41,5 +42,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@types/fs-extra": "^11.0.0" - } + }, + "bin": "bin/cli-module-maintenance" } diff --git a/packages/cli-module-maintenance/src/cli.ts b/packages/cli-module-maintenance/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-maintenance/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-migrate b/packages/cli-module-migrate/bin/cli-module-migrate new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-migrate/bin/cli-module-migrate @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-migrate/package.json b/packages/cli-module-migrate/package.json index 660b85dff2..49faa42261 100644 --- a/packages/cli-module-migrate/package.json +++ b/packages/cli-module-migrate/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -44,5 +45,6 @@ "@backstage/test-utils": "workspace:^", "@types/fs-extra": "^11.0.0", "msw": "^1.0.0" - } + }, + "bin": "bin/cli-module-migrate" } diff --git a/packages/cli-module-migrate/src/cli.ts b/packages/cli-module-migrate/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-migrate/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-new b/packages/cli-module-new/bin/cli-module-new new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-new/bin/cli-module-new @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-new/package.json b/packages/cli-module-new/package.json index 5a04becd22..a49ccaa6d7 100644 --- a/packages/cli-module-new/package.json +++ b/packages/cli-module-new/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -35,5 +36,6 @@ }, "devDependencies": { "@backstage/cli": "workspace:^" - } + }, + "bin": "bin/cli-module-new" } diff --git a/packages/cli-module-new/src/cli.ts b/packages/cli-module-new/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-new/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-test-jest b/packages/cli-module-test-jest/bin/cli-module-test-jest new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-test-jest/bin/cli-module-test-jest @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-test-jest/package.json b/packages/cli-module-test-jest/package.json index 7df933dee9..5fef26bbab 100644 --- a/packages/cli-module-test-jest/package.json +++ b/packages/cli-module-test-jest/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -35,5 +36,6 @@ }, "devDependencies": { "@backstage/cli": "workspace:^" - } + }, + "bin": "bin/cli-module-test-jest" } diff --git a/packages/cli-module-test-jest/src/cli.ts b/packages/cli-module-test-jest/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-test-jest/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/cli-module-translations b/packages/cli-module-translations/bin/cli-module-translations new file mode 100755 index 0000000000..533974f6a9 --- /dev/null +++ b/packages/cli-module-translations/bin/cli-module-translations @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/* + * 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. + */ + +const path = require('node:path'); + +/* eslint-disable-next-line no-restricted-syntax */ +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 { + require('@backstage/cli/config/nodeTransform.cjs'); + require('../src/cli'); +} diff --git a/packages/cli-module-translations/package.json b/packages/cli-module-translations/package.json index 8818ff32d4..f9e642afe7 100644 --- a/packages/cli-module-translations/package.json +++ b/packages/cli-module-translations/package.json @@ -20,7 +20,8 @@ "main": "src/index.ts", "types": "src/index.ts", "files": [ - "dist" + "dist", + "bin" ], "scripts": { "build": "backstage-cli package build", @@ -35,5 +36,6 @@ }, "devDependencies": { "@backstage/cli": "workspace:^" - } + }, + "bin": "bin/cli-module-translations" } diff --git a/packages/cli-module-translations/src/cli.ts b/packages/cli-module-translations/src/cli.ts new file mode 100644 index 0000000000..6d4b925cf1 --- /dev/null +++ b/packages/cli-module-translations/src/cli.ts @@ -0,0 +1,26 @@ +/* + * 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/yarn.lock b/yarn.lock index d753c5d9cb..d0f471e49a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2819,6 +2819,8 @@ __metadata: proper-lockfile: "npm:^4.1.2" yaml: "npm:^2.0.0" zod: "npm:^3.25.76" + bin: + cli-module-auth: bin/cli-module-auth languageName: unknown linkType: soft @@ -2881,6 +2883,8 @@ __metadata: webpack: "npm:^5.105.4" webpack-dev-server: "npm:^5.2.3" yn: "npm:^4.0.0" + bin: + cli-module-build: bin/cli-module-build languageName: unknown linkType: soft @@ -2901,6 +2905,8 @@ __metadata: json-schema: "npm:^0.4.0" react-dev-utils: "npm:^12.0.0-next.60" yaml: "npm:^2.0.0" + bin: + cli-module-config: bin/cli-module-config languageName: unknown linkType: soft @@ -2921,6 +2927,8 @@ __metadata: inquirer: "npm:^8.2.0" react-dev-utils: "npm:^12.0.0-next.60" yaml: "npm:^2.0.0" + bin: + cli-module-create-github-app: bin/cli-module-create-github-app languageName: unknown linkType: soft @@ -2935,6 +2943,8 @@ __metadata: cleye: "npm:^2.3.0" fs-extra: "npm:^11.2.0" minimatch: "npm:^10.2.1" + bin: + cli-module-info: bin/cli-module-info languageName: unknown linkType: soft @@ -2953,6 +2963,8 @@ __metadata: fs-extra: "npm:^11.2.0" globby: "npm:^11.0.0" shell-quote: "npm:^1.8.1" + bin: + cli-module-lint: bin/cli-module-lint languageName: unknown linkType: soft @@ -2968,6 +2980,8 @@ __metadata: cleye: "npm:^2.3.0" eslint: "npm:^8.6.0" fs-extra: "npm:^11.2.0" + bin: + cli-module-maintenance: bin/cli-module-maintenance languageName: unknown linkType: soft @@ -2986,6 +3000,8 @@ __metadata: cleye: "npm:^2.3.0" fs-extra: "npm:^11.2.0" msw: "npm:^1.0.0" + bin: + cli-module-migrate: bin/cli-module-migrate languageName: unknown linkType: soft @@ -2995,6 +3011,8 @@ __metadata: dependencies: "@backstage/cli": "workspace:^" "@backstage/cli-node": "workspace:^" + bin: + cli-module-new: bin/cli-module-new languageName: unknown linkType: soft @@ -3004,6 +3022,8 @@ __metadata: dependencies: "@backstage/cli": "workspace:^" "@backstage/cli-node": "workspace:^" + bin: + cli-module-test-jest: bin/cli-module-test-jest languageName: unknown linkType: soft @@ -3013,6 +3033,8 @@ __metadata: dependencies: "@backstage/cli": "workspace:^" "@backstage/cli-node": "workspace:^" + bin: + cli-module-translations: bin/cli-module-translations languageName: unknown linkType: soft