mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-09-11 12:15:24 +03:00
commit
9d16062aa0
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Upcoming
|
||||
|
||||
- Expose `transform: (jsSource: string) => string` JS API. Useful for build toolchains.
|
||||
|
||||
- Update chromedriver to work with latest version of Chrome
|
@ -44,8 +44,8 @@
|
||||
"devDependencies": {
|
||||
"@gfx/zopfli": "^1.0.15",
|
||||
"@types/commander": "^2.12.2",
|
||||
"chromedriver": "^97.0.4",
|
||||
"@types/selenium-webdriver": "^4.0.14",
|
||||
"chromedriver": "^93.0.0",
|
||||
"copyfiles": "^2.4.1",
|
||||
"geckodriver": "^1.20.0",
|
||||
"husky": "^4.2.5",
|
||||
|
25
src/index.ts
25
src/index.ts
@ -1,4 +1,6 @@
|
||||
import * as Run from './run';
|
||||
import * as Transform from './transform'
|
||||
import { toolDefaults } from "./types";
|
||||
|
||||
export async function run(options: {
|
||||
inputFilePath: string | undefined,
|
||||
@ -18,3 +20,26 @@ export async function run(options: {
|
||||
() => { }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform JS source (compiled output of `elm make`)
|
||||
* Handy for making build tool plugins (e.g, parcel, snowpack, webpack, etc.)
|
||||
*/
|
||||
export async function transform(
|
||||
jsSource: string,
|
||||
o3Enabled = false,
|
||||
): Promise<string> {
|
||||
|
||||
if (jsSource == '') {
|
||||
throw new Error('elm-optimize-level-2: JS source is empty.');
|
||||
}
|
||||
|
||||
return Transform.transform(
|
||||
"unused dirName param",
|
||||
jsSource,
|
||||
undefined,
|
||||
false,
|
||||
toolDefaults(o3Enabled, null)
|
||||
)
|
||||
}
|
||||
|
||||
|
38
yarn.lock
38
yarn.lock
@ -798,10 +798,10 @@
|
||||
dependencies:
|
||||
"@sinonjs/commons" "^1.7.0"
|
||||
|
||||
"@testim/chrome-version@^1.0.7":
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.0.7.tgz#0cd915785ec4190f08a3a6acc9b61fc38fb5f1a9"
|
||||
integrity sha512-8UT/J+xqCYfn3fKtOznAibsHpiuDshCb0fwgWxRazTT19Igp9ovoXMPhXyLD6m3CKQGTMHgqoxaFfMWaL40Rnw==
|
||||
"@testim/chrome-version@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.2.tgz#092005c5b77bd3bb6576a4677110a11485e11864"
|
||||
integrity sha512-1c4ZOETSRpI0iBfIFUqU4KqwBAB2lHUAlBjZz/YqOHqwM9dTTzjV6Km0ZkiEiSCx/tLr1BtESIKyWWMww+RUqw==
|
||||
|
||||
"@tootallnate/once@1":
|
||||
version "1.1.2"
|
||||
@ -1105,12 +1105,12 @@ aws4@^1.8.0:
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
|
||||
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
|
||||
|
||||
axios@^0.21.2:
|
||||
version "0.21.4"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
|
||||
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
|
||||
axios@^0.24.0:
|
||||
version "0.24.0"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
|
||||
integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
|
||||
dependencies:
|
||||
follow-redirects "^1.14.0"
|
||||
follow-redirects "^1.14.4"
|
||||
|
||||
babel-jest@^27.3.1:
|
||||
version "27.3.1"
|
||||
@ -1362,13 +1362,13 @@ chownr@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
|
||||
integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
|
||||
|
||||
chromedriver@^93.0.0:
|
||||
version "93.0.1"
|
||||
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-93.0.1.tgz#3ed1f7baa98a754fc1788c42ac8e4bb1ab27db32"
|
||||
integrity sha512-KDzbW34CvQLF5aTkm3b5VdlTrvdIt4wEpCzT2p4XJIQWQZEPco5pNce7Lu9UqZQGkhQ4mpZt4Ky6NKVyIS2N8A==
|
||||
chromedriver@^97.0.4:
|
||||
version "97.0.4"
|
||||
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-97.0.4.tgz#69dbfae6194d32c64e34f88d60897835d86f7a99"
|
||||
integrity sha512-mAOH1QSCaeYgniNOqceAzC8BVORQtWxsmgSOBuy8TV/CyyDTllLmKtNNORsxdqrDtefVlxRVQkEzYrlKiJsfFw==
|
||||
dependencies:
|
||||
"@testim/chrome-version" "^1.0.7"
|
||||
axios "^0.21.2"
|
||||
"@testim/chrome-version" "^1.1.2"
|
||||
axios "^0.24.0"
|
||||
del "^6.0.0"
|
||||
extract-zip "^2.0.1"
|
||||
https-proxy-agent "^5.0.0"
|
||||
@ -2048,10 +2048,10 @@ firstline@^1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/firstline/-/firstline-1.3.1.tgz#59e84af0fd858fbc6dac0a0ff97fd22a47e58084"
|
||||
integrity sha512-ycwgqtoxujz1dm0kjkBFOPQMESxB9uKc/PlD951dQDIG+tBXRpYZC2UmJb0gDxopQ1ZX6oyRQN3goRczYu7Deg==
|
||||
|
||||
follow-redirects@^1.14.0:
|
||||
version "1.14.4"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379"
|
||||
integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==
|
||||
follow-redirects@^1.14.4:
|
||||
version "1.14.7"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
|
||||
integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
|
Loading…
Reference in New Issue
Block a user