-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export version constant (#2016)
- Loading branch information
Showing
11 changed files
with
63 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** Version of SVGO. */ | ||
export const VERSION = '4.0.0'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"packageManager": "[email protected]", | ||
"name": "svgo", | ||
"version": "3.3.1", | ||
"version": "4.0.0", | ||
"description": "SVGO is a Node.js library and command-line application for optimizing vector images.", | ||
"license": "MIT", | ||
"type": "module", | ||
|
@@ -85,15 +85,15 @@ | |
"node": ">=14.0.0" | ||
}, | ||
"scripts": { | ||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --maxWorkers=4 --coverage", | ||
"build": "node scripts/sync-version.js && rollup -c", | ||
"typecheck": "tsc", | ||
"lint": "eslint . && prettier --check .", | ||
"fix": "eslint --fix . && prettier --write .", | ||
"typecheck": "tsc", | ||
"generate-bundles": "rollup -c", | ||
"test-bundles": "yarn generate-bundles && node ./test/svgo.cjs && node ./test/browser.js", | ||
"test-regression": "node ./test/regression-extract.js && cross-env NO_DIFF=1 node ./test/regression.js", | ||
"prepublishOnly": "rimraf dist && yarn generate-bundles", | ||
"qa": "yarn lint && yarn typecheck && yarn test && yarn test-bundles && yarn test-regression" | ||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --maxWorkers=4 --coverage", | ||
"test:bundles": "yarn build && node ./test/svgo.cjs && node ./test/browser.js", | ||
"test:regression": "node ./test/regression-extract.js && cross-env NO_DIFF=1 node ./test/regression.js", | ||
"qa": "yarn typecheck && yarn lint && yarn test && yarn test:bundles && yarn test:regression", | ||
"prepublishOnly": "rimraf dist && yarn build" | ||
}, | ||
"jest": { | ||
"coveragePathIgnorePatterns": [ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import fs from 'node:fs/promises'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
const pkgPath = path.join(__dirname, '../package.json'); | ||
const { version } = JSON.parse(await fs.readFile(pkgPath, 'utf-8')); | ||
|
||
await fs.writeFile( | ||
'./lib/version.js', | ||
`/** Version of SVGO. */\nexport const VERSION = '${version}';\n`, | ||
); |
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
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
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