Skip to content

Commit

Permalink
Merge pull request #175 from microsoft/octogonz/rush-stack-schemas
Browse files Browse the repository at this point in the history
Update Rush and Heft schemas
  • Loading branch information
octogonz authored Jan 31, 2024
2 parents 1451a8e + bcfe937 commit 56b38aa
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 11 deletions.
5 changes: 5 additions & 0 deletions heft/v0/heft-jest-plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"title": "Disable Configuration Module Resolution",
"description": "If set to true, modules specified in the Jest configuration will be resolved using Jest default (rootDir-relative) resolution. Otherwise, modules will be resolved using Node module resolution.",
"type": "boolean"
},
"enableNodeEnvManagement": {
"title": "Enable management of the NODE_ENV variable",
"description": "If set to false, heft-jest-plugin will not set or unset the NODE_ENV variable. Otherwise, NODE_ENV will be set to `test` before execution and cleared after. If the NODE_ENV value is already set to a value that is not `test`, warning message appears.",
"type": "boolean"
}
}
}
24 changes: 14 additions & 10 deletions heft/v0/storybook.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@
"description": "This schema describes the \"options\" field that can be specified in heft.json when loading \"@rushstack/heft-storybook-plugin\".",
"type": "object",
"additionalProperties": false,
"required": ["storykitPackageName"],

"properties": {
"storykitPackageName": {
"title": "Specifies an NPM package that will provide the Storybook dependencies for the project.",
"description": "Storybook's conventional approach is for your app project to have direct dependencies on NPM packages such as `@storybook/react` and `@storybook/addon-essentials`. These packages have heavyweight dependencies such as Babel, Webpack, and the associated loaders and plugins needed to build the Storybook app (which is bundled completely independently from Heft). Naively adding these dependencies to your app's package.json muddies the waters of two radically different toolchains, and is likely to lead to dependency conflicts, for example if Heft installs Webpack 5 but `@storybook/react` installs Webpack 4. To solve this problem, `heft-storybook-plugin` introduces the concept of a separate \"storykit package\". All of your Storybook NPM packages are moved to be dependencies of the storykit. Storybook's browser API unfortunately isn't separated into dedicated NPM packages, but instead is exported by the Node.js toolchain packages such as `@storybook/react`. For an even cleaner separation the storykit package can simply reexport such APIs.",
"type": "string"
},
"startupModulePath": {
"title": "The module entry point that Heft serve mode should use to launch the Storybook toolchain.",
"description": "Typically it is the path loaded the `start-storybook` shell script. For example, If you are using `@storybook/react`, then the startup path would be: `\"startupModulePath\": \"@storybook/react/bin/index.js\"`",
"type": "string",
"pattern": "[^\\\\]"
"cliCallingConvention": {
"title": "Specifies the calling convention of the storybook CLI based on the storybook version.",
"description": "Specify how the Storybook CLI should be invoked. Possible values: \"storybook6\" or \"storybook7\", defaults to \"storybook7\".",
"enum": ["storybook6", "storybook7"]
},
"staticBuildModulePath": {
"title": "The module entry point that Heft non-serve mode should use to launch the Storybook toolchain.",
"description": "Typically it is the path loaded the `build-storybook` shell script. For example, If you are using `@storybook/react`, then the static build path would be: `\"staticBuildModulePath\": \"@storybook/react/bin/build.js\"`",
"type": "string",
"pattern": "[^\\\\]"
"cliPackageName": {
"title": "The NPM package that Heft should use to launch the Storybook toolchain.",
"description": "Specify the NPM package that provides the CLI binary to run. Defaults to `@storybook/cli` for storybook 7 and `@storybook/react` for storybook 6.",
"type": "string"
},
"staticBuildOutputFolder": {
"title": "The customized output dir for storybook static build.",
"description": "If this is empty, then it will use the storybook default output dir. If you want to change the static build output dir to staticBuildDir, then the static build output dir would be: `\"staticBuildOutputFolder\": \"staticBuildDir\"`",
"type": "string",
"pattern": "[^\\\\]"
},
"cwdPackageName": {
"title": "Specifies an NPM dependency name that is used as the CWD target for the storybook commands",
"description": "By default the plugin executes the storybook commands in the local package context, but for distribution purposes it can be useful to split the TS library and storybook exports into two packages. For example, If you create a storybook 'app' project \"my-ui-storybook-library-app\" for the storybook preview distribution, and your main UI component `library` is my-ui-storybook-library. Your 'app' project is able to compile the 'library' storybook app using the CWD target: `\"cwdPackageName\": \"my-ui-storybook-library\"`",
"type": "string"
}
}
}
4 changes: 4 additions & 0 deletions rush/v5/experiments.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"description": "If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings. This will not replay warnings from the cached build.",
"type": "boolean"
},
"buildSkipWithAllowWarningsInSuccessfulBuild": {
"description": "If true, build skipping will respect the allowWarningsInSuccessfulBuild flag and skip builds with warnings. This will not replay warnings from the skipped build.",
"type": "boolean"
},
"phasedCommands": {
"description": "If true, the phased commands feature is enabled. To use this feature, create a \"phased\" command in common/config/rush/command-line.json.",
"type": "boolean"
Expand Down
5 changes: 5 additions & 0 deletions rush/v5/pnpm-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@
"description": "This option overrides the resolution-mode in PNPM. Use it if you want to change the default resolution behavior when installing dependencies. Defaults to \"highest\".\n\nPNPM documentation: https://pnpm.io/npmrc#resolution-mode.",
"type": "string",
"enum": ["highest", "time-based", "lowest-direct"]
},

