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

Build CJS files via Rollup #7037

Merged
merged 37 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e162114
Remove 76 rules deprecated in 15.0.0 (#6979)
mattxwang Jun 29, 2023
c34c1c6
Remove unused modules (from deprecated rules) (#7003)
mattxwang Jun 30, 2023
07eb5eb
Remove Node.js 14 support (#7020)
ybiquitous Jul 1, 2023
b55c5d3
Remove `isStandardSyntaxMediaFeatureName` utility (#7023)
romainmenke Jul 2, 2023
d2c4c92
Refactor `mergeTestDescriptions()` test utility to migrate to ESM (#7…
ybiquitous Jul 4, 2023
9a8c52c
Build CJS files via Rollup
ybiquitous Jul 3, 2023
4dcd6a1
Check built files on CI
ybiquitous Jul 4, 2023
ceaf3f3
Migrate `lib/constants` to ESM
ybiquitous Jul 4, 2023
3ea2cbf
Add missing `lib/constants.cjs`
ybiquitous Jul 4, 2023
681878a
Run `npm run build-check` on CI
ybiquitous Jul 4, 2023
4c32fbe
Remove 76 rules deprecated in 15.0.0 (#6979)
mattxwang Jun 29, 2023
2806bd3
Remove unused modules (from deprecated rules) (#7003)
mattxwang Jun 30, 2023
3e214e0
Remove Node.js 14 support (#7020)
ybiquitous Jul 1, 2023
71bb3c5
Remove `isStandardSyntaxMediaFeatureName` utility (#7023)
romainmenke Jul 2, 2023
ac62d55
Refactor `mergeTestDescriptions()` test utility to migrate to ESM (#7…
ybiquitous Jul 4, 2023
7201870
Merge branch 'v16' into esm-rollup
ybiquitous Jul 6, 2023
6833422
Not build `lib/cli.mjs` to prevent a build error
ybiquitous Jul 7, 2023
2adec1a
Clean up `*.cjs` before build
ybiquitous Jul 7, 2023
24ff03e
Specify `auto` to Rollup `interop` option
ybiquitous Jul 7, 2023
c9a99a3
Remove `npm run build` from `npm test` script
ybiquitous Jul 7, 2023
47feb70
Ignore `*.cjs` files from Prettier and TypeScript
ybiquitous Jul 7, 2023
9ec5ac2
Update `rollup`
ybiquitous Jul 7, 2023
2475bfa
Fix `scripts/build-check.mjs`
ybiquitous Jul 7, 2023
fc4b686
Remove 76 rules deprecated in 15.0.0 (#6979)
mattxwang Jun 29, 2023
4ea781a
Remove unused modules (from deprecated rules) (#7003)
mattxwang Jun 30, 2023
ddb3868
Remove Node.js 14 support (#7020)
ybiquitous Jul 1, 2023
8b41a15
Remove `isStandardSyntaxMediaFeatureName` utility (#7023)
romainmenke Jul 2, 2023
2a68c97
Refactor `mergeTestDescriptions()` test utility to migrate to ESM (#7…
ybiquitous Jul 4, 2023
975b0bc
Merge branch 'v16' into esm-rollup
ybiquitous Jul 8, 2023
66fa3a6
Run `npm run build` on `prepare` instead of `postinstall`
ybiquitous Jul 8, 2023
db53e3c
Remove 76 rules deprecated in 15.0.0 (#6979)
mattxwang Jun 29, 2023
6ea6b18
Remove unused modules (from deprecated rules) (#7003)
mattxwang Jun 30, 2023
0fb152e
Remove Node.js 14 support (#7020)
ybiquitous Jul 1, 2023
2eb9a1b
Remove `isStandardSyntaxMediaFeatureName` utility (#7023)
romainmenke Jul 2, 2023
fb94d5e
Refactor `mergeTestDescriptions()` test utility to migrate to ESM (#7…
ybiquitous Jul 4, 2023
84afc93
Merge branch 'v16' into esm-rollup
ybiquitous Jul 8, 2023
e78b70f
Merge branch 'v16' into esm-rollup
ybiquitous Jul 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/brave-cars-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": major
---

Removed: Node.js 14 support
5 changes: 5 additions & 0 deletions .changeset/rare-squids-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": major
---

Removed: 76 rules deprecated in 15.0.0
27 changes: 26 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
test:
uses: stylelint/.github/.github/workflows/test.yml@main
with:
node-version: '["14", "16", "18", "20"]'
node-version: '["16", "18", "20"]'
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
exclude: '[{"node-version": "18", "os": "ubuntu-latest"}]' # for coverage
# HACK: `--workerIdleMemoryLimit` can avoid failures on Node.js 20. See https://github.com/jestjs/jest/issues/11956
Expand Down Expand Up @@ -51,6 +51,31 @@ jobs:
with:
files: ./.coverage/lcov.info

build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: npm

- name: Install latest npm
run: npm install --global npm

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Check built files
run: npm run build-check

spellcheck:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
scripts/**/*.css
system-tests/**/*.css
system-tests/**/*.scss

# This unit test required a parent directory structure and therefore is not inside /fixtures/globs
**/standalone-glob-parent-test/**/*.css

# Ignore built CJS files
lib/**/*.cjs
83 changes: 80 additions & 3 deletions docs/migration-guide/to-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,84 @@ Two significant changes may affect you:

### Deprecated stylistic rules

We've deprecated [76 of the rules that enforce stylistic conventions](../user-guide/rules.md#deprecated), e.g. `indentation`.
We've deprecated 76 of the rules that enforce stylistic conventions:

- `at-rule-name-case`
- `at-rule-name-newline-after`
- `at-rule-name-space-after`
- `at-rule-semicolon-newline-after`
- `at-rule-semicolon-space-before`
- `block-closing-brace-empty-line-before`
- `block-closing-brace-newline-after`
- `block-closing-brace-newline-before`
- `block-closing-brace-space-after`
- `block-closing-brace-space-before`
- `block-opening-brace-newline-after`
- `block-opening-brace-newline-before`
- `block-opening-brace-space-after`
- `block-opening-brace-space-before`
- `color-hex-case`
- `declaration-bang-space-after`
- `declaration-bang-space-before`
- `declaration-block-semicolon-newline-after`
- `declaration-block-semicolon-newline-before`
- `declaration-block-semicolon-space-after`
- `declaration-block-semicolon-space-before`
- `declaration-block-trailing-semicolon`
- `declaration-colon-newline-after`
- `declaration-colon-space-after`
- `declaration-colon-space-before`
- `function-comma-newline-after`
- `function-comma-newline-before`
- `function-comma-space-after`
- `function-comma-space-before`
- `function-max-empty-lines`
- `function-parentheses-newline-inside`
- `function-parentheses-space-inside`
- `function-whitespace-after`
- `indentation`
- `linebreaks`
- `max-empty-lines`
- `max-line-length`
- `media-feature-colon-space-after`
- `media-feature-colon-space-before`
- `media-feature-name-case`
- `media-feature-parentheses-space-inside`
- `media-feature-range-operator-space-after`
- `media-feature-range-operator-space-before`
- `media-query-list-comma-newline-after`
- `media-query-list-comma-newline-before`
- `media-query-list-comma-space-after`
- `media-query-list-comma-space-before`
- `no-empty-first-line`
- `no-eol-whitespace`
- `no-extra-semicolons`
- `no-missing-end-of-source-newline`
- `number-leading-zero`
- `number-no-trailing-zeros`
- `property-case`
- `selector-attribute-brackets-space-inside`
- `selector-attribute-operator-space-after`
- `selector-attribute-operator-space-before`
- `selector-combinator-space-after`
- `selector-combinator-space-before`
- `selector-descendant-combinator-no-non-space`
- `selector-list-comma-newline-after`
- `selector-list-comma-newline-before`
- `selector-list-comma-space-after`
- `selector-list-comma-space-before`
- `selector-max-empty-lines`
- `selector-pseudo-class-case`
- `selector-pseudo-class-parentheses-space-inside`
- `selector-pseudo-element-case`
- `string-quotes`
- `unicode-bom`
- `unit-case`
- `value-list-comma-newline-after`
- `value-list-comma-newline-before`
- `value-list-comma-space-after`
- `value-list-comma-space-before`
- `value-list-max-empty-lines`

When we created these rules, pretty printers (like [Prettier](https://prettier.io/)) didn't exist. They now offer a better way to consistently format code, especially whitespace. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Expand All @@ -20,7 +97,7 @@ By deprecating these rules, we can:
- focus on writing and maintaining rules that help you [avoid errors](../user-guide/rules.md#avoid-errors) and [enforce (non-stylistic) conventions](../user-guide/rules.md#enforce-conventions), both of which are unique to Stylelint
- modernize our codebase, e.g. move to ESM so that we can update our dependencies and keep Stylelint secure for you

The [deprecated rules](../user-guide/rules.md#deprecated) will still work in this release (with a deprecation warning). In preparation for the next major release, when we'll remove the rules from Stylelint, we suggest:
The deprecated rules will still work in this release (with a deprecation warning). In preparation for the next major release, when we'll remove the rules from Stylelint, we suggest:

- extending the [standard config](https://www.npmjs.com/package/stylelint-config-standard) in your configuration object, if you don't already
- removing the deprecated rules from your configuration object
Expand All @@ -43,7 +120,7 @@ Additionally, you may no longer need to extend [Prettier's Stylelint config](htt
}
```

We've removed the [deprecated rules](../user-guide/rules.md#deprecated) from the latest version of the [standard config](https://www.npmjs.com/package/stylelint-config-standard). It still helps you write consistent CSS by turning on many of the [other rules that enforce conventions](../user-guide/rules.md#enforce-conventions), e.g. most of the [`*-notation`](../user-guide/rules.md#notation), [`*-pattern`](../user-guide/rules.md#pattern) and [`*-quotes`](../user-guide/rules.md#quotes) rules.
We've removed the deprecated rules from the latest version of the [standard config](https://www.npmjs.com/package/stylelint-config-standard). It still helps you write consistent CSS by turning on many of the [other rules that enforce conventions](../user-guide/rules.md#enforce-conventions), e.g. most of the [`*-notation`](../user-guide/rules.md#notation), [`*-pattern`](../user-guide/rules.md#pattern) and [`*-quotes`](../user-guide/rules.md#quotes) rules.

There are lots of other rules we don't turn on in the [standard config](https://www.npmjs.com/package/stylelint-config-standard) and you can learn more about using them to customize Stylelint to your exact needs in our [new guide](../user-guide/customize.md).

Expand Down
14 changes: 14 additions & 0 deletions docs/migration-guide/to-16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Migrating to 16.0.0

This release contains breaking changes.

## Removed deprecated stylistic rules

We've removed the stylistic rules we deprecated in 15.0.0. See the [15.0.0 migration guide](./to-15.md) for details on how to migrate.

## Removed support for Node.js 14

Node.js 14 has reached end-of-life. We've removed support for it so that we could update some of our dependencies. You should use the following or higher versions of Node.js:

- 16.13.0
- 18.0.0
2 changes: 1 addition & 1 deletion docs/user-guide/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When using the Node.js API, the autofixed code is available as the value of the

If a source contains a:

- scoped disable comment, e.g. `/* stylelint-disable indentation */`, any problems reported by the scoped rules will not be automatically fixed anywhere in the source
- scoped disable comment, e.g. `/* stylelint-disable color-named */`, any problems reported by the scoped rules will not be automatically fixed anywhere in the source
- unscoped disable comment, i.e. `/* stylelint-disable */`, the entirety of source will not be automatically fixed

This limitation in being tracked in [issue #2643](https://github.com/stylelint/stylelint/issues/2643).
Expand Down