2023-02-18 02:07:21 +03:00
|
|
|
/*!
|
|
|
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
|
|
* Licensed under the MIT License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
indent: "\t",
|
|
|
|
|
|
|
|
// Custom types are used to define additional fields in package.json that contain versions that should be
|
2023-02-24 01:06:22 +03:00
|
|
|
// checked/synced. See https://jamiemason.github.io/syncpack/config/custom-types for more details.
|
2023-02-18 02:07:21 +03:00
|
|
|
customTypes: {
|
2023-02-24 01:06:22 +03:00
|
|
|
engines: {
|
|
|
|
path: "engines",
|
|
|
|
strategy: "versionsByName",
|
2023-02-18 02:07:21 +03:00
|
|
|
},
|
|
|
|
packageManager: {
|
|
|
|
path: "packageManager",
|
|
|
|
strategy: "name@version",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SemverGroups are used to ensure that groups of packages use the same semver range for dependencies.
|
|
|
|
*
|
|
|
|
* semverGroup rules are applied in order to package/dep combinations. First matching rule applies. When running
|
2023-02-24 01:06:22 +03:00
|
|
|
* `syncpack lint-semver-ranges`, the output is grouped by label.
|
2023-02-18 02:07:21 +03:00
|
|
|
*/
|
|
|
|
semverGroups: [
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "engines.node should always use >= ranges",
|
|
|
|
dependencyTypes: ["engines"],
|
|
|
|
dependencies: ["node"],
|
2023-02-18 02:07:21 +03:00
|
|
|
packages: ["**"],
|
|
|
|
range: ">=",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "engines.npm should always use caret ranges",
|
|
|
|
dependencyTypes: ["engines"],
|
|
|
|
dependencies: ["npm"],
|
2023-02-18 02:07:21 +03:00
|
|
|
packages: ["**"],
|
|
|
|
range: "^",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "packageManager should always use exact dependency ranges",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencyTypes: ["packageManager"],
|
|
|
|
dependencies: ["**"],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "",
|
|
|
|
},
|
|
|
|
|
|
|
|
// PropertyDDS packages' dependencies are ignored because they use a lot of exact deps.
|
|
|
|
{
|
|
|
|
dependencies: ["**"],
|
|
|
|
packages: ["@fluid-experimental/property-*"],
|
|
|
|
isIgnored: true,
|
|
|
|
},
|
|
|
|
|
2023-03-10 00:11:12 +03:00
|
|
|
{
|
|
|
|
label: "Overridden server dependencies should always be exact versions",
|
|
|
|
dependencyTypes: ["pnpmOverrides"],
|
|
|
|
dependencies: [
|
|
|
|
"@fluidframework/gitresources",
|
|
|
|
"@fluidframework/protocol-base",
|
|
|
|
"@fluidframework/server-*",
|
|
|
|
],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "",
|
|
|
|
},
|
|
|
|
|
2023-02-18 02:07:21 +03:00
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Deps in pnpm overrides should use caret dependency ranges",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencyTypes: ["pnpmOverrides"],
|
|
|
|
dependencies: ["**"],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "^",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Must use exact dependency ranges",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencies: [
|
|
|
|
"@tiny-calc/*",
|
|
|
|
"@graphql-codegen/cli",
|
|
|
|
"@graphql-codegen/typescript",
|
2023-02-24 01:06:22 +03:00
|
|
|
"@material-ui/*",
|
2023-02-18 02:07:21 +03:00
|
|
|
"@types/chrome",
|
|
|
|
"@types/codemirror",
|
|
|
|
"@types/expect-puppeteer",
|
|
|
|
"@types/jest-environment-puppeteer",
|
|
|
|
"@types/jest",
|
|
|
|
"@types/puppeteer",
|
|
|
|
"@types/url-parse",
|
|
|
|
"fake-indexeddb",
|
|
|
|
"json-stringify-safe",
|
|
|
|
"tinylicious",
|
|
|
|
"yargs",
|
|
|
|
],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "",
|
|
|
|
},
|
|
|
|
|
|
|
|
// Some dependencies, like typescript and eslint, recommend to use tilde deps because minors introduce
|
|
|
|
// changes that may break linting
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Must use tilde dependency ranges",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencies: [
|
|
|
|
"eslint-plugin-*",
|
|
|
|
"eslint-config-prettier",
|
|
|
|
"eslint",
|
|
|
|
"less",
|
|
|
|
"prettier",
|
|
|
|
"typescript",
|
|
|
|
"vue",
|
|
|
|
"webpack-dev-server",
|
2023-05-15 21:37:48 +03:00
|
|
|
|
|
|
|
// Required due to use of "unstable" tree component APIs
|
|
|
|
"@fluentui/react-components",
|
2023-02-18 02:07:21 +03:00
|
|
|
],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "~",
|
|
|
|
},
|
|
|
|
|
|
|
|
// All deps should use caret ranges unless previously overridden
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Dependencies should use caret dependency ranges",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencies: ["**"],
|
|
|
|
dependencyTypes: ["dev", "peer", "prod"],
|
|
|
|
packages: ["**"],
|
|
|
|
range: "^",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VersionGroups are used to ensure that groups of packages use the same version of dependencies.
|
|
|
|
*
|
|
|
|
* versionGroup rules are applied in order to package/dep combinations. First matching rule applies. When running
|
2023-02-24 01:06:22 +03:00
|
|
|
* `syncpack list-mismatches`, the output is grouped by label.
|
2023-02-18 02:07:21 +03:00
|
|
|
*/
|
|
|
|
versionGroups: [
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Versions of common Fluid packages should all match",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencies: [
|
|
|
|
"@fluidframework/build-common",
|
2023-02-24 01:06:22 +03:00
|
|
|
"@fluidframework/common-utils",
|
2023-02-18 02:07:21 +03:00
|
|
|
"@fluidframework/eslint-config-fluid",
|
|
|
|
"@fluidframework/build-tools",
|
|
|
|
"@fluid-tools/build-cli",
|
|
|
|
],
|
|
|
|
packages: ["**"],
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Versions in engines field should all match",
|
|
|
|
dependencyTypes: ["engines"],
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencies: ["**"],
|
|
|
|
packages: ["**"],
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Versions in packageManager field should all match",
|
2023-02-18 02:07:21 +03:00
|
|
|
dependencyTypes: ["packageManager"],
|
|
|
|
dependencies: ["**"],
|
|
|
|
packages: ["**"],
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-02-24 01:06:22 +03:00
|
|
|
label: "Ignore interdependencies on other Fluid packages. This is needed because syncpack doesn't understand our >= < semver ranges",
|
|
|
|
isIgnored: true,
|
2023-02-18 02:07:21 +03:00
|
|
|
packages: [
|
|
|
|
"@fluid-example/**",
|
|
|
|
"@fluid-experimental/**",
|
|
|
|
"@fluid-internal/**",
|
|
|
|
"@fluid-tools/**",
|
|
|
|
"@fluidframework/**",
|
|
|
|
"fluid-framework",
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
"@fluid-example/**",
|
|
|
|
"@fluid-experimental/**",
|
|
|
|
"@fluid-internal/**",
|
|
|
|
"@fluid-tools/**",
|
|
|
|
"@fluidframework/**",
|
|
|
|
"fluid-framework",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|