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

Prepare 16.0.0 #7002

Merged
merged 95 commits into from
Nov 10, 2023
Merged

Prepare 16.0.0 #7002

merged 95 commits into from
Nov 10, 2023

Conversation

mattxwang
Copy link
Member

@mattxwang mattxwang commented Jun 29, 2023

Ref #6930

(draft PR for breaking v16 changes)

@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2023

🦋 Changeset detected

Latest commit: e0a6b5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ybiquitous
Copy link
Member

Hi @mattxwang, thanks for creating this PR so we can easily track v16 changes. 👍🏼

Just to confirm, we will need to regularly rebase the main branch, right?

@mattxwang
Copy link
Member Author

Sorry all, I've been a bit MIA as work has been taking up most of my time. Noticed that there's a minor coverage drop; is that something we should be concerned about (I could take a look at adding a missing test)

@ybiquitous
Copy link
Member

I think there is such a minor coverage drop because .mjs and .cjs files are mixed now. This will be resolved when we finish the migration to ESM. But surely we need to add test cases for CJS.

I'll quickly explain the methodology for this PR:

1. remove each `lib/rules/*` for each deprecated test
2. remove each (now invalid) path from `lib/rules/index.js`
3. fix all broken tests, which fall into one of several categories:
    - tests that use a deprecated rule as an arbitrary rule; to resolve this, I just picked a different rule (usually `color-named` for `color-hex-case` and `number-max-precision` for `indentation`)
        - one of these is about a custom plugin, so I've rewritten the plugin
    - tests that are *about* deprecated rules; I added a `.skip` (have left comments in the review)
    - fs tests that use deprecated rules; I removed these from the config, then updated the snapshot.
      - the zen garden one doesn't work "out of the box" anymore, i.e. the snapshot has nontrivially changed because of indentation/spacing rules
    - `indentation`-specific behaviour (it being last); I deleted these!
4. remove all documentation related to removed rules (mostly `indentation`)
5. remove all unused utilities (via code coverage, not manual inspection)
ybiquitous and others added 14 commits October 30, 2023 08:27
This change aims to prevent developers' misunderstandings.

See https://rollupjs.org/configuration-options/#output-banner-output-footer

Co-authored-by: Matt Wang <matt@matthewwang.me>
Bumps the eslint group with 2 updates: [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) and [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest).


Updates `eslint-plugin-import` from 2.28.1 to 2.29.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.28.1...v2.29.0)

