Skip to content

Commit

Permalink
Merge branch 'alpha' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Feb 2, 2022
2 parents 3200ce1 + 1ecdbd9 commit e23edc5
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 102 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@ Create a `tsconfig.json` file in the root of your project containing:
```

The above is the default configuration, which will include the ES2017 API and
generate modules in CommonJS format. This configuration is suitable for projects
that target node alone, or that target both node and the browser.
generate modules in ESM format (see [advice for migrating to ESM modules][1]).
This configuration is suitable for projects that target node alone, or that
target both node and the browser.

Several alternative configurations are also provided with settings suitable for
other target environments. To use one of the alternative configurations, set the
`extends` field to one of the values in the table below.

| `extends` | |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@softwareventures/tsconfig` | The default configuration. Includes ES2017 API and generates modules in CommonJS format. Suitable for projects that either target node alone, or target both node and the browser. |
| `@softwareventures/tsconfig/dom` | Includes DOM API in addition to ES2017. Suitable for use in code targeting browsers or for projects that include a DOM library such as jsdom. |
| `@softwareventures/tsconfig/webworker` | Includes WebWorker API in addition to ES2017. Suitable for use in code that will run as a Web Worker. |
other target environments or module formats. To use one of the alternative
configurations, set the `extends` field to one of the values in the table below.

| `extends` | |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@softwareventures/tsconfig` | The default configuration. Includes ES2017 API and generates modules in ESM format. Suitable for projects that either target node alone, or target both node and the browser. |
| `@softwareventures/tsconfig/commonjs` | Same as default, but generates modules in CommonJS format instead of ESM. |
| `@softwareventures/tsconfig/dom` | Includes DOM API in addition to ES2017. Suitable for use in code targeting browsers or for projects that include a DOM library such as jsdom. |
| `@softwareventures/tsconfig/dom-commonjs` | Same as `dom`, but generates modules in CommonJS format instead of ESM. |
| `@softwareventures/tsconfig/webworker` | Includes WebWorker API in addition to ES2017. Suitable for use in code that will run as a Web Worker. |
| `@softwareventures/tsconfig/webworker-commonjs` | Same as `webworker`, but generates modules in CommonJS format instead of ESM. |

[1]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
7 changes: 7 additions & 0 deletions commonjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"allowSyntheticDefaultImports": false
}
}
6 changes: 6 additions & 0 deletions dom-commonjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../commonjs/tsconfig.json",
"compilerOptions": {
"lib": ["ES2017", "DOM", "DOM.Iterable"]
}
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
"test": "tsc"
},
"sideEffects": false,
"engines": {
"node": "^12 || ^14 || >=16"
},
"peerDependencies": {
"typescript": "^3.2.2 || ^4.0.0"
"typescript": "^4.5.0"
},
"devDependencies": {
"@softwareventures/precise-commits": "2.0.17",
"@softwareventures/prettier-config": "3.0.0",
"@softwareventures/semantic-release-config": "1.2.0",
"@softwareventures/semantic-release-config": "2.0.0",
"cz-conventional-changelog": "3.3.0",
"husky": "7.0.4",
"prettier": "2.5.1",
Expand Down
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"compilerOptions": {
"target": "ES2017",
"module": "CommonJS",
"module": "ES2020",
"moduleResolution": "Node",
"lib": ["ES2017"],
"allowSyntheticDefaultImports": true,
"declaration": true,
"downlevelIteration": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"inlineSources": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"removeComments": false,
"resolveJsonModule": true,
Expand Down
6 changes: 6 additions & 0 deletions webworker-commonjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../commonjs/tsconfig.json",
"compilerOptions": {
"lib": ["ES2017", "WebWorker"]
}
}
190 changes: 101 additions & 89 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@
dependencies:
tslib "2.3.1"

"@softwareventures/semantic-release-config@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@softwareventures/semantic-release-config/-/semantic-release-config-1.2.0.tgz#2dd608e0982826015f8f9adf96889b44cffd12ed"
integrity sha512-7PRahvqM7ncotiZBhTt4ylCdsUMDtNykeaOBm0/c5c5TsLoZH6Be9d0fFgWr1iccbBP0JvoQrhHsmBxgpOwBQg==
"@softwareventures/semantic-release-config@2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@softwareventures/semantic-release-config/-/semantic-release-config-2.0.0.tgz#7eafffd91a232314994223dba32cd5b099b141b4"
integrity sha512-KD57OY1zCIzGExlqEQG4hzAiWAOtF/H74JgML8UoJRWaRFRVHafHDTTdcU3IIOpaItrysWtfH1zCnPtuuB6ZSg==
dependencies:
tslib "2.3.0"

Expand Down Expand Up @@ -1693,7 +1693,7 @@ http-cache-semantics@^4.1.0:
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==

http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1:
http-proxy-agent@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a"
integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==
Expand Down Expand Up @@ -2287,15 +2287,15 @@ make-error@^1.1.1:
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

make-fetch-happen@*, make-fetch-happen@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz#a2dc77ec1ebf082927f4dc6eaa70227f72e5a250"
integrity sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==
make-fetch-happen@*, make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968"
integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==
dependencies:
agentkeepalive "^4.1.3"
cacache "^15.2.0"
http-cache-semantics "^4.1.0"
http-proxy-agent "^5.0.0"
http-proxy-agent "^4.0.1"
https-proxy-agent "^5.0.0"
is-lambda "^1.0.1"
lru-cache "^6.0.0"
Expand All @@ -2304,20 +2304,20 @@ make-fetch-happen@*, make-fetch-happen@^10.0.0:
minipass-fetch "^1.3.2"
minipass-flush "^1.0.5"
minipass-pipeline "^1.2.4"
negotiator "^0.6.3"
negotiator "^0.6.2"
promise-retry "^2.0.1"
socks-proxy-agent "^6.0.0"
ssri "^8.0.0"

make-fetch-happen@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968"
integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==
make-fetch-happen@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.0.0.tgz#a2dc77ec1ebf082927f4dc6eaa70227f72e5a250"
integrity sha512-CREcDkbKZZ64g5MN1FT+u58mDHX9FQFFtFyio5HonX44BdQdytqPZBXUz+6ibi2w/6ncji59f2phyXGSMGpgzA==
dependencies:
agentkeepalive "^4.1.3"
cacache "^15.2.0"
http-cache-semantics "^4.1.0"
http-proxy-agent "^4.0.1"
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"
is-lambda "^1.0.1"
lru-cache "^6.0.0"
Expand All @@ -2326,7 +2326,7 @@ make-fetch-happen@^9.1.0:
minipass-fetch "^1.3.2"
minipass-flush "^1.0.5"
minipass-pipeline "^1.2.4"
negotiator "^0.6.2"
negotiator "^0.6.3"
promise-retry "^2.0.1"
socks-proxy-agent "^6.0.0"
ssri "^8.0.0"
Expand Down Expand Up @@ -2545,7 +2545,7 @@ mute-stream@~0.0.4:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==

negotiator@^0.6.2, negotiator@^0.6.3:
negotiator@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd"
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==
Expand Down Expand Up @@ -2696,6 +2696,18 @@ npm-registry-fetch@*, npm-registry-fetch@^12.0.0, npm-registry-fetch@^12.0.1:
minizlib "^2.0.0"
npm-package-arg "^8.0.0"

npm-registry-fetch@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76"
integrity sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==
dependencies:
make-fetch-happen "^9.0.1"
minipass "^3.1.3"
minipass-fetch "^1.3.0"
minipass-json-stream "^1.0.1"
minizlib "^2.0.0"
npm-package-arg "^8.0.0"

npm-run-path@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"
Expand All @@ -2713,76 +2725,76 @@ npm@^7.0.0:
resolved "https://registry.yarnpkg.com/npm/-/npm-7.24.2.tgz#861117af8241bea592289f22407230e5300e59ca"
integrity sha512-120p116CE8VMMZ+hk8IAb1inCPk4Dj3VZw29/n2g6UI77urJKVYb7FZUDW8hY+EBnfsjI/2yrobBgFyzo7YpVQ==
dependencies:
"@isaacs/string-locale-compare" "*"
"@npmcli/arborist" "*"
"@npmcli/ci-detect" "*"
"@npmcli/config" "*"
"@npmcli/map-workspaces" "*"
"@npmcli/package-json" "*"
"@npmcli/run-script" "*"
abbrev "*"
ansicolors "*"
ansistyles "*"
archy "*"
cacache "*"
chalk "*"
chownr "*"
cli-columns "*"
cli-table3 "*"
columnify "*"
fastest-levenshtein "*"
glob "*"
graceful-fs "*"
hosted-git-info "*"
ini "*"
init-package-json "*"
is-cidr "*"
json-parse-even-better-errors "*"
libnpmaccess "*"
libnpmdiff "*"
libnpmexec "*"
libnpmfund "*"
libnpmhook "*"
libnpmorg "*"
libnpmpack "*"
libnpmpublish "*"
libnpmsearch "*"
libnpmteam "*"
libnpmversion "*"
make-fetch-happen "*"
minipass "*"
minipass-pipeline "*"
mkdirp "*"
mkdirp-infer-owner "*"
ms "*"
node-gyp "*"
nopt "*"
npm-audit-report "*"
npm-install-checks "*"
npm-package-arg "*"
npm-pick-manifest "*"
npm-profile "*"
npm-registry-fetch "*"
npm-user-validate "*"
npmlog "*"
opener "*"
pacote "*"
parse-conflict-json "*"
qrcode-terminal "*"
read "*"
read-package-json "*"
read-package-json-fast "*"
readdir-scoped-modules "*"
rimraf "*"
semver "*"
ssri "*"
tar "*"
text-table "*"
tiny-relative-date "*"
treeverse "*"
validate-npm-package-name "*"
which "*"
write-file-atomic "*"
"@isaacs/string-locale-compare" "^1.1.0"
"@npmcli/arborist" "^2.9.0"
"@npmcli/ci-detect" "^1.2.0"
"@npmcli/config" "^2.3.0"
"@npmcli/map-workspaces" "^1.0.4"
"@npmcli/package-json" "^1.0.1"
"@npmcli/run-script" "^1.8.6"
abbrev "~1.1.1"
ansicolors "~0.3.2"
ansistyles "~0.1.3"
archy "~1.0.0"
cacache "^15.3.0"
chalk "^4.1.2"
chownr "^2.0.0"
cli-columns "^3.1.2"
cli-table3 "^0.6.0"
columnify "~1.5.4"
fastest-levenshtein "^1.0.12"
glob "^7.2.0"
graceful-fs "^4.2.8"
hosted-git-info "^4.0.2"
ini "^2.0.0"
init-package-json "^2.0.5"
is-cidr "^4.0.2"
json-parse-even-better-errors "^2.3.1"
libnpmaccess "^4.0.2"
libnpmdiff "^2.0.4"
libnpmexec "^2.0.1"
libnpmfund "^1.1.0"
libnpmhook "^6.0.2"
libnpmorg "^2.0.2"
libnpmpack "^2.0.1"
libnpmpublish "^4.0.1"
libnpmsearch "^3.1.1"
libnpmteam "^2.0.3"
libnpmversion "^1.2.1"
make-fetch-happen "^9.1.0"
minipass "^3.1.3"
minipass-pipeline "^1.2.4"
mkdirp "^1.0.4"
mkdirp-infer-owner "^2.0.0"
ms "^2.1.2"
node-gyp "^7.1.2"
nopt "^5.0.0"
npm-audit-report "^2.1.5"
npm-install-checks "^4.0.0"
npm-package-arg "^8.1.5"
npm-pick-manifest "^6.1.1"
npm-profile "^5.0.3"
npm-registry-fetch "^11.0.0"
npm-user-validate "^1.0.1"
npmlog "^5.0.1"
opener "^1.5.2"
pacote "^11.3.5"
parse-conflict-json "^1.1.1"
qrcode-terminal "^0.12.0"
read "~1.0.7"
read-package-json "^4.1.1"
read-package-json-fast "^2.0.3"
readdir-scoped-modules "^1.1.0"
rimraf "^3.0.2"
semver "^7.3.5"
ssri "^8.0.1"
tar "^6.1.11"
text-table "~0.2.0"
tiny-relative-date "^1.3.0"
treeverse "^1.0.4"
validate-npm-package-name "~3.0.0"
which "^2.0.2"
write-file-atomic "^3.0.3"

npmlog@*, npmlog@^6.0.0:
version "6.0.0"
Expand Down Expand Up @@ -3131,7 +3143,7 @@ read-cmd-shim@^2.0.0:
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9"
integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw==

read-package-json-fast@*, read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json-fast@^2.0.3:
read-package-json-fast@*, read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json-fast@^2.0.3, read-package-json-fast@^2.1.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83"
integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==
Expand Down

0 comments on commit e23edc5

Please sign in to comment.