"autoInstallPeers": {
"description": "This setting determines whether PNPM will automatically install (non-optional) missing peer dependencies instead of reporting an error. With Rush, the default value is always false.\n\nPNPM documentation: https://pnpm.io/npmrc#auto-install-peers",
"type": "boolean"
}
}
}
18 changes: 18 additions & 0 deletions rush/v5/rush.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@
"type": "string",
"pattern": "^[a-z0-9.@]+([-/][a-z0-9.@]+)*$"
}
},
"subspaceName": {
"description": "(EXPERIMENTAL) An optional entry for specifying which subspace this project belongs to if the subspaces feature is enabled.",
"type": "string"
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -344,6 +348,20 @@
"items": {
"type": "string"
}
},
"preRushx": {
"description": "The list of scripts to run before rushx starts.",
"type": "array",
"items": {
"type": "string"
}
},
"postRushx": {
"description": "The list of scripts to run after rushx finishes.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
Expand Down
32 changes: 32 additions & 0 deletions rush/v5/subspaces.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rush subspace config file.",
"description": "The configuration file for enabling the subspaces feature in rush. This is an EXPERIMENTAL feature which is not yet fully implemented. To opt into the experiment, simply toggle the 'enabled' property in this file.",
"type": "object",

"properties": {
"$schema": {
"description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.",
"type": "string"
},
"subspacesEnabled": {
"description": "If true, rush will use the subspaces configuration.",
"type": "boolean"
},
"splitWorkspaceCompatibility": {
"description": "(DEPRECATED) Allows individual subspaces to be configured at the package level if that package is the only project in the subspace. Used to help migrate from a split workspace state.",
"type": "boolean"
},
"preventSelectingAllSubspaces": {
"description": "If true, requires a selector for a subspace or set of subspaces when installing.",
"type": "boolean"
},
"subspaceNames": {
"description": "Individual subspace configurations.",
"type": "array",
"items": {
"type": "string"
}
}
}
}
2 changes: 1 addition & 1 deletion rush/v5/version-policies.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"nextBump": {
"description": "Type of next version bump",
"enum": ["none", "prerelease", "minor", "patch", "major"]
"enum": ["none", "prerelease", "preminor", "minor", "patch", "major"]
},
"mainProject": {
"description": "The main project for this version policy",
Expand Down

0 comments on commit 56b38aa

Please sign in to comment.