Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/autoinstallers/command-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"rush-lint-staged-plugin": "0.1.6",
"rush-sort-package-json": "0.0.3",
"rush-upgrade-self-plugin": "1.0.6",
"rush-metadata-plugin": "link:../../../rush-plugins/rush-metadata-plugin",
"typescript": "4.4.2"
}
}
23 changes: 16 additions & 7 deletions common/autoinstallers/command-plugins/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
"commands": [
{
"name": "meta-init",
"commandKind": "global",
"summary": "Initialize a metadata file for a project",
"shellCommand": "node <packageFolder>/lib/index.js init",
"safeForSimultaneousRushProcesses": false
},
{
"name": "meta-sync",
"commandKind": "global",
"summary": "Sync the metadata files in the monorepo",
"shellCommand": "node <packageFolder>/lib/index.js sync",
"safeForSimultaneousRushProcesses": false
}
],
"parameters": [
{
"parameterKind": "string",
"description": "The package name of the project",
"longName": "--project",
"shortName": "-p",
"argumentName": "PACKAGE_NAME",
"associatedCommands": ["meta-init"],
"required": false
},
{
"parameterKind": "flag",
"description": "Generate a metadata JSON for each project in the monorepo",
"longName": "--all",
"associatedCommands": ["meta-init"],
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugin-manifest.schema.json",
"plugins": [
{
"pluginName": "rush-metadata-plugin",
"description": "A tool for managing metadata files",
"commandLineJsonFilePath": "command-line.json",
"optionsSchema": "lib/schemas/plugin-options.schema.json"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "rush-metadata-plugin",
"comment": "Add the basic functionality to generate and update metadata files in rush projects",
"type": "minor"
}
],
"packageName": "rush-metadata-plugin"
}
57 changes: 57 additions & 0 deletions common/config/rush-plugins/rush-metadata-plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**

Custom field parameters:

field: name
desc: name of the metadata field
type: string

field: description
desc: description of the metdata field
type: string

field: type
desc: what kind of data is it
types:
- string
- number
- string[]
- number[]

field: isSelect
desc: whether this field will be a rush selector or not (passed into "--to" parameter, etc)
type: boolean
(note that this cannot be used for any type other than string)

field: required
desc: whether or not this field is required
type: boolean

*/

{
"$schema": "../../../rush-plugins/rush-metadata-plugin/customMetaSchema.json",
// "metadataFileName": "config/project-metadata.json",
"fields": [
{
"name": "productLine",
"description": "Which product line this project belongs to",
"prompt": "Which product line does this project belong to?",
"type": "string",
"required": true
},
{
"name": "environmentVars",
"description": "A list of environment variables used in this package",
"prompt": "What environment variables are required for this package?",
"type": "string",
"required": false
}
// {
// "name": "testField",
// "description": "test",
// "type": "string",
// "required": true
// }
]
}
51 changes: 48 additions & 3 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions common/config/rush/rush-plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
"packageName": "rush-upgrade-self-plugin",
"pluginName": "rush-upgrade-self-plugin",
"autoinstallerName": "command-plugins" // the name of autoinstaller you created before
},
{
"packageName": "rush-metadata-plugin",
"pluginName": "rush-metadata-plugin",
"autoinstallerName": "command-plugins" // the name of autoinstaller you created before
}
]
}
14 changes: 14 additions & 0 deletions rush-plugins/rush-metadata-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require("@rushstack/eslint-config/patch/modern-module-resolution");

module.exports = {
extends: [
"@rushstack/eslint-config/profile/node-trusted-tool",
"@rushstack/eslint-config/mixins/friendly-locals",
],
parserOptions: { tsconfigRootDir: __dirname },
ignorePatterns: ["node_modules/", "lib/"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
};
1 change: 1 addition & 0 deletions rush-plugins/rush-metadata-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
42 changes: 42 additions & 0 deletions rush-plugins/rush-metadata-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
========== This section is auto-generated by the rush metadata plugin. ==========


This section is auto-generated and will be auto-updated. Anything added manually outside this section will be preserved.

## purpose

#### <span style="color:grey">The purpose of the package.</span>


This package initializes and syncs metadata files in a monorepo.

## pointOfContact

#### <span style="color:grey">The list of package owners.</span>


william2958

## projectGroup

#### <span style="color:grey">Which project group does this package belong to?</span>


rush-plugins

## targetRuntime

#### <span style="color:grey">The environment in which the project will run.</span>


node

## productLine

#### <span style="color:grey">Which product line this project belongs to</span>


libs


========== End of auto-generated section. ==========
Loading