-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore(deps-dev): bump postcss from 8.4.29 to 8.4.31 #992
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.29...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
dependabot
bot
added
dependencies
Pull requests that update a dependency file
javascript
Pull requests that update Javascript code
labels
Oct 8, 2023
Diff between postcss 8.4.29 and 8.4.31diff --git a/lib/container.js b/lib/container.js
index v8.4.29..v8.4.31 100644
--- a/lib/container.js
+++ b/lib/container.js
@@ -65,9 +65,4 @@
}
- get first() {
- if (!this.proxyOf.nodes) return undefined
- return this.proxyOf.nodes[0]
- }
-
getIterator() {
if (!this.lastEach) this.lastEach = 0
@@ -176,9 +171,4 @@
}
- get last() {
- if (!this.proxyOf.nodes) return undefined
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]
- }
-
normalize(nodes, sample) {
if (typeof nodes === 'string') {
@@ -394,4 +384,14 @@
})
}
+
+ get first() {
+ if (!this.proxyOf.nodes) return undefined
+ return this.proxyOf.nodes[0]
+ }
+
+ get last() {
+ if (!this.proxyOf.nodes) return undefined
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]
+ }
}
diff --git a/lib/input.js b/lib/input.js
index v8.4.29..v8.4.31 100644
--- a/lib/input.js
+++ b/lib/input.js
@@ -125,8 +125,4 @@
}
- get from() {
- return this.file || this.id
- }
-
fromOffset(offset) {
let lastLine, lineToIndex
@@ -239,4 +235,8 @@
return json
}
+
+ get from() {
+ return this.file || this.id
+ }
}
diff --git a/lib/lazy-result.js b/lib/lazy-result.js
index v8.4.29..v8.4.31 100644
--- a/lib/lazy-result.js
+++ b/lib/lazy-result.js
@@ -167,12 +167,4 @@
}
- get content() {
- return this.stringify().content
- }
-
- get css() {
- return this.stringify().css
- }
-
finally(onFinally) {
return this.async().then(onFinally, onFinally)
@@ -222,16 +214,4 @@
}
- get map() {
- return this.stringify().map
- }
-
- get messages() {
- return this.sync().messages
- }
-
- get opts() {
- return this.result.opts
- }
-
prepareVisitors() {
this.listeners = {}
@@ -272,12 +252,4 @@
}
- get processor() {
- return this.result.processor
- }
-
- get root() {
- return this.sync().root
- }
-
async runAsync() {
this.plugin = 0
@@ -383,8 +355,4 @@
}
- get [Symbol.toStringTag]() {
- return 'LazyResult'
- }
-
sync() {
if (this.error) throw this.error
@@ -538,4 +506,36 @@
return this.sync().warnings()
}
+
+ get content() {
+ return this.stringify().content
+ }
+
+ get css() {
+ return this.stringify().css
+ }
+
+ get map() {
+ return this.stringify().map
+ }
+
+ get messages() {
+ return this.sync().messages
+ }
+
+ get opts() {
+ return this.result.opts
+ }
+
+ get processor() {
+ return this.result.processor
+ }
+
+ get root() {
+ return this.sync().root
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'LazyResult'
+ }
}
diff --git a/lib/map-generator.js b/lib/map-generator.js
index v8.4.29..v8.4.31 100644
--- a/lib/map-generator.js
+++ b/lib/map-generator.js
@@ -18,4 +18,8 @@
this.css = cssString
this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
+
+ this.memoizedFileURLs = new Map()
+ this.memoizedPaths = new Map()
+ this.memoizedURLs = new Map()
}
@@ -242,7 +246,9 @@
path(file) {
- if (file.indexOf('<') === 0) return file
+ if (this.mapOpts.absolute) return file
+ if (file.charCodeAt(0) === 60 /* `<` */) return file
if (/^\w+:\/\//.test(file)) return file
- if (this.mapOpts.absolute) return file
+ let cached = this.memoizedPaths.get(file)
+ if (cached) return cached
let from = this.opts.to ? dirname(this.opts.to) : '.'
@@ -252,6 +258,8 @@
}
- file = relative(from, file)
- return file
+ let path = relative(from, file)
+ this.memoizedPaths.set(file, path)
+
+ return path
}
@@ -319,6 +327,12 @@
toFileUrl(path) {
+ let cached = this.memoizedFileURLs.get(path)
+ if (cached) return cached
+
if (pathToFileURL) {
- return pathToFileURL(path).toString()
+ let fileURL = pathToFileURL(path).toString()
+ this.memoizedFileURLs.set(path, fileURL)
+
+ return fileURL
} else {
throw new Error(
@@ -329,8 +343,15 @@
toUrl(path) {
+ let cached = this.memoizedURLs.get(path)
+ if (cached) return cached
+
if (sep === '\\') {
path = path.replace(/\\/g, '/')
}
- return encodeURI(path).replace(/[#?]/g, encodeURIComponent)
+
+ let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)
+ this.memoizedURLs.set(path, url)
+
+ return url
}
}
diff --git a/lib/no-work-result.js b/lib/no-work-result.js
index v8.4.29..v8.4.31 100644
--- a/lib/no-work-result.js
+++ b/lib/no-work-result.js
@@ -50,4 +50,35 @@
}
+ finally(onFinally) {
+ return this.async().then(onFinally, onFinally)
+ }
+
+ sync() {
+ if (this.error) throw this.error
+ return this.result
+ }
+
+ then(onFulfilled, onRejected) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!('from' in this._opts)) {
+ warnOnce(
+ 'Without `from` option PostCSS could generate wrong source map ' +
+ 'and will not find Browserslist config. Set it to CSS file path ' +
+ 'or to `undefined` to prevent this warning.'
+ )
+ }
+ }
+
+ return this.async().then(onFulfilled, onRejected)
+ }
+
+ toString() {
+ return this._css
+ }
+
+ warnings() {
+ return []
+ }
+
get content() {
return this.result.css
@@ -58,8 +89,4 @@
}
- finally(onFinally) {
- return this.async().then(onFinally, onFinally)
- }
-
get map() {
return this.result.map
@@ -103,31 +130,4 @@
return 'NoWorkResult'
}
-
- sync() {
- if (this.error) throw this.error
- return this.result
- }
-
- then(onFulfilled, onRejected) {
- if (process.env.NODE_ENV !== 'production') {
- if (!('from' in this._opts)) {
- warnOnce(
- 'Without `from` option PostCSS could generate wrong source map ' +
- 'and will not find Browserslist config. Set it to CSS file path ' +
- 'or to `undefined` to prevent this warning.'
- )
- }
- }
-
- return this.async().then(onFulfilled, onRejected)
- }
-
- toString() {
- return this._css
- }
-
- warnings() {
- return []
- }
}
diff --git a/lib/node.js b/lib/node.js
index v8.4.29..v8.4.31 100644
--- a/lib/node.js
+++ b/lib/node.js
@@ -205,8 +205,4 @@
}
- get proxyOf() {
- return this
- }
-
rangeBy(opts) {
let start = {
@@ -376,4 +372,8 @@
return result.warn(text, data)
}
+
+ get proxyOf() {
+ return this
+ }
}
diff --git a/lib/processor.js b/lib/processor.js
index v8.4.29..v8.4.31 100644
--- a/lib/processor.js
+++ b/lib/processor.js
@@ -8,5 +8,5 @@
class Processor {
constructor(plugins = []) {
- this.version = '8.4.29'
+ this.version = '8.4.31'
this.plugins = this.normalize(plugins)
}
diff --git a/lib/result.js b/lib/result.js
index v8.4.29..v8.4.31 100644
--- a/lib/result.js
+++ b/lib/result.js
@@ -13,8 +13,4 @@
}
- get content() {
- return this.css
- }
-
toString() {
return this.css
@@ -37,4 +33,8 @@
return this.messages.filter(i => i.type === 'warning')
}
+
+ get content() {
+ return this.css
+ }
}
diff --git a/lib/tokenize.js b/lib/tokenize.js
index v8.4.29..v8.4.31 100644
--- a/lib/tokenize.js
+++ b/lib/tokenize.js
@@ -23,5 +23,5 @@
const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g
const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g
-const RE_BAD_BRACKET = /.[\n"'(/\\]/
+const RE_BAD_BRACKET = /.[\r\n"'(/\\]/
const RE_HEX_ESCAPE = /[\da-f]/i
diff --git a/package.json b/package.json
index v8.4.29..v8.4.31 100755
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
"name": "postcss",
- "version": "8.4.29",
+ "version": "8.4.31",
"description": "Tool for transforming styles with JS plugins",
"engines": {
diff --git a/README.md b/README.md
index v8.4.29..v8.4.31 100644
--- a/README.md
+++ b/README.md
@@ -10,30 +10,19 @@
PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
-and JetBrains. The [Autoprefixer] PostCSS plugin is one of the most popular
-CSS processors.
+and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of the most popular CSS tools.
-PostCSS takes a CSS file and provides an API to analyze and modify its rules
-(by transforming them into an [Abstract Syntax Tree]).
-This API can then be used by [plugins] to do a lot of useful things,
-e.g., to find errors automatically, or to insert vendor prefixes.
+---
-**Twitter account:** [@postcss](https://twitter.com/postcss)<br>
-**中文翻译**: [`docs/README-cn.md`](./docs/README-cn.md)
+<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Made in <b><a href="https://evilmartians.com/?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
-For PostCSS commercial support (consulting, improving the front-end culture
-of your company, PostCSS plugins), contact [Evil Martians]
-at <postcss@evilmartians.com>.
+---
[Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
[Evil Martians]: https://evilmartians.com/?utm_source=postcss
[Autoprefixer]: https://github.com/postcss/autoprefixer
+[Stylelint]: https://stylelint.io/
[plugins]: https://github.com/postcss/postcss#plugins
-<a href="https://evilmartians.com/?utm_source=postcss">
- <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
- alt="Sponsored by Evil Martians" width="236" height="54">
-</a>
-
## Docs
Read full docs **[here](https://postcss.org/)**.
diff --git a/lib/container.d.ts b/lib/container.d.ts
index v8.4.29..v8.4.31 100644
--- a/lib/container.d.ts
+++ b/lib/container.d.ts
@@ -127,13 +127,4 @@
): boolean
/**
- * The container’s first child.
- *
- * ```js
- * rule.first === rules.nodes[0]
- * ```
- */
- get first(): Child | undefined
-
- /**
* Returns a `child`’s index within the `Container#nodes` array.
*
@@ -146,4 +137,5 @@
*/
index(child: Child | number): number
+
/**
* Insert new node after old node within the container.
@@ -157,23 +149,5 @@
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
): this
-
/**
- * Traverses the container’s descendant nodes, calling callback
- * for each comment node.
- *
- * Like `Container#each`, this method is safe
- * to use if you are mutating arrays during iteration.
- *
- * ```js
- * root.walkComments(comment => {
- * comment.remove()
- * })
- * ```
- *
- * @param callback Iterator receives each node and index.
- * @return Returns `false` if iteration was broke.
- */
-
- /**
* Insert new node before old node within the container.
*
@@ -190,12 +164,21 @@
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
): this
+
/**
- * The container’s last child.
+ * Traverses the container’s descendant nodes, calling callback
+ * for each comment node.
*
+ * Like `Container#each`, this method is safe
+ * to use if you are mutating arrays during iteration.
+ *
* ```js
- * rule.last === rule.nodes[rule.nodes.length - 1]
+ * root.walkComments(comment => {
+ * comment.remove()
+ * })
* ```
+ *
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
*/
- get last(): Child | undefined
/**
@@ -222,5 +205,4 @@
...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
): this
-
/**
* Add child to the end of the node.
@@ -335,4 +317,5 @@
callback: (node: ChildNode, index: number) => false | void
): false | undefined
+
/**
* Traverses the container’s descendant nodes, calling callback
@@ -372,5 +355,4 @@
callback: (atRule: AtRule, index: number) => false | void
): false | undefined
-
walkComments(
callback: (comment: Comment, indexed: number) => false | void
@@ -414,7 +396,9 @@
callback: (decl: Declaration, index: number) => false | void
): false | undefined
+
walkDecls(
callback: (decl: Declaration, index: number) => false | void
): false | undefined
+
/**
* Traverses the container’s descendant nodes, calling callback
@@ -446,4 +430,20 @@
callback: (rule: Rule, index: number) => false | void
): false | undefined
+ /**
+ * The container’s first child.
+ *
+ * ```js
+ * rule.first === rules.nodes[0]
+ * ```
+ */
+ get first(): Child | undefined
+ /**
+ * The container’s last child.
+ *
+ * ```js
+ * rule.last === rule.nodes[rule.nodes.length - 1]
+ * ```
+ */
+ get last(): Child | undefined
}
diff --git a/lib/input.d.ts b/lib/input.d.ts
index v8.4.29..v8.4.31 100644
--- a/lib/input.d.ts
+++ b/lib/input.d.ts
@@ -145,17 +145,4 @@
/**
- * The CSS source identifier. Contains `Input#file` if the user
- * set the `from` option, or `Input#id` if they did not.
- *
- * ```js
- * const root = postcss.parse(css, { from: 'a.css' })
- * root.source.input.from //=> "/home/ai/a.css"
- *
- * const root = postcss.parse(css)
- * root.source.input.from //=> "<input css 1>"
- * ```
- */
- get from(): string
- /**
* Converts source offset to line and column.
*
@@ -188,4 +175,17 @@
endColumn?: number
): false | Input.FilePosition
+ /**
+ * The CSS source identifier. Contains `Input#file` if the user
+ * set the `from` option, or `Input#id` if they did not.
+ *
+ * ```js
+ * const root = postcss.parse(css, { from: 'a.css' })
+ * root.source.input.from //=> "/home/ai/a.css"
+ *
+ * const root = postcss.parse(css)
+ * root.source.input.from //=> "<input css 1>"
+ * ```
+ */
+ get from(): string
}
diff --git a/lib/lazy-result.d.ts b/lib/lazy-result.d.ts
index v8.4.29..v8.4.31 100644
--- a/lib/lazy-result.d.ts
+++ b/lib/lazy-result.d.ts
@@ -83,4 +83,30 @@
/**
+ * Run plugin in sync way and return `Result`.
+ *
+ * @return Result with output content.
+ */
+ sync(): Result<RootNode>
+
+ /**
+ * Alias for the `LazyResult#css` property.
+ *
+ * ```js
+ * lazy + '' === lazy.css
+ * ```
+ *
+ * @return Output CSS.
+ */
+ toString(): string
+
+ /**
+ * Processes input CSS through synchronous plugins
+ * and calls `Result#warnings`.
+ *
+ * @return Warnings from plugins.
+ */
+ warnings(): Warning[]
+
+ /**
* An alias for the `css` property. Use it with syntaxes
* that generate non-CSS output.
@@ -156,30 +182,4 @@
*/
get [Symbol.toStringTag](): string
-
- /**
- * Run plugin in sync way and return `Result`.
- *
- * @return Result with output content.
- */
- sync(): Result<RootNode>
-
- /**
- * Alias for the `LazyResult#css` property.
- *
- * ```js
- * lazy + '' === lazy.css
- * ```
- *
- * @return Output CSS.
- */
- toString(): string
-
- /**
- * Processes input CSS through synchronous plugins
- * and calls `Result#warnings`.
- *
- * @return Warnings from plugins.
- */
- warnings(): Warning[]
}
diff --git a/lib/no-work-result.d.ts b/lib/no-work-result.d.ts
index v8.4.29..v8.4.31 100644
--- a/lib/no-work-result.d.ts
+++ b/lib/no-work-result.d.ts
@@ -29,4 +29,7 @@
constructor(processor: Processor, css: string, opts: ResultOptions)
async(): Promise<Result<Root>>
+ sync(): Result<Root>
+ toString(): string
+ warnings(): Warning[]
get content(): string
get css(): string
@@ -37,7 +40,4 @@
get root(): Root
get [Symbol.toStringTag](): string
- sync(): Result<Root>
- toString(): string
- warnings(): Warning[]
}
diff --git a/lib/result.d.ts b/lib/result.d.ts
index v8.4.29..v8.4.31 100644
--- a/lib/result.d.ts
+++ b/lib/result.d.ts
@@ -152,14 +152,4 @@
/**
- * An alias for the `Result#css` property.
- * Use it with syntaxes that generate non-CSS output.
- *
- * ```js
- * result.css === result.content
- * ```
- */
- get content(): string
-
- /**
* Returns for `Result#css` content.
*
@@ -200,4 +190,14 @@
*/
warnings(): Warning[]
+
+ /**
+ * An alias for the `Result#css` property.
+ * Use it with syntaxes that generate non-CSS output.
+ *
+ * ```js
+ * result.css === result.content
+ * ```
+ */
+ get content(): string
}
Command detailsnpm diff --diff=postcss@8.4.29 --diff=postcss@8.4.31 --diff-unified=2 See also the Reported by ybiquitous/npm-diff-action@v1.5.0 (Node.js 20.8.0 and npm 10.2.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
javascript
Pull requests that update Javascript code
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps postcss from 8.4.29 to 8.4.31.
Release notes
Sourced from postcss's releases.
Changelog
Sourced from postcss's changelog.
Commits
90208de
Release 8.4.31 version58cc860
Fix carrier return parsing4fff8e4
Improve pnpm test outputcd43ed1
Update dependenciescaa916b
Update dependencies8972f76
Typo11a5286
Typo45c5501
Release 8.4.30 versionbc3c341
Update linterb2be58a
Merge pull request #1881 from romainmenke/improve-sourcemap-performance--phil...Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)You can disable automated security fix PRs for this repo from the Security Alerts page.