Updates `eslint-plugin-jest` from 27.4.3 to 27.6.0
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](jest-community/eslint-plugin-jest@v27.4.3...v27.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the jest group with 1 update: [jest-preset-stylelint](https://github.com/stylelint/jest-preset-stylelint).

- [Release notes](https://github.com/stylelint/jest-preset-stylelint/releases)
- [Changelog](https://github.com/stylelint/jest-preset-stylelint/blob/main/CHANGELOG.md)
- [Commits](stylelint/jest-preset-stylelint@6.3.1...6.3.2)

---
updated-dependencies:
- dependency-name: jest-preset-stylelint
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: jest
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- `mathml-tag-names` v3 is a pure ESM package, so we cannot update it while supporting both ESM and CJS.
- `mathml-tag-names` v2 provides only a JSON file, so ESM cannot import it (raises the "ERR_IMPORT_ASSERTION_TYPE_MISSING" error).

```console
$ node -e 'import("mathml-tag-names")'
node:internal/errors:497
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///Users/masafumi.koba/git/stylelint/stylelint/node_modules/mathml-tag-names/index.json" needs an import assertion of type "json"
    at new NodeError (node:internal/errors:406:5)
    at validateAssertions (node:internal/modules/esm/assert:94:15)
    at defaultLoad (node:internal/modules/esm/load:122:3)
    at ModuleLoader.load (node:internal/modules/esm/loader:396:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56)
    at new ModuleJob (node:internal/modules/esm/module_job:65:26)
    at #createModuleJob (node:internal/modules/esm/loader:290:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:248:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:229:17)
    at async ModuleLoader.import (node:internal/modules/esm/loader:315:23) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}
```

See https://github.com/wooorm/mathml-tag-names/releases/tag/3.0.0
GitHub provides more rich UI for alerts in Markdown files (beta).

This is similar to Docusaurus Admonitions (which is used in stylelint.io),
and should improve our documentation readability.

See:
- https://github.com/orgs/community/discussions/16925
- https://docusaurus.io/docs/markdown-features/admonitions
- https://github.com/stylelint/stylelint.io/pull/357/files#r1378999753
This commit makes the following changes, including a breaking:

- Remove the `import-lazy` dependency
- Make the `stylelint.rules` object Promise-based (breaking)

Thanks to these changes, the test suite is executed for ESM rules (`lib/rules/*/index.mjs`), instead of CJS ones (`*.cjs`).
)

This change aims to reduce redundant warnings in test reports.
Note that it still cannot be removed completely where needed.

Follow-up to #7183
Bumps the eslint group with 1 update: [eslint](https://github.com/eslint/eslint).

- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.52.0...v8.53.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This change also reverts the coverage threshold settings.
Bumps [rollup](https://github.com/rollup/rollup) from 3.29.4 to 4.3.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v3.29.4...v4.3.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 14.0.1 to 15.0.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v14.0.1...v15.0.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot bot and others added 3 commits November 6, 2023 23:01
Bumps [postcss-safe-parser](https://github.com/postcss/postcss-safe-parser) from 6.0.0 to 7.0.0.
- [Changelog](https://github.com/postcss/postcss-safe-parser/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss-safe-parser@6.0.0...7.0.0)

---
updated-dependencies:
- dependency-name: postcss-safe-parser
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@ybiquitous ybiquitous mentioned this pull request Nov 8, 2023
10 tasks
This commit is necessary for Conditional Exports (ESM and CJS).
See https://nodejs.org/api/packages.html#conditional-exports
Summary:
- Rewrite TypeScript definitions to use ESM syntax, avoiding the specific syntax like `namespace`.
- Update `tsconfig.json` for ESM and Node.js 18.
- Remove no longer needed `test.d.ts`.
- Add a patch for the `is-plain-object` package to avoid type-check errors.

See also:
- https://www.typescriptlang.org/tsconfig
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing
- jonschlinkert/is-plain-object#28
@ybiquitous
Copy link
Member

Finally, #7160 should be the last PR to merge into v16. After merging #7160, we will be ready to merge this PR.

Although we may need a few changes in the documentation before the 16.0.0 release, we can also do that on the main branch.

* Bump meow from 10.1.5 to 12.1.1

Bumps [meow](https://github.com/sindresorhus/meow) from 10.1.5 to 12.1.1.
- [Release notes](https://github.com/sindresorhus/meow/releases)
- [Commits](sindresorhus/meow@v10.1.5...v12.1.1)

---
updated-dependencies:
- dependency-name: meow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Delete invalid patch for `type-fest`

* Fix `meow` breaking change to rename `alias` to `shortFlag`

* Use `aliases` instead of `shortFlag` for multiple letters

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@ybiquitous ybiquitous marked this pull request as ready for review November 9, 2023 23:50
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, we should be ready to merge. LGTM.
I want one more approval, just in case, since this is a big PR. 🤯

Note to self: we must NOT "squash and merge", but just "merge"!

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @ybiquitous! This was a colossal effort.

Let's merge so that we can release next, start testing, and patch any bugs on main before releasing 16.0.0.

@ybiquitous ybiquitous merged commit ee65277 into main Nov 10, 2023
15 of 16 checks passed
@ybiquitous ybiquitous deleted the v16 branch November 10, 2023 14:09
@mattxwang mattxwang mentioned this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants