Skip to content

Commit 90c5a69

Browse files
Reduce npm package size (#94)
* Reduce npm package size by removing `CONTRIBUTING.md` and unnecessary type files from exported package. --------- Co-authored-by: @tonypconway Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f95f70e commit 90c5a69

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
},
1717
"files": [
1818
"dist/*",
19+
"!dist/scripts/*",
1920
"LICENSE.txt",
20-
"README.md",
21-
"CONTRIBUTING.md"
21+
"README.md"
2222
],
2323
"types": "./dist/index.d.ts",
2424
"type": "module",
@@ -31,7 +31,7 @@
3131
"test:bcb": "mkdir test-bcb && cd test-bcb && npm init -y && npm i ../../baseline-browser-mapping browserslist browserslist-config-baseline &&jq '. += {\"browserslist\":[\"extends browserslist-config-baseline\"]}' package.json >p && mv p package.json && npx browserslist && cd ../ && rm -rf test-bcb",
3232
"test:jasmine": "npx jasmine",
3333
"test": "npm run build && rm -rf test-bcb && npm run test:format && npm run test:lint && npx jasmine && npm run test:bcb",
34-
"build": "rm -rf dist; npx prettier . --write; rollup -c",
34+
"build": "rm -rf dist; npx prettier . --write; rollup -c; rm -rf ./dist/scripts/expose-data.d.ts ./dist/cli.d.ts",
3535
"refresh-downstream": "npx tsx scripts/refresh-downstream.ts",
3636
"refresh-static": "npx tsx scripts/refresh-static.ts",
3737
"update-data-file": "npx tsx scripts/update-data-file.ts; npx prettier ./src/data/data.js --write",

src/scripts/baseline-browser-versions.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ type Options = {
356356
/**
357357
* Returns browser versions compatible with specified Baseline targets.
358358
* Defaults to returning the minimum versions of the core browser set that support Baseline Widely available.
359-
* Takes an optional configuration object `Object` with four optional properties:
359+
* Takes an optional configuration `Object` with four optional properties:
360360
* - `listAllCompatibleVersions`: `false` (default) or `false`
361361
* - `includeDownstreamBrowsers`: `false` (default) or `false`
362362
* - `widelyAvailableOnDate`: date in format `YYYY-MM-DD`
@@ -416,8 +416,8 @@ export function getCompatibleVersions(userOptions?: Options): BrowserVersion[] {
416416

417417
type AllVersionsOptions = {
418418
/**
419-
* Whether to return the output as a JavaScript `Array` (`array`) or a CSV string (`csv`).
420-
* Defaults to `array`.
419+
* Whether to return the output as a JavaScript `Array` (`"array"`), `Object` (`"object"`) or a CSV string (`"csv"`).
420+
* Defaults to `"array"`.
421421
*/
422422
outputFormat?: string;
423423
/**
@@ -433,10 +433,11 @@ type AllVersionsOptions = {
433433
};
434434

435435
/**
436-
* Returns all browser versions known to this module with their level of Baseline support either as an `Array` or a `String` CSV.
437-
* Takes an object as an argument with two optional properties:
436+
* Returns all browser versions known to this module with their level of Baseline support as a JavaScript `Array` (`"array"`), `Object` (`"object"`) or a CSV string (`"csv"`).
437+
* Takes an optional configuration `Object` with three optional properties:
438438
* - `includeDownstreamBrowsers`: `true` (default) or `false`
439-
* - `outputFormat`: `array` (default), `object` or `csv`
439+
* - `outputFormat`: `"array"` (default), `"object"` or `"csv"`
440+
* - `useSupports`: `false` (default) or `true`, replaces `wa_compatible` property with optional `supports` property which returns `widely` or `newly` available when present.
440441
*/
441442
export function getAllVersions(
442443
userOptions?: AllVersionsOptions,

0 commit comments

Comments
 (0)