Skip to content

Commit

Permalink
Merge branch 'svg:main' into apply-transform-shape
Browse files Browse the repository at this point in the history
  • Loading branch information
KTibow authored Jun 27, 2024
2 parents d3aabf2 + b8f8d1c commit fd3749a
Show file tree
Hide file tree
Showing 148 changed files with 3,558 additions and 4,065 deletions.
25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- SVGO Version [e.g. 2.0.3]
- NodeJs Version [e.g 14.0.4]
- SVGO Version [e.g. 3.3.2]
- NodeJs Version [e.g 16.16.0]
- OS: [e.g. iOS]

**Additional context**
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'CodeQL'

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript'
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:javascript'
38 changes: 22 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: CI

env:
FORCE_COLOR: 2
NODE: 20

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -26,24 +25,13 @@ jobs:
- run: yarn install
- run: yarn lint
- run: yarn typecheck
regression:
name: Test regressions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE }}
cache: yarn
- run: yarn install
- run: yarn playwright install --with-deps chromium
- run: yarn test-regression
test:
name: ${{ matrix.os }} Node.js ${{ matrix.node-version }}
strategy:
fail-fast: false
matrix:
node-version:
- 22
- 20
- 18
- 16
Expand All @@ -60,4 +48,22 @@ jobs:
- run: yarn install
- run: yarn playwright install --with-deps chromium
- run: yarn test
- run: yarn test-bundles
- run: yarn test:bundles
regression:
name: Test regressions
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
needs:
- lint
- test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE }}
cache: yarn
- run: yarn install
- run: yarn playwright install --with-deps chromium
- run: yarn test:regression
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage
.DS_Store
.vscode
*.log
package-lock.json

# https://github.com/github/gitignore/blob/main/Global/Vim.gitignore
[._]*.s[a-v][a-z]
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.yarn
125 changes: 125 additions & 0 deletions .yarn/patches/sax-npm-1.4.1-503b1923cb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
diff --git a/lib/sax.js b/lib/sax.js
index 122ad8e5a478339d56fc86d00d21c5d142739f0e..2557c46482ff651026436cc6c7142ebfe68ddfc5 100644
--- a/lib/sax.js
+++ b/lib/sax.js
@@ -1,8 +1,6 @@
;(function (sax) { // wrapper for non-node envs
sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
sax.SAXParser = SAXParser
- sax.SAXStream = SAXStream
- sax.createStream = createStream

// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
@@ -164,111 +162,6 @@
flush: function () { flushBuffers(this) }
}

- var Stream
- try {
- Stream = require('stream').Stream
- } catch (ex) {
- Stream = function () {}
- }
- if (!Stream) Stream = function () {}
-
- var streamWraps = sax.EVENTS.filter(function (ev) {
- return ev !== 'error' && ev !== 'end'
- })
-
- function createStream (strict, opt) {
- return new SAXStream(strict, opt)
- }
-
- function SAXStream (strict, opt) {
- if (!(this instanceof SAXStream)) {
- return new SAXStream(strict, opt)
- }
-
- Stream.apply(this)
-
- this._parser = new SAXParser(strict, opt)
- this.writable = true
- this.readable = true
-
- var me = this
-
- this._parser.onend = function () {
- me.emit('end')
- }
-
- this._parser.onerror = function (er) {
- me.emit('error', er)
-
- // if didn't throw, then means error was handled.
- // go ahead and clear error, so we can write again.
- me._parser.error = null
- }
-
- this._decoder = null
-
- streamWraps.forEach(function (ev) {
- Object.defineProperty(me, 'on' + ev, {
- get: function () {
- return me._parser['on' + ev]
- },
- set: function (h) {
- if (!h) {
- me.removeAllListeners(ev)
- me._parser['on' + ev] = h
- return h
- }
- me.on(ev, h)
- },
- enumerable: true,
- configurable: false
- })
- })
- }
-
- SAXStream.prototype = Object.create(Stream.prototype, {
- constructor: {
- value: SAXStream
- }
- })
-
- SAXStream.prototype.write = function (data) {
- if (typeof Buffer === 'function' &&
- typeof Buffer.isBuffer === 'function' &&
- Buffer.isBuffer(data)) {
- if (!this._decoder) {
- var SD = require('string_decoder').StringDecoder
- this._decoder = new SD('utf8')
- }
- data = this._decoder.write(data)
- }
-
- this._parser.write(data.toString())
- this.emit('data', data)
- return true
- }
-
- SAXStream.prototype.end = function (chunk) {
- if (chunk && chunk.length) {
- this.write(chunk)
- }
- this._parser.end()
- return true
- }
-
- SAXStream.prototype.on = function (ev, handler) {
- var me = this
- if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
- me._parser['on' + ev] = function () {
- var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
- args.splice(0, 0, ev)
- me.emit.apply(me, args)
- }
- }
-
- return Stream.prototype.on.call(me, ev, handler)
- }
-
// this really needs to be replaced with character classes.
// XML allows all manner of ridiculous numbers and digits.
var CDATA = '[CDATA['
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'

yarnPath: .yarn/releases/yarn-3.2.3.cjs
yarnPath: .yarn/releases/yarn-3.8.2.cjs
Loading

0 comments on commit fd3749a

Please sign in to comment.