Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(marketplace): add marketplace-cli and generate command #348

Merged
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,28 @@
"type": "module",
"packageManager": "[email protected]",
"devDependencies": {
"@backstage/catalog-model": "^1.7.3",
"@backstage/cli": "^0.27.0",
"@backstage/cli-node": "^0.2.2",
"@backstage/errors": "^1.2.7",
"@changesets/parse": "^0.4.0",
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
"@manypkg/get-packages": "^2.2.2",
"@octokit/rest": "^20.1.1",
"@red-hat-developer-hub/cli": "portal:./workspaces/repo-tools/packages/cli",
"@spotify/eslint-plugin": "^15.0.0",
"@spotify/prettier-config": "^15.0.0",
"@types/fs-extra": "^11.0.4",
"array-to-table": "^1.0.1",
"chalk": "^5.4.1",
"commander": "^13.1.0",
"eslint": "^8.6.0",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-testing-library": "^6.0.0",
"fs-extra": "11.3.0",
"husky": "^9.0.11",
"js-yaml": "^4.1.0",
"lint-staged": "^15.2.2",
"lodash.escaperegexp": "^4.1.2",
"node-fetch": "^2.6.7",
Expand Down
1 change: 1 addition & 0 deletions workspaces/marketplace/packages/cli/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
29 changes: 29 additions & 0 deletions workspaces/marketplace/packages/cli/bin/marketplace-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node
/*
* Copyright 2020 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('path');

// Figure out whether we're running inside the backstage repo or as an installed dependency
/* eslint-disable-next-line no-restricted-syntax */
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));

if (!isLocal) {
require('..');
} else {
require('@backstage/cli/config/nodeTransform.cjs');
require('../src');
}
1 change: 1 addition & 0 deletions workspaces/marketplace/packages/cli/knip-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Knip report
58 changes: 58 additions & 0 deletions workspaces/marketplace/packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@red-hat-developer-hub/marketplace-cli",
"description": "CLI for the Marketplace",
"version": "0.0.1",
"backstage": {
"role": "cli"
},
"private": true,
"homepage": "https://red.ht/rhdh",
"repository": {
"type": "git",
"url": "https://github.com/redhat-developer/rhdh-plugins",
"directory": "workspaces/marketplace/packages/cli"
},
"keywords": [
"backstage"
],
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
"scripts": {
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"start": "nodemon --"
},
"bin": "bin/marketplace-cli",
"files": [
"bin",
"dist/**/*.js"
],
"dependencies": {
"@backstage/catalog-model": "^1.7.0",
"@backstage/cli": "^0.26.11",
"@backstage/cli-node": "^0.2.7",
"@backstage/errors": "^1.2.4",
"@manypkg/get-packages": "^2.2.1",
"@red-hat-developer-hub/backstage-plugin-marketplace-common": "workspace:^",
"chalk": "^4.1.2",
"commander": "^12.0.0",
"find-up": "^5.0.0",
"fs-extra": "^11.2.0",
"inquirer": "^8.0.0",
"replace-in-file": "^7.1.0",
"semver": "^7.6.0",
"ts-morph": "^23.0.0",
"yaml": "^2.7.0"
},
"nodemonConfig": {
"watch": "./src",
"exec": "bin/marketplace-cli",
"ext": "ts"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/inquirer": "^9.0.7"
}
}
Loading
Loading