website hosted
This commit is contained in:
1
node_modules/.astro/data-store.json
generated
vendored
Normal file
1
node_modules/.astro/data-store.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.14.6","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"site\":\"https://juchatz.com\",\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"server\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":false,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":\"0.0.0.0\",\"port\":7080,\"streaming\":true,\"allowedHosts\":[]},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\",\"entrypoint\":\"astro/assets/endpoint/node\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[],\"responsiveStyles\":false},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":{\"type\":\"shiki\",\"excludeLangs\":[\"math\"]},\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true,\"allowedDomains\":[]},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"headingIdCompat\":false,\"preserveScriptOrder\":false,\"liveContentCollections\":false,\"csp\":false,\"staticImportMetaEnv\":false,\"chromeDevtoolsWorkspace\":false,\"failOnPrerenderConflict\":false},\"legacy\":{\"collections\":false},\"session\":{\"driver\":\"fs-lite\",\"options\":{\"base\":\"/root/homewebsite/node_modules/.astro/sessions\"}}}"]
|
||||
1
node_modules/.bin/sitemap
generated
vendored
Symbolic link
1
node_modules/.bin/sitemap
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../sitemap/dist/cli.js
|
||||
265
node_modules/.package-lock.json
generated
vendored
265
node_modules/.package-lock.json
generated
vendored
@@ -45,6 +45,20 @@
|
||||
"vfile": "^6.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/node": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/node/-/node-9.5.0.tgz",
|
||||
"integrity": "sha512-x1whLIatmCefaqJA8FjfI+P6FStF+bqmmrib0OUGM1M3cZhAXKLgPx6UF2AzQ3JgpXgCWYM24MHtraPvZhhyLQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@astrojs/internal-helpers": "0.7.4",
|
||||
"send": "^1.2.0",
|
||||
"server-destroy": "^1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^5.14.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/prism": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.3.0.tgz",
|
||||
@@ -57,6 +71,17 @@
|
||||
"node": "18.20.8 || ^20.3.0 || >=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/sitemap": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.6.0.tgz",
|
||||
"integrity": "sha512-4aHkvcOZBWJigRmMIAJwRQXBS+ayoP5z40OklTXYXhUDhwusz+DyDl+nSshY6y9DvkVEavwNcFO8FD81iGhXjg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sitemap": "^8.0.0",
|
||||
"stream-replace-string": "^2.0.0",
|
||||
"zod": "^3.25.76"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/telemetry": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.0.tgz",
|
||||
@@ -783,7 +808,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"ideallyInert": true,
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -937,7 +961,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"ideallyInert": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1303,7 +1326,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"ideallyInert": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1522,6 +1544,15 @@
|
||||
"undici-types": "~7.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/sax": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz",
|
||||
"integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/unist": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
|
||||
@@ -1645,6 +1676,12 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
||||
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
@@ -2056,6 +2093,15 @@
|
||||
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dequal": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||
@@ -2133,6 +2179,18 @@
|
||||
"integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "17.2.3",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz",
|
||||
"integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dset": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/dset/-/dset-3.1.4.tgz",
|
||||
@@ -2142,12 +2200,27 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "10.6.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
|
||||
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
|
||||
@@ -2207,6 +2280,12 @@
|
||||
"@esbuild/win32-x64": "0.25.11"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/escape-string-regexp": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||
@@ -2228,6 +2307,15 @@
|
||||
"@types/estree": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||
@@ -2299,6 +2387,15 @@
|
||||
"unicode-trie": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
@@ -2558,6 +2655,31 @@
|
||||
"integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==",
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors/node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/import-meta-resolve": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",
|
||||
@@ -2568,6 +2690,12 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/iron-webcrypto": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz",
|
||||
@@ -3507,6 +3635,27 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mrmime": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",
|
||||
@@ -3600,6 +3749,18 @@
|
||||
"integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/oniguruma-parser": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.1.tgz",
|
||||
@@ -3795,6 +3956,15 @@
|
||||
"integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/readdirp": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
|
||||
@@ -4082,6 +4252,12 @@
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
|
||||
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.7.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
||||
@@ -4094,6 +4270,40 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz",
|
||||
"integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.5",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"mime-types": "^3.0.1",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/server-destroy": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz",
|
||||
"integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/sharp": {
|
||||
"version": "0.34.4",
|
||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.4.tgz",
|
||||
@@ -4159,6 +4369,31 @@
|
||||
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sitemap": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.0.tgz",
|
||||
"integrity": "sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "^17.0.5",
|
||||
"@types/sax": "^1.2.1",
|
||||
"arg": "^5.0.0",
|
||||
"sax": "^1.2.4"
|
||||
},
|
||||
"bin": {
|
||||
"sitemap": "dist/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sitemap/node_modules/@types/node": {
|
||||
"version": "17.0.45",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz",
|
||||
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/smol-toml": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz",
|
||||
@@ -4190,6 +4425,21 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/stream-replace-string": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz",
|
||||
"integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
|
||||
@@ -4264,6 +4514,15 @@
|
||||
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/trim-lines": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
|
||||
|
||||
31
node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
31
node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"hash": "3f8379cd",
|
||||
"configHash": "b954eaf4",
|
||||
"lockfileHash": "3432b1a7",
|
||||
"browserHash": "d085d3e0",
|
||||
"optimized": {
|
||||
"astro > cssesc": {
|
||||
"src": "../../cssesc/cssesc.js",
|
||||
"file": "astro___cssesc.js",
|
||||
"fileHash": "c2de14a5",
|
||||
"needsInterop": true
|
||||
},
|
||||
"astro > aria-query": {
|
||||
"src": "../../aria-query/lib/index.js",
|
||||
"file": "astro___aria-query.js",
|
||||
"fileHash": "a36c2232",
|
||||
"needsInterop": true
|
||||
},
|
||||
"astro > axobject-query": {
|
||||
"src": "../../axobject-query/lib/index.js",
|
||||
"file": "astro___axobject-query.js",
|
||||
"fileHash": "34d46228",
|
||||
"needsInterop": true
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-BUSYA2B4": {
|
||||
"file": "chunk-BUSYA2B4.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
6776
node_modules/.vite/deps/astro___aria-query.js
generated
vendored
Normal file
6776
node_modules/.vite/deps/astro___aria-query.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/.vite/deps/astro___aria-query.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/astro___aria-query.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3754
node_modules/.vite/deps/astro___axobject-query.js
generated
vendored
Normal file
3754
node_modules/.vite/deps/astro___axobject-query.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/.vite/deps/astro___axobject-query.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/astro___axobject-query.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
99
node_modules/.vite/deps/astro___cssesc.js
generated
vendored
Normal file
99
node_modules/.vite/deps/astro___cssesc.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-BUSYA2B4.js";
|
||||
|
||||
// node_modules/cssesc/cssesc.js
|
||||
var require_cssesc = __commonJS({
|
||||
"node_modules/cssesc/cssesc.js"(exports, module) {
|
||||
var object = {};
|
||||
var hasOwnProperty = object.hasOwnProperty;
|
||||
var merge = function merge2(options, defaults) {
|
||||
if (!options) {
|
||||
return defaults;
|
||||
}
|
||||
var result = {};
|
||||
for (var key in defaults) {
|
||||
result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
|
||||
var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
|
||||
var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
|
||||
var cssesc = function cssesc2(string, options) {
|
||||
options = merge(options, cssesc2.options);
|
||||
if (options.quotes != "single" && options.quotes != "double") {
|
||||
options.quotes = "single";
|
||||
}
|
||||
var quote = options.quotes == "double" ? '"' : "'";
|
||||
var isIdentifier = options.isIdentifier;
|
||||
var firstChar = string.charAt(0);
|
||||
var output = "";
|
||||
var counter = 0;
|
||||
var length = string.length;
|
||||
while (counter < length) {
|
||||
var character = string.charAt(counter++);
|
||||
var codePoint = character.charCodeAt();
|
||||
var value = void 0;
|
||||
if (codePoint < 32 || codePoint > 126) {
|
||||
if (codePoint >= 55296 && codePoint <= 56319 && counter < length) {
|
||||
var extra = string.charCodeAt(counter++);
|
||||
if ((extra & 64512) == 56320) {
|
||||
codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536;
|
||||
} else {
|
||||
counter--;
|
||||
}
|
||||
}
|
||||
value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
||||
} else {
|
||||
if (options.escapeEverything) {
|
||||
if (regexAnySingleEscape.test(character)) {
|
||||
value = "\\" + character;
|
||||
} else {
|
||||
value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
||||
}
|
||||
} else if (/[\t\n\f\r\x0B]/.test(character)) {
|
||||
value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
||||
} else if (character == "\\" || !isIdentifier && (character == '"' && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
|
||||
value = "\\" + character;
|
||||
} else {
|
||||
value = character;
|
||||
}
|
||||
}
|
||||
output += value;
|
||||
}
|
||||
if (isIdentifier) {
|
||||
if (/^-[-\d]/.test(output)) {
|
||||
output = "\\-" + output.slice(1);
|
||||
} else if (/\d/.test(firstChar)) {
|
||||
output = "\\3" + firstChar + " " + output.slice(1);
|
||||
}
|
||||
}
|
||||
output = output.replace(regexExcessiveSpaces, function($0, $1, $2) {
|
||||
if ($1 && $1.length % 2) {
|
||||
return $0;
|
||||
}
|
||||
return ($1 || "") + $2;
|
||||
});
|
||||
if (!isIdentifier && options.wrap) {
|
||||
return quote + output + quote;
|
||||
}
|
||||
return output;
|
||||
};
|
||||
cssesc.options = {
|
||||
"escapeEverything": false,
|
||||
"isIdentifier": false,
|
||||
"quotes": "single",
|
||||
"wrap": false
|
||||
};
|
||||
cssesc.version = "3.0.0";
|
||||
module.exports = cssesc;
|
||||
}
|
||||
});
|
||||
export default require_cssesc();
|
||||
/*! Bundled license information:
|
||||
|
||||
cssesc/cssesc.js:
|
||||
(*! https://mths.be/cssesc v3.0.0 by @mathias *)
|
||||
*/
|
||||
//# sourceMappingURL=astro___cssesc.js.map
|
||||
7
node_modules/.vite/deps/astro___cssesc.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/astro___cssesc.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../cssesc/cssesc.js"],
|
||||
"sourcesContent": ["/*! https://mths.be/cssesc v3.0.0 by @mathias */\n'use strict';\n\nvar object = {};\nvar hasOwnProperty = object.hasOwnProperty;\nvar merge = function merge(options, defaults) {\n\tif (!options) {\n\t\treturn defaults;\n\t}\n\tvar result = {};\n\tfor (var key in defaults) {\n\t\t// `if (defaults.hasOwnProperty(key) { … }` is not needed here, since\n\t\t// only recognized option names are used.\n\t\tresult[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];\n\t}\n\treturn result;\n};\n\nvar regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/;\nvar regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/;\nvar regexAlwaysEscape = /['\"\\\\]/;\nvar regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g;\n\n// https://mathiasbynens.be/notes/css-escapes#css\nvar cssesc = function cssesc(string, options) {\n\toptions = merge(options, cssesc.options);\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single';\n\t}\n\tvar quote = options.quotes == 'double' ? '\"' : '\\'';\n\tvar isIdentifier = options.isIdentifier;\n\n\tvar firstChar = string.charAt(0);\n\tvar output = '';\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar character = string.charAt(counter++);\n\t\tvar codePoint = character.charCodeAt();\n\t\tvar value = void 0;\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7E) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t} else if (character == '\\\\' || !isIdentifier && (character == '\"' && quote == character || character == '\\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {\n\t\t\t\tvalue = '\\\\' + character;\n\t\t\t} else {\n\t\t\t\tvalue = character;\n\t\t\t}\n\t\t}\n\t\toutput += value;\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1);\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1);\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0;\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2;\n\t});\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote;\n\t}\n\treturn output;\n};\n\n// Expose default options (so they can be overridden globally).\ncssesc.options = {\n\t'escapeEverything': false,\n\t'isIdentifier': false,\n\t'quotes': 'single',\n\t'wrap': false\n};\n\ncssesc.version = '3.0.0';\n\nmodule.exports = cssesc;\n"],
|
||||
"mappings": ";;;;;AAAA;AAAA;AAGA,QAAI,SAAS,CAAC;AACd,QAAI,iBAAiB,OAAO;AAC5B,QAAI,QAAQ,SAASA,OAAM,SAAS,UAAU;AAC7C,UAAI,CAAC,SAAS;AACb,eAAO;AAAA,MACR;AACA,UAAI,SAAS,CAAC;AACd,eAAS,OAAO,UAAU;AAGzB,eAAO,GAAG,IAAI,eAAe,KAAK,SAAS,GAAG,IAAI,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MAC9E;AACA,aAAO;AAAA,IACR;AAEA,QAAI,uBAAuB;AAC3B,QAAI,oBAAoB;AAExB,QAAI,uBAAuB;AAG3B,QAAI,SAAS,SAASC,QAAO,QAAQ,SAAS;AAC7C,gBAAU,MAAM,SAASA,QAAO,OAAO;AACvC,UAAI,QAAQ,UAAU,YAAY,QAAQ,UAAU,UAAU;AAC7D,gBAAQ,SAAS;AAAA,MAClB;AACA,UAAI,QAAQ,QAAQ,UAAU,WAAW,MAAM;AAC/C,UAAI,eAAe,QAAQ;AAE3B,UAAI,YAAY,OAAO,OAAO,CAAC;AAC/B,UAAI,SAAS;AACb,UAAI,UAAU;AACd,UAAI,SAAS,OAAO;AACpB,aAAO,UAAU,QAAQ;AACxB,YAAI,YAAY,OAAO,OAAO,SAAS;AACvC,YAAI,YAAY,UAAU,WAAW;AACrC,YAAI,QAAQ;AAEZ,YAAI,YAAY,MAAQ,YAAY,KAAM;AACzC,cAAI,aAAa,SAAU,aAAa,SAAU,UAAU,QAAQ;AAEnE,gBAAI,QAAQ,OAAO,WAAW,SAAS;AACvC,iBAAK,QAAQ,UAAW,OAAQ;AAE/B,4BAAc,YAAY,SAAU,OAAO,QAAQ,QAAS;AAAA,YAC7D,OAAO;AAGN;AAAA,YACD;AAAA,UACD;AACA,kBAAQ,OAAO,UAAU,SAAS,EAAE,EAAE,YAAY,IAAI;AAAA,QACvD,OAAO;AACN,cAAI,QAAQ,kBAAkB;AAC7B,gBAAI,qBAAqB,KAAK,SAAS,GAAG;AACzC,sBAAQ,OAAO;AAAA,YAChB,OAAO;AACN,sBAAQ,OAAO,UAAU,SAAS,EAAE,EAAE,YAAY,IAAI;AAAA,YACvD;AAAA,UACD,WAAW,iBAAiB,KAAK,SAAS,GAAG;AAC5C,oBAAQ,OAAO,UAAU,SAAS,EAAE,EAAE,YAAY,IAAI;AAAA,UACvD,WAAW,aAAa,QAAQ,CAAC,iBAAiB,aAAa,OAAO,SAAS,aAAa,aAAa,OAAQ,SAAS,cAAc,gBAAgB,kBAAkB,KAAK,SAAS,GAAG;AAC1L,oBAAQ,OAAO;AAAA,UAChB,OAAO;AACN,oBAAQ;AAAA,UACT;AAAA,QACD;AACA,kBAAU;AAAA,MACX;AAEA,UAAI,cAAc;AACjB,YAAI,UAAU,KAAK,MAAM,GAAG;AAC3B,mBAAS,QAAQ,OAAO,MAAM,CAAC;AAAA,QAChC,WAAW,KAAK,KAAK,SAAS,GAAG;AAChC,mBAAS,QAAQ,YAAY,MAAM,OAAO,MAAM,CAAC;AAAA,QAClD;AAAA,MACD;AAKA,eAAS,OAAO,QAAQ,sBAAsB,SAAU,IAAI,IAAI,IAAI;AACnE,YAAI,MAAM,GAAG,SAAS,GAAG;AAExB,iBAAO;AAAA,QACR;AAEA,gBAAQ,MAAM,MAAM;AAAA,MACrB,CAAC;AAED,UAAI,CAAC,gBAAgB,QAAQ,MAAM;AAClC,eAAO,QAAQ,SAAS;AAAA,MACzB;AACA,aAAO;AAAA,IACR;AAGA,WAAO,UAAU;AAAA,MAChB,oBAAoB;AAAA,MACpB,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,QAAQ;AAAA,IACT;AAEA,WAAO,UAAU;AAEjB,WAAO,UAAU;AAAA;AAAA;",
|
||||
"names": ["merge", "cssesc"]
|
||||
}
|
||||
8
node_modules/.vite/deps/chunk-BUSYA2B4.js
generated
vendored
Normal file
8
node_modules/.vite/deps/chunk-BUSYA2B4.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
|
||||
export {
|
||||
__commonJS
|
||||
};
|
||||
7
node_modules/.vite/deps/chunk-BUSYA2B4.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/chunk-BUSYA2B4.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
3
node_modules/.vite/deps/package.json
generated
vendored
Normal file
3
node_modules/.vite/deps/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
59
node_modules/@astrojs/node/LICENSE
generated
vendored
Normal file
59
node_modules/@astrojs/node/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Fred K. Schott
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
|
||||
|
||||
Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
38
node_modules/@astrojs/node/README.md
generated
vendored
Normal file
38
node_modules/@astrojs/node/README.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# @astrojs/node
|
||||
|
||||
This adapter allows Astro to deploy your SSR site to Node targets.
|
||||
|
||||
## Documentation
|
||||
|
||||
Read the [`@astrojs/node` docs][docs]
|
||||
|
||||
## Support
|
||||
|
||||
- Get help in the [Astro Discord][discord]. Post questions in our `#support` forum, or visit our dedicated `#dev` channel to discuss current development and more!
|
||||
|
||||
- Check our [Astro Integration Documentation][astro-integration] for more on integrations.
|
||||
|
||||
- Submit bug reports and feature requests as [GitHub issues][issues].
|
||||
|
||||
## Contributing
|
||||
|
||||
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:
|
||||
|
||||
- [Contributor Manual][contributing]
|
||||
- [Code of Conduct][coc]
|
||||
- [Community Guide][community]
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Copyright (c) 2023–present [Astro][astro]
|
||||
|
||||
[astro]: https://astro.build/
|
||||
[docs]: https://docs.astro.build/en/guides/integrations-guide/node/
|
||||
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
|
||||
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
|
||||
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
|
||||
[discord]: https://astro.build/chat/
|
||||
[issues]: https://github.com/withastro/astro/issues
|
||||
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
|
||||
4
node_modules/@astrojs/node/dist/index.d.ts
generated
vendored
Normal file
4
node_modules/@astrojs/node/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { AstroAdapter, AstroIntegration } from 'astro';
|
||||
import type { Options, UserOptions } from './types.js';
|
||||
export declare function getAdapter(options: Options): AstroAdapter;
|
||||
export default function createIntegration(userOptions: UserOptions): AstroIntegration;
|
||||
123
node_modules/@astrojs/node/dist/index.js
generated
vendored
Normal file
123
node_modules/@astrojs/node/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { writeJson } from "@astrojs/internal-helpers/fs";
|
||||
import { AstroError } from "astro/errors";
|
||||
import { STATIC_HEADERS_FILE } from "./shared.js";
|
||||
function getAdapter(options) {
|
||||
return {
|
||||
name: "@astrojs/node",
|
||||
serverEntrypoint: "@astrojs/node/server.js",
|
||||
previewEntrypoint: "@astrojs/node/preview.js",
|
||||
exports: ["handler", "startServer", "options"],
|
||||
args: options,
|
||||
adapterFeatures: {
|
||||
buildOutput: "server",
|
||||
edgeMiddleware: false,
|
||||
experimentalStaticHeaders: options.experimentalStaticHeaders
|
||||
},
|
||||
supportedAstroFeatures: {
|
||||
hybridOutput: "stable",
|
||||
staticOutput: "stable",
|
||||
serverOutput: "stable",
|
||||
sharpImageService: "stable",
|
||||
i18nDomains: "experimental",
|
||||
envGetSecret: "stable"
|
||||
}
|
||||
};
|
||||
}
|
||||
const protocols = ["http:", "https:"];
|
||||
function createIntegration(userOptions) {
|
||||
if (!userOptions?.mode) {
|
||||
throw new AstroError(`Setting the 'mode' option is required.`);
|
||||
}
|
||||
const { experimentalErrorPageHost } = userOptions;
|
||||
if (experimentalErrorPageHost && (!URL.canParse(experimentalErrorPageHost) || !protocols.includes(new URL(experimentalErrorPageHost).protocol))) {
|
||||
throw new AstroError(
|
||||
`Invalid experimentalErrorPageHost: ${experimentalErrorPageHost}. It should be a valid URL.`
|
||||
);
|
||||
}
|
||||
let _options;
|
||||
let _config = void 0;
|
||||
let _routeToHeaders = void 0;
|
||||
return {
|
||||
name: "@astrojs/node",
|
||||
hooks: {
|
||||
"astro:config:setup": async ({ updateConfig, config, logger, command }) => {
|
||||
let session = config.session;
|
||||
_config = config;
|
||||
if (!session?.driver) {
|
||||
logger.info("Enabling sessions with filesystem storage");
|
||||
session = {
|
||||
...session,
|
||||
driver: "fs-lite",
|
||||
options: {
|
||||
base: fileURLToPath(new URL("sessions", config.cacheDir))
|
||||
}
|
||||
};
|
||||
}
|
||||
updateConfig({
|
||||
build: {
|
||||
redirects: false
|
||||
},
|
||||
image: {
|
||||
endpoint: {
|
||||
route: config.image.endpoint.route ?? "_image",
|
||||
entrypoint: config.image.endpoint.entrypoint ?? (command === "dev" ? "astro/assets/endpoint/dev" : "astro/assets/endpoint/node")
|
||||
}
|
||||
},
|
||||
session,
|
||||
vite: {
|
||||
ssr: {
|
||||
noExternal: ["@astrojs/node"]
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
"astro:build:generated": ({ experimentalRouteToHeaders }) => {
|
||||
_routeToHeaders = experimentalRouteToHeaders;
|
||||
},
|
||||
"astro:config:done": ({ setAdapter, config }) => {
|
||||
_options = {
|
||||
...userOptions,
|
||||
client: config.build.client?.toString(),
|
||||
server: config.build.server?.toString(),
|
||||
host: config.server.host,
|
||||
port: config.server.port,
|
||||
assets: config.build.assets,
|
||||
experimentalStaticHeaders: userOptions.experimentalStaticHeaders ?? false,
|
||||
experimentalErrorPageHost
|
||||
};
|
||||
setAdapter(getAdapter(_options));
|
||||
},
|
||||
"astro:build:done": async () => {
|
||||
if (!_config) {
|
||||
return;
|
||||
}
|
||||
if (_routeToHeaders && _routeToHeaders.size > 0) {
|
||||
const headersFileUrl = new URL(STATIC_HEADERS_FILE, _config.outDir);
|
||||
const headersValue = [];
|
||||
for (const [pathname, { headers }] of _routeToHeaders.entries()) {
|
||||
if (_config.experimental.csp) {
|
||||
const csp = headers.get("Content-Security-Policy");
|
||||
if (csp) {
|
||||
headersValue.push({
|
||||
pathname,
|
||||
headers: [
|
||||
{
|
||||
key: "Content-Security-Policy",
|
||||
value: csp
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
await writeJson(headersFileUrl, headersValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
createIntegration as default,
|
||||
getAdapter
|
||||
};
|
||||
4
node_modules/@astrojs/node/dist/log-listening-on.d.ts
generated
vendored
Normal file
4
node_modules/@astrojs/node/dist/log-listening-on.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type http from 'node:http';
|
||||
import https from 'node:https';
|
||||
import type { AstroIntegrationLogger } from 'astro';
|
||||
export declare function logListeningOn(logger: AstroIntegrationLogger, server: http.Server | https.Server, configuredHost: string | boolean | undefined): Promise<void>;
|
||||
57
node_modules/@astrojs/node/dist/log-listening-on.js
generated
vendored
Normal file
57
node_modules/@astrojs/node/dist/log-listening-on.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import https from "node:https";
|
||||
import os from "node:os";
|
||||
const wildcardHosts = /* @__PURE__ */ new Set(["0.0.0.0", "::", "0000:0000:0000:0000:0000:0000:0000:0000"]);
|
||||
async function logListeningOn(logger, server, configuredHost) {
|
||||
await new Promise((resolve) => server.once("listening", resolve));
|
||||
const protocol = server instanceof https.Server ? "https" : "http";
|
||||
const host = getResolvedHostForHttpServer(configuredHost);
|
||||
const { port } = server.address();
|
||||
const address = getNetworkAddress(protocol, host, port);
|
||||
if (host === void 0 || wildcardHosts.has(host)) {
|
||||
logger.info(
|
||||
`Server listening on
|
||||
local: ${address.local[0]}
|
||||
network: ${address.network[0]}
|
||||
`
|
||||
);
|
||||
} else {
|
||||
logger.info(`Server listening on ${address.local[0]}`);
|
||||
}
|
||||
}
|
||||
function getResolvedHostForHttpServer(host) {
|
||||
if (host === false) {
|
||||
return "localhost";
|
||||
} else if (host === true) {
|
||||
return void 0;
|
||||
} else {
|
||||
return host;
|
||||
}
|
||||
}
|
||||
function getNetworkAddress(protocol = "http", hostname, port, base) {
|
||||
const NetworkAddress = {
|
||||
local: [],
|
||||
network: []
|
||||
};
|
||||
Object.values(os.networkInterfaces()).flatMap((nInterface) => nInterface ?? []).filter(
|
||||
(detail) => detail && detail.address && (detail.family === "IPv4" || // @ts-expect-error Node 18.0 - 18.3 returns number
|
||||
detail.family === 4)
|
||||
).forEach((detail) => {
|
||||
let host = detail.address.replace(
|
||||
"127.0.0.1",
|
||||
hostname === void 0 || wildcardHosts.has(hostname) ? "localhost" : hostname
|
||||
);
|
||||
if (host.includes(":")) {
|
||||
host = `[${host}]`;
|
||||
}
|
||||
const url = `${protocol}://${host}:${port}${base ? base : ""}`;
|
||||
if (detail.address.includes("127.0.0.1")) {
|
||||
NetworkAddress.local.push(url);
|
||||
} else {
|
||||
NetworkAddress.network.push(url);
|
||||
}
|
||||
});
|
||||
return NetworkAddress;
|
||||
}
|
||||
export {
|
||||
logListeningOn
|
||||
};
|
||||
11
node_modules/@astrojs/node/dist/middleware.d.ts
generated
vendored
Normal file
11
node_modules/@astrojs/node/dist/middleware.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { NodeApp } from 'astro/app/node';
|
||||
import type { Options, RequestHandler } from './types.js';
|
||||
/**
|
||||
* Creates a middleware that can be used with Express, Connect, etc.
|
||||
*
|
||||
* Similar to `createAppHandler` but can additionally be placed in the express
|
||||
* chain as an error middleware.
|
||||
*
|
||||
* https://expressjs.com/en/guide/using-middleware.html#middleware.error-handling
|
||||
*/
|
||||
export default function createMiddleware(app: NodeApp, options: Options): RequestHandler;
|
||||
29
node_modules/@astrojs/node/dist/middleware.js
generated
vendored
Normal file
29
node_modules/@astrojs/node/dist/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { createAppHandler } from "./serve-app.js";
|
||||
function createMiddleware(app, options) {
|
||||
const handler = createAppHandler(app, options);
|
||||
const logger = app.getAdapterLogger();
|
||||
return async (...args) => {
|
||||
const [req, res, next, locals] = args;
|
||||
if (req instanceof Error) {
|
||||
const error = req;
|
||||
if (next) {
|
||||
return next(error);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
try {
|
||||
await handler(req, res, next, locals);
|
||||
} catch (err) {
|
||||
logger.error(`Could not render ${req.url}`);
|
||||
console.error(err);
|
||||
if (!res.headersSent) {
|
||||
res.writeHead(500, `Server error`);
|
||||
res.end();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
createMiddleware as default
|
||||
};
|
||||
1
node_modules/@astrojs/node/dist/polyfill.d.ts
generated
vendored
Normal file
1
node_modules/@astrojs/node/dist/polyfill.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/@astrojs/node/dist/polyfill.js
generated
vendored
Normal file
2
node_modules/@astrojs/node/dist/polyfill.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { applyPolyfills } from "astro/app/node";
|
||||
applyPolyfills();
|
||||
3
node_modules/@astrojs/node/dist/preview.d.ts
generated
vendored
Normal file
3
node_modules/@astrojs/node/dist/preview.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { CreatePreviewServer } from 'astro';
|
||||
declare const createPreviewServer: CreatePreviewServer;
|
||||
export { createPreviewServer as default };
|
||||
50
node_modules/@astrojs/node/dist/preview.js
generated
vendored
Normal file
50
node_modules/@astrojs/node/dist/preview.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { AstroError } from "astro/errors";
|
||||
import { logListeningOn } from "./log-listening-on.js";
|
||||
import { createServer } from "./standalone.js";
|
||||
const createPreviewServer = async (preview) => {
|
||||
let ssrHandler;
|
||||
try {
|
||||
process.env.ASTRO_NODE_AUTOSTART = "disabled";
|
||||
const ssrModule = await import(preview.serverEntrypoint.toString());
|
||||
if (typeof ssrModule.handler === "function") {
|
||||
ssrHandler = ssrModule.handler;
|
||||
} else {
|
||||
throw new AstroError(
|
||||
`The server entrypoint doesn't have a handler. Are you sure this is the right file?`
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === "ERR_MODULE_NOT_FOUND" && err.url === preview.serverEntrypoint.href) {
|
||||
throw new AstroError(
|
||||
`The server entrypoint ${fileURLToPath(
|
||||
preview.serverEntrypoint
|
||||
)} does not exist. Have you ran a build yet?`
|
||||
);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
const host = process.env.HOST ?? preview.host ?? "0.0.0.0";
|
||||
const port = preview.port ?? 4321;
|
||||
const server = createServer(ssrHandler, host, port);
|
||||
if (preview.headers) {
|
||||
server.server.addListener("request", (_, res) => {
|
||||
if (res.statusCode === 200) {
|
||||
for (const [name, value] of Object.entries(preview.headers ?? {})) {
|
||||
if (value) res.setHeader(name, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
logListeningOn(preview.logger, server.server, host);
|
||||
await new Promise((resolve, reject) => {
|
||||
server.server.once("listening", resolve);
|
||||
server.server.once("error", reject);
|
||||
server.server.listen(port, host);
|
||||
});
|
||||
return server;
|
||||
};
|
||||
export {
|
||||
createPreviewServer as default
|
||||
};
|
||||
8
node_modules/@astrojs/node/dist/serve-app.d.ts
generated
vendored
Normal file
8
node_modules/@astrojs/node/dist/serve-app.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { NodeApp } from 'astro/app/node';
|
||||
import type { Options, RequestHandler } from './types.js';
|
||||
/**
|
||||
* Creates a Node.js http listener for on-demand rendered pages, compatible with http.createServer and Connect middleware.
|
||||
* If the next callback is provided, it will be called if the request does not have a matching route.
|
||||
* Intended to be used in both standalone and middleware mode.
|
||||
*/
|
||||
export declare function createAppHandler(app: NodeApp, options: Options): RequestHandler;
|
||||
53
node_modules/@astrojs/node/dist/serve-app.js
generated
vendored
Normal file
53
node_modules/@astrojs/node/dist/serve-app.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { NodeApp } from "astro/app/node";
|
||||
function createAppHandler(app, options) {
|
||||
const als = new AsyncLocalStorage();
|
||||
const logger = app.getAdapterLogger();
|
||||
process.on("unhandledRejection", (reason) => {
|
||||
const requestUrl = als.getStore();
|
||||
logger.error(`Unhandled rejection while rendering ${requestUrl}`);
|
||||
console.error(reason);
|
||||
});
|
||||
const originUrl = options.experimentalErrorPageHost ? new URL(options.experimentalErrorPageHost) : void 0;
|
||||
const prerenderedErrorPageFetch = originUrl ? (url) => {
|
||||
const errorPageUrl = new URL(url);
|
||||
errorPageUrl.protocol = originUrl.protocol;
|
||||
errorPageUrl.host = originUrl.host;
|
||||
return fetch(errorPageUrl);
|
||||
} : void 0;
|
||||
return async (req, res, next, locals) => {
|
||||
let request;
|
||||
try {
|
||||
request = NodeApp.createRequest(req, {
|
||||
allowedDomains: app.getAllowedDomains?.() ?? []
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error(`Could not render ${req.url}`);
|
||||
console.error(err);
|
||||
res.statusCode = 500;
|
||||
res.end("Internal Server Error");
|
||||
return;
|
||||
}
|
||||
const routeData = app.match(request, true);
|
||||
if (routeData) {
|
||||
const response = await als.run(
|
||||
request.url,
|
||||
() => app.render(request, {
|
||||
addCookieHeader: true,
|
||||
locals,
|
||||
routeData,
|
||||
prerenderedErrorPageFetch
|
||||
})
|
||||
);
|
||||
await NodeApp.writeResponse(response, res);
|
||||
} else if (next) {
|
||||
return next();
|
||||
} else {
|
||||
const response = await app.render(req, { addCookieHeader: true, prerenderedErrorPageFetch });
|
||||
await NodeApp.writeResponse(response, res);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
createAppHandler
|
||||
};
|
||||
10
node_modules/@astrojs/node/dist/serve-static.d.ts
generated
vendored
Normal file
10
node_modules/@astrojs/node/dist/serve-static.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import type { NodeApp } from 'astro/app/node';
|
||||
import type { Options } from './types.js';
|
||||
/**
|
||||
* Creates a Node.js http listener for static files and prerendered pages.
|
||||
* In standalone mode, the static handler is queried first for the static files.
|
||||
* If one matching the request path is not found, it relegates to the SSR handler.
|
||||
* Intended to be used only in the standalone mode.
|
||||
*/
|
||||
export declare function createStaticHandler(app: NodeApp, options: Options): (req: IncomingMessage, res: ServerResponse, ssr: () => unknown) => ServerResponse<IncomingMessage> | undefined;
|
||||
111
node_modules/@astrojs/node/dist/serve-static.js
generated
vendored
Normal file
111
node_modules/@astrojs/node/dist/serve-static.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import url from "node:url";
|
||||
import { hasFileExtension, isInternalPath } from "@astrojs/internal-helpers/path";
|
||||
import send from "send";
|
||||
function createStaticHandler(app, options) {
|
||||
const client = resolveClientDir(options);
|
||||
return (req, res, ssr) => {
|
||||
if (req.url) {
|
||||
const [urlPath, urlQuery] = req.url.split("?");
|
||||
const filePath = path.join(client, app.removeBase(urlPath));
|
||||
let isDirectory = false;
|
||||
try {
|
||||
isDirectory = fs.lstatSync(filePath).isDirectory();
|
||||
} catch {
|
||||
}
|
||||
const { trailingSlash = "ignore" } = options;
|
||||
const hasSlash = urlPath.endsWith("/");
|
||||
let pathname = urlPath;
|
||||
if (app.headersMap && app.headersMap.length > 0) {
|
||||
const routeData = app.match(req, true);
|
||||
if (routeData && routeData.prerender) {
|
||||
const matchedRoute = app.headersMap.find((header) => header.pathname.includes(pathname));
|
||||
if (matchedRoute) {
|
||||
for (const header of matchedRoute.headers) {
|
||||
res.setHeader(header.key, header.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (trailingSlash) {
|
||||
case "never": {
|
||||
if (isDirectory && urlPath !== "/" && hasSlash) {
|
||||
pathname = urlPath.slice(0, -1) + (urlQuery ? "?" + urlQuery : "");
|
||||
res.statusCode = 301;
|
||||
res.setHeader("Location", pathname);
|
||||
return res.end();
|
||||
}
|
||||
if (isDirectory && !hasSlash) {
|
||||
pathname = `${urlPath}/index.html`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "ignore": {
|
||||
if (isDirectory && !hasSlash) {
|
||||
pathname = `${urlPath}/index.html`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "always": {
|
||||
if (!hasSlash && !hasFileExtension(urlPath) && !isInternalPath(urlPath)) {
|
||||
pathname = urlPath + "/" + (urlQuery ? "?" + urlQuery : "");
|
||||
res.statusCode = 301;
|
||||
res.setHeader("Location", pathname);
|
||||
return res.end();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pathname = prependForwardSlash(app.removeBase(pathname));
|
||||
const stream = send(req, pathname, {
|
||||
root: client,
|
||||
dotfiles: pathname.startsWith("/.well-known/") ? "allow" : "deny"
|
||||
});
|
||||
let forwardError = false;
|
||||
stream.on("error", (err) => {
|
||||
if (forwardError) {
|
||||
console.error(err.toString());
|
||||
res.writeHead(500);
|
||||
res.end("Internal server error");
|
||||
return;
|
||||
}
|
||||
ssr();
|
||||
});
|
||||
stream.on("headers", (_res) => {
|
||||
if (pathname.startsWith(`/${options.assets}/`)) {
|
||||
_res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
|
||||
}
|
||||
});
|
||||
stream.on("file", () => {
|
||||
forwardError = true;
|
||||
});
|
||||
stream.pipe(res);
|
||||
} else {
|
||||
ssr();
|
||||
}
|
||||
};
|
||||
}
|
||||
function resolveClientDir(options) {
|
||||
const clientURLRaw = new URL(options.client);
|
||||
const serverURLRaw = new URL(options.server);
|
||||
const rel = path.relative(url.fileURLToPath(serverURLRaw), url.fileURLToPath(clientURLRaw));
|
||||
const serverFolder = path.basename(options.server);
|
||||
let serverEntryFolderURL = path.dirname(import.meta.url);
|
||||
while (!serverEntryFolderURL.endsWith(serverFolder)) {
|
||||
serverEntryFolderURL = path.dirname(serverEntryFolderURL);
|
||||
}
|
||||
const serverEntryURL = serverEntryFolderURL + "/entry.mjs";
|
||||
const clientURL = new URL(appendForwardSlash(rel), serverEntryURL);
|
||||
const client = url.fileURLToPath(clientURL);
|
||||
return client;
|
||||
}
|
||||
function prependForwardSlash(pth) {
|
||||
return pth.startsWith("/") ? pth : "/" + pth;
|
||||
}
|
||||
function appendForwardSlash(pth) {
|
||||
return pth.endsWith("/") ? pth : pth + "/";
|
||||
}
|
||||
export {
|
||||
createStaticHandler
|
||||
};
|
||||
18
node_modules/@astrojs/node/dist/server.d.ts
generated
vendored
Normal file
18
node_modules/@astrojs/node/dist/server.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import './polyfill.js';
|
||||
import type { SSRManifest } from 'astro';
|
||||
import type { Options } from './types.js';
|
||||
export declare function createExports(manifest: SSRManifest, options: Options): {
|
||||
options: Options;
|
||||
handler: import("./types.js").RequestHandler;
|
||||
startServer: () => {
|
||||
server: {
|
||||
host: string;
|
||||
port: number;
|
||||
closed(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
server: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
||||
};
|
||||
done: Promise<void>;
|
||||
};
|
||||
};
|
||||
export declare function start(manifest: SSRManifest, options: Options): void;
|
||||
56
node_modules/@astrojs/node/dist/server.js
generated
vendored
Normal file
56
node_modules/@astrojs/node/dist/server.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import "./polyfill.js";
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { NodeApp } from "astro/app/node";
|
||||
import { setGetEnv } from "astro/env/setup";
|
||||
import createMiddleware from "./middleware.js";
|
||||
import { STATIC_HEADERS_FILE } from "./shared.js";
|
||||
import startServer, { createStandaloneHandler } from "./standalone.js";
|
||||
setGetEnv((key) => process.env[key]);
|
||||
function createExports(manifest, options) {
|
||||
const app = new NodeApp(manifest, !options.experimentalDisableStreaming);
|
||||
let headersMap = void 0;
|
||||
if (options.experimentalStaticHeaders) {
|
||||
headersMap = readHeadersJson(manifest.outDir);
|
||||
}
|
||||
if (headersMap) {
|
||||
app.setHeadersMap(headersMap);
|
||||
}
|
||||
options.trailingSlash = manifest.trailingSlash;
|
||||
return {
|
||||
options,
|
||||
handler: options.mode === "middleware" ? createMiddleware(app, options) : createStandaloneHandler(app, options),
|
||||
startServer: () => startServer(app, options)
|
||||
};
|
||||
}
|
||||
function start(manifest, options) {
|
||||
if (options.mode !== "standalone" || process.env.ASTRO_NODE_AUTOSTART === "disabled") {
|
||||
return;
|
||||
}
|
||||
let headersMap = void 0;
|
||||
if (options.experimentalStaticHeaders) {
|
||||
headersMap = readHeadersJson(manifest.outDir);
|
||||
}
|
||||
const app = new NodeApp(manifest, !options.experimentalDisableStreaming);
|
||||
if (headersMap) {
|
||||
app.setHeadersMap(headersMap);
|
||||
}
|
||||
startServer(app, options);
|
||||
}
|
||||
function readHeadersJson(outDir) {
|
||||
let headersMap = void 0;
|
||||
const headersUrl = new URL(STATIC_HEADERS_FILE, outDir);
|
||||
if (existsSync(headersUrl)) {
|
||||
const content = readFileSync(headersUrl, "utf-8");
|
||||
try {
|
||||
headersMap = JSON.parse(content);
|
||||
} catch (e) {
|
||||
console.error("[@astrojs/node] Error parsing _headers.json: " + e.message);
|
||||
console.error("[@astrojs/node] Please make sure your _headers.json is valid JSON.");
|
||||
}
|
||||
}
|
||||
return headersMap;
|
||||
}
|
||||
export {
|
||||
createExports,
|
||||
start
|
||||
};
|
||||
1
node_modules/@astrojs/node/dist/shared.d.ts
generated
vendored
Normal file
1
node_modules/@astrojs/node/dist/shared.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const STATIC_HEADERS_FILE = "_experimentalHeaders.json";
|
||||
4
node_modules/@astrojs/node/dist/shared.js
generated
vendored
Normal file
4
node_modules/@astrojs/node/dist/shared.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
const STATIC_HEADERS_FILE = "_experimentalHeaders.json";
|
||||
export {
|
||||
STATIC_HEADERS_FILE
|
||||
};
|
||||
23
node_modules/@astrojs/node/dist/standalone.d.ts
generated
vendored
Normal file
23
node_modules/@astrojs/node/dist/standalone.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import http from 'node:http';
|
||||
import https from 'node:https';
|
||||
import type { NodeApp } from 'astro/app/node';
|
||||
import type { Options } from './types.js';
|
||||
export declare const hostOptions: (host: Options["host"]) => string;
|
||||
export default function standalone(app: NodeApp, options: Options): {
|
||||
server: {
|
||||
host: string;
|
||||
port: number;
|
||||
closed(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse> | https.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
||||
};
|
||||
done: Promise<void>;
|
||||
};
|
||||
export declare function createStandaloneHandler(app: NodeApp, options: Options): (req: http.IncomingMessage, res: http.ServerResponse) => void;
|
||||
export declare function createServer(listener: http.RequestListener, host: string, port: number): {
|
||||
host: string;
|
||||
port: number;
|
||||
closed(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse> | https.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
||||
};
|
||||
82
node_modules/@astrojs/node/dist/standalone.js
generated
vendored
Normal file
82
node_modules/@astrojs/node/dist/standalone.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
import fs from "node:fs";
|
||||
import http from "node:http";
|
||||
import https from "node:https";
|
||||
import enableDestroy from "server-destroy";
|
||||
import { logListeningOn } from "./log-listening-on.js";
|
||||
import { createAppHandler } from "./serve-app.js";
|
||||
import { createStaticHandler } from "./serve-static.js";
|
||||
const hostOptions = (host) => {
|
||||
if (typeof host === "boolean") {
|
||||
return host ? "0.0.0.0" : "localhost";
|
||||
}
|
||||
return host;
|
||||
};
|
||||
function standalone(app, options) {
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080;
|
||||
const host = process.env.HOST ?? hostOptions(options.host);
|
||||
const handler = createStandaloneHandler(app, options);
|
||||
const server = createServer(handler, host, port);
|
||||
server.server.listen(port, host);
|
||||
if (process.env.ASTRO_NODE_LOGGING !== "disabled") {
|
||||
logListeningOn(app.getAdapterLogger(), server.server, host);
|
||||
}
|
||||
return {
|
||||
server,
|
||||
done: server.closed()
|
||||
};
|
||||
}
|
||||
function createStandaloneHandler(app, options) {
|
||||
const appHandler = createAppHandler(app, options);
|
||||
const staticHandler = createStaticHandler(app, options);
|
||||
return (req, res) => {
|
||||
try {
|
||||
decodeURI(req.url);
|
||||
} catch {
|
||||
res.writeHead(400);
|
||||
res.end("Bad request.");
|
||||
return;
|
||||
}
|
||||
staticHandler(req, res, () => appHandler(req, res));
|
||||
};
|
||||
}
|
||||
function createServer(listener, host, port) {
|
||||
let httpServer;
|
||||
if (process.env.SERVER_CERT_PATH && process.env.SERVER_KEY_PATH) {
|
||||
httpServer = https.createServer(
|
||||
{
|
||||
key: fs.readFileSync(process.env.SERVER_KEY_PATH),
|
||||
cert: fs.readFileSync(process.env.SERVER_CERT_PATH)
|
||||
},
|
||||
listener
|
||||
);
|
||||
} else {
|
||||
httpServer = http.createServer(listener);
|
||||
}
|
||||
enableDestroy(httpServer);
|
||||
const closed = new Promise((resolve, reject) => {
|
||||
httpServer.addListener("close", resolve);
|
||||
httpServer.addListener("error", reject);
|
||||
});
|
||||
const previewable = {
|
||||
host,
|
||||
port,
|
||||
closed() {
|
||||
return closed;
|
||||
},
|
||||
async stop() {
|
||||
await new Promise((resolve, reject) => {
|
||||
httpServer.destroy((err) => err ? reject(err) : resolve(void 0));
|
||||
});
|
||||
}
|
||||
};
|
||||
return {
|
||||
server: httpServer,
|
||||
...previewable
|
||||
};
|
||||
}
|
||||
export {
|
||||
createServer,
|
||||
createStandaloneHandler,
|
||||
standalone as default,
|
||||
hostOptions
|
||||
};
|
||||
47
node_modules/@astrojs/node/dist/types.d.ts
generated
vendored
Normal file
47
node_modules/@astrojs/node/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import type { SSRManifest } from 'astro';
|
||||
export interface UserOptions {
|
||||
/**
|
||||
* Specifies the mode that the adapter builds to.
|
||||
*
|
||||
* - 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
|
||||
* - 'standalone' - Build to a standalone server. The server starts up just by running the built script.
|
||||
*/
|
||||
mode: 'middleware' | 'standalone';
|
||||
/**
|
||||
* Disables HTML streaming. This is useful for example if there are constraints from your host.
|
||||
*/
|
||||
experimentalDisableStreaming?: boolean;
|
||||
/**
|
||||
* If enabled, the adapter will save [static headers in the framework API file](https://docs.netlify.com/frameworks-api/#headers).
|
||||
*
|
||||
* Here the list of the headers that are added:
|
||||
* - The CSP header of the static pages is added when CSP support is enabled.
|
||||
*/
|
||||
experimentalStaticHeaders?: boolean;
|
||||
/**
|
||||
* The host that should be used if the server needs to fetch the prerendered error page.
|
||||
* If not provided, this will default to the host of the server. This should be set if the server
|
||||
* should fetch prerendered error pages from a different host than the public URL of the server.
|
||||
* This is useful for example if the server is behind a reverse proxy or a load balancer, or if
|
||||
* static files are hosted on a different domain. Do not include a path in the URL: it will be ignored.
|
||||
*/
|
||||
experimentalErrorPageHost?: string | URL;
|
||||
}
|
||||
export interface Options extends UserOptions {
|
||||
host: string | boolean;
|
||||
port: number;
|
||||
server: string;
|
||||
client: string;
|
||||
assets: string;
|
||||
trailingSlash?: SSRManifest['trailingSlash'];
|
||||
experimentalStaticHeaders: boolean;
|
||||
}
|
||||
export type RequestHandler = (...args: RequestHandlerParams) => void | Promise<void>;
|
||||
type RequestHandlerParams = [
|
||||
req: IncomingMessage,
|
||||
res: ServerResponse,
|
||||
next?: (err?: unknown) => void,
|
||||
locals?: object
|
||||
];
|
||||
export {};
|
||||
0
node_modules/@astrojs/node/dist/types.js
generated
vendored
Normal file
0
node_modules/@astrojs/node/dist/types.js
generated
vendored
Normal file
57
node_modules/@astrojs/node/package.json
generated
vendored
Normal file
57
node_modules/@astrojs/node/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "@astrojs/node",
|
||||
"description": "Deploy your site to a Node.js server",
|
||||
"version": "9.5.0",
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.ts",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/withastro/astro.git",
|
||||
"directory": "packages/integrations/node"
|
||||
},
|
||||
"keywords": [
|
||||
"withastro",
|
||||
"astro-adapter"
|
||||
],
|
||||
"bugs": "https://github.com/withastro/astro/issues",
|
||||
"homepage": "https://docs.astro.build/en/guides/integrations-guide/node/",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./server.js": "./dist/server.js",
|
||||
"./preview.js": "./dist/preview.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"send": "^1.2.0",
|
||||
"server-destroy": "^1.0.1",
|
||||
"@astrojs/internal-helpers": "0.7.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^5.14.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.6",
|
||||
"@types/send": "^0.17.5",
|
||||
"@types/server-destroy": "^1.0.4",
|
||||
"cheerio": "1.1.2",
|
||||
"devalue": "^5.3.2",
|
||||
"express": "^4.21.2",
|
||||
"node-mocks-http": "^1.17.2",
|
||||
"astro": "5.14.5",
|
||||
"astro-scripts": "0.0.14"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
||||
"test": "astro-scripts test \"test/**/*.test.js\""
|
||||
}
|
||||
}
|
||||
59
node_modules/@astrojs/sitemap/LICENSE
generated
vendored
Normal file
59
node_modules/@astrojs/sitemap/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Fred K. Schott
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
|
||||
|
||||
Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
38
node_modules/@astrojs/sitemap/README.md
generated
vendored
Normal file
38
node_modules/@astrojs/sitemap/README.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# @astrojs/sitemap 🗺
|
||||
|
||||
This **[Astro integration][astro-integration]** generates a sitemap based on your pages when you build your Astro project.
|
||||
|
||||
## Documentation
|
||||
|
||||
Read the [`@astrojs/sitemap` docs][docs]
|
||||
|
||||
## Support
|
||||
|
||||
- Get help in the [Astro Discord][discord]. Post questions in our `#support` forum, or visit our dedicated `#dev` channel to discuss current development and more!
|
||||
|
||||
- Check our [Astro Integration Documentation][astro-integration] for more on integrations.
|
||||
|
||||
- Submit bug reports and feature requests as [GitHub issues][issues].
|
||||
|
||||
## Contributing
|
||||
|
||||
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:
|
||||
|
||||
- [Contributor Manual][contributing]
|
||||
- [Code of Conduct][coc]
|
||||
- [Community Guide][community]
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Copyright (c) 2023–present [Astro][astro]
|
||||
|
||||
[astro]: https://astro.build/
|
||||
[docs]: https://docs.astro.build/en/guides/integrations-guide/sitemap/
|
||||
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
|
||||
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
|
||||
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
|
||||
[discord]: https://astro.build/chat/
|
||||
[issues]: https://github.com/withastro/astro/issues
|
||||
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
|
||||
10
node_modules/@astrojs/sitemap/dist/config-defaults.d.ts
generated
vendored
Normal file
10
node_modules/@astrojs/sitemap/dist/config-defaults.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export declare const SITEMAP_CONFIG_DEFAULTS: {
|
||||
filenameBase: string;
|
||||
entryLimit: number;
|
||||
namespaces: {
|
||||
news: true;
|
||||
xhtml: true;
|
||||
image: true;
|
||||
video: true;
|
||||
};
|
||||
};
|
||||
13
node_modules/@astrojs/sitemap/dist/config-defaults.js
generated
vendored
Normal file
13
node_modules/@astrojs/sitemap/dist/config-defaults.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
const SITEMAP_CONFIG_DEFAULTS = {
|
||||
filenameBase: "sitemap",
|
||||
entryLimit: 45e3,
|
||||
namespaces: {
|
||||
news: true,
|
||||
xhtml: true,
|
||||
image: true,
|
||||
video: true
|
||||
}
|
||||
};
|
||||
export {
|
||||
SITEMAP_CONFIG_DEFAULTS
|
||||
};
|
||||
3
node_modules/@astrojs/sitemap/dist/generate-sitemap.d.ts
generated
vendored
Normal file
3
node_modules/@astrojs/sitemap/dist/generate-sitemap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { SitemapItem, SitemapOptions } from './index.js';
|
||||
/** Construct sitemap.xml given a set of URLs */
|
||||
export declare function generateSitemap(pages: string[], finalSiteUrl: string, opts?: SitemapOptions): SitemapItem[];
|
||||
52
node_modules/@astrojs/sitemap/dist/generate-sitemap.js
generated
vendored
Normal file
52
node_modules/@astrojs/sitemap/dist/generate-sitemap.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { parseI18nUrl } from "./utils/parse-i18n-url.js";
|
||||
function generateSitemap(pages, finalSiteUrl, opts) {
|
||||
const { changefreq, priority, lastmod: lastmodSrc, i18n } = opts ?? {};
|
||||
const urls = [...pages];
|
||||
urls.sort((a, b) => a.localeCompare(b, "en", { numeric: true }));
|
||||
const lastmod = lastmodSrc?.toISOString();
|
||||
const { defaultLocale, locales } = i18n ?? {};
|
||||
let getI18nLinks;
|
||||
if (defaultLocale && locales) {
|
||||
getI18nLinks = createGetI18nLinks(urls, defaultLocale, locales, finalSiteUrl);
|
||||
}
|
||||
const urlData = urls.map((url, i) => ({
|
||||
url,
|
||||
links: getI18nLinks?.(i),
|
||||
lastmod,
|
||||
priority,
|
||||
changefreq
|
||||
}));
|
||||
return urlData;
|
||||
}
|
||||
function createGetI18nLinks(urls, defaultLocale, locales, finalSiteUrl) {
|
||||
const parsedI18nUrls = urls.map((url) => parseI18nUrl(url, defaultLocale, locales, finalSiteUrl));
|
||||
const i18nPathToLinksCache = /* @__PURE__ */ new Map();
|
||||
return (urlIndex) => {
|
||||
const i18nUrl = parsedI18nUrls[urlIndex];
|
||||
if (!i18nUrl) {
|
||||
return void 0;
|
||||
}
|
||||
const cached = i18nPathToLinksCache.get(i18nUrl.path);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const links = [];
|
||||
for (let i = 0; i < parsedI18nUrls.length; i++) {
|
||||
const parsed = parsedI18nUrls[i];
|
||||
if (parsed?.path === i18nUrl.path) {
|
||||
links.push({
|
||||
url: urls[i],
|
||||
lang: locales[parsed.locale]
|
||||
});
|
||||
}
|
||||
}
|
||||
if (links.length <= 1) {
|
||||
return void 0;
|
||||
}
|
||||
i18nPathToLinksCache.set(i18nUrl.path, links);
|
||||
return links;
|
||||
};
|
||||
}
|
||||
export {
|
||||
generateSitemap
|
||||
};
|
||||
30
node_modules/@astrojs/sitemap/dist/index.d.ts
generated
vendored
Normal file
30
node_modules/@astrojs/sitemap/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { AstroIntegration } from 'astro';
|
||||
import type { EnumChangefreq, LinkItem as LinkItemBase, SitemapItemLoose } from 'sitemap';
|
||||
export { EnumChangefreq as ChangeFreqEnum } from 'sitemap';
|
||||
export type ChangeFreq = `${EnumChangefreq}`;
|
||||
export type SitemapItem = Pick<SitemapItemLoose, 'url' | 'lastmod' | 'changefreq' | 'priority' | 'links'>;
|
||||
export type LinkItem = LinkItemBase;
|
||||
export type SitemapOptions = {
|
||||
filenameBase?: string;
|
||||
filter?(page: string): boolean;
|
||||
customSitemaps?: string[];
|
||||
customPages?: string[];
|
||||
i18n?: {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
};
|
||||
entryLimit?: number;
|
||||
changefreq?: ChangeFreq;
|
||||
lastmod?: Date;
|
||||
priority?: number;
|
||||
serialize?(item: SitemapItem): SitemapItem | Promise<SitemapItem | undefined> | undefined;
|
||||
xslURL?: string;
|
||||
namespaces?: {
|
||||
news?: boolean;
|
||||
xhtml?: boolean;
|
||||
image?: boolean;
|
||||
video?: boolean;
|
||||
};
|
||||
} | undefined;
|
||||
declare const createPlugin: (options?: SitemapOptions) => AstroIntegration;
|
||||
export default createPlugin;
|
||||
138
node_modules/@astrojs/sitemap/dist/index.js
generated
vendored
Normal file
138
node_modules/@astrojs/sitemap/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { ZodError } from "zod";
|
||||
import { generateSitemap } from "./generate-sitemap.js";
|
||||
import { validateOptions } from "./validate-options.js";
|
||||
import { writeSitemap } from "./write-sitemap.js";
|
||||
import { EnumChangefreq } from "sitemap";
|
||||
function formatConfigErrorMessage(err) {
|
||||
const errorList = err.issues.map((issue) => ` ${issue.path.join(".")} ${issue.message + "."}`);
|
||||
return errorList.join("\n");
|
||||
}
|
||||
const PKG_NAME = "@astrojs/sitemap";
|
||||
const STATUS_CODE_PAGES = /* @__PURE__ */ new Set(["404", "500"]);
|
||||
const isStatusCodePage = (locales) => {
|
||||
const statusPathNames = new Set(
|
||||
locales.flatMap((locale) => [...STATUS_CODE_PAGES].map((page) => `${locale}/${page}`)).concat([...STATUS_CODE_PAGES])
|
||||
);
|
||||
return (pathname) => {
|
||||
if (pathname.endsWith("/")) {
|
||||
pathname = pathname.slice(0, -1);
|
||||
}
|
||||
if (pathname.startsWith("/")) {
|
||||
pathname = pathname.slice(1);
|
||||
}
|
||||
return statusPathNames.has(pathname);
|
||||
};
|
||||
};
|
||||
const createPlugin = (options) => {
|
||||
let config;
|
||||
return {
|
||||
name: PKG_NAME,
|
||||
hooks: {
|
||||
"astro:config:done": async ({ config: cfg }) => {
|
||||
config = cfg;
|
||||
},
|
||||
"astro:build:done": async ({ dir, routes, pages, logger }) => {
|
||||
try {
|
||||
if (!config.site) {
|
||||
logger.warn(
|
||||
"The Sitemap integration requires the `site` astro.config option. Skipping."
|
||||
);
|
||||
return;
|
||||
}
|
||||
const opts = validateOptions(config.site, options);
|
||||
const { filenameBase, filter, customPages, customSitemaps, serialize, entryLimit } = opts;
|
||||
const outFile = `${filenameBase}-index.xml`;
|
||||
const finalSiteUrl = new URL(config.base, config.site);
|
||||
const shouldIgnoreStatus = isStatusCodePage(Object.keys(opts.i18n?.locales ?? {}));
|
||||
let pageUrls = pages.filter((p) => !shouldIgnoreStatus(p.pathname)).map((p) => {
|
||||
if (p.pathname !== "" && !finalSiteUrl.pathname.endsWith("/"))
|
||||
finalSiteUrl.pathname += "/";
|
||||
if (p.pathname.startsWith("/")) p.pathname = p.pathname.slice(1);
|
||||
const fullPath = finalSiteUrl.pathname + p.pathname;
|
||||
return new URL(fullPath, finalSiteUrl).href;
|
||||
});
|
||||
const routeUrls = routes.reduce((urls, r) => {
|
||||
if (r.type !== "page") return urls;
|
||||
if (r.pathname) {
|
||||
if (shouldIgnoreStatus(r.pathname ?? r.route)) return urls;
|
||||
let fullPath = finalSiteUrl.pathname;
|
||||
if (fullPath.endsWith("/")) fullPath += r.generate(r.pathname).substring(1);
|
||||
else fullPath += r.generate(r.pathname);
|
||||
const newUrl = new URL(fullPath, finalSiteUrl).href;
|
||||
if (config.trailingSlash === "never") {
|
||||
urls.push(newUrl);
|
||||
} else if (config.build.format === "directory" && !newUrl.endsWith("/")) {
|
||||
urls.push(newUrl + "/");
|
||||
} else {
|
||||
urls.push(newUrl);
|
||||
}
|
||||
}
|
||||
return urls;
|
||||
}, []);
|
||||
pageUrls = Array.from(/* @__PURE__ */ new Set([...pageUrls, ...routeUrls, ...customPages ?? []]));
|
||||
if (filter) {
|
||||
pageUrls = pageUrls.filter(filter);
|
||||
}
|
||||
if (pageUrls.length === 0) {
|
||||
logger.warn(`No pages found!
|
||||
\`${outFile}\` not created.`);
|
||||
return;
|
||||
}
|
||||
let urlData = generateSitemap(pageUrls, finalSiteUrl.href, opts);
|
||||
if (serialize) {
|
||||
try {
|
||||
const serializedUrls = [];
|
||||
for (const item of urlData) {
|
||||
const serialized = await Promise.resolve(serialize(item));
|
||||
if (serialized) {
|
||||
serializedUrls.push(serialized);
|
||||
}
|
||||
}
|
||||
if (serializedUrls.length === 0) {
|
||||
logger.warn("No pages found!");
|
||||
return;
|
||||
}
|
||||
urlData = serializedUrls;
|
||||
} catch (err) {
|
||||
logger.error(`Error serializing pages
|
||||
${err.toString()}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const destDir = fileURLToPath(dir);
|
||||
const lastmod = opts.lastmod?.toISOString();
|
||||
const xslURL = opts.xslURL ? new URL(opts.xslURL, finalSiteUrl).href : void 0;
|
||||
await writeSitemap(
|
||||
{
|
||||
filenameBase,
|
||||
hostname: finalSiteUrl.href,
|
||||
destinationDir: destDir,
|
||||
publicBasePath: config.base,
|
||||
sourceData: urlData,
|
||||
limit: entryLimit,
|
||||
customSitemaps,
|
||||
xslURL,
|
||||
lastmod,
|
||||
namespaces: opts.namespaces
|
||||
},
|
||||
config
|
||||
);
|
||||
logger.info(`\`${outFile}\` created at \`${path.relative(process.cwd(), destDir)}\``);
|
||||
} catch (err) {
|
||||
if (err instanceof ZodError) {
|
||||
logger.warn(formatConfigErrorMessage(err));
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
var index_default = createPlugin;
|
||||
export {
|
||||
EnumChangefreq as ChangeFreqEnum,
|
||||
index_default as default
|
||||
};
|
||||
91
node_modules/@astrojs/sitemap/dist/schema.d.ts
generated
vendored
Normal file
91
node_modules/@astrojs/sitemap/dist/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
import { EnumChangefreq as ChangeFreq } from 'sitemap';
|
||||
import { z } from 'zod';
|
||||
export declare const SitemapOptionsSchema: z.ZodDefault<z.ZodObject<{
|
||||
filenameBase: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
||||
filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodBoolean>>;
|
||||
customSitemaps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
customPages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
canonicalURL: z.ZodOptional<z.ZodString>;
|
||||
xslURL: z.ZodOptional<z.ZodString>;
|
||||
i18n: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
||||
defaultLocale: z.ZodString;
|
||||
locales: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
}, {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
}>, {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
}, {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
}>>;
|
||||
entryLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
||||
serialize: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>;
|
||||
changefreq: z.ZodOptional<z.ZodNativeEnum<typeof ChangeFreq>>;
|
||||
lastmod: z.ZodOptional<z.ZodDate>;
|
||||
priority: z.ZodOptional<z.ZodNumber>;
|
||||
namespaces: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
||||
news: z.ZodOptional<z.ZodBoolean>;
|
||||
xhtml: z.ZodOptional<z.ZodBoolean>;
|
||||
image: z.ZodOptional<z.ZodBoolean>;
|
||||
video: z.ZodOptional<z.ZodBoolean>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
news?: boolean | undefined;
|
||||
xhtml?: boolean | undefined;
|
||||
image?: boolean | undefined;
|
||||
video?: boolean | undefined;
|
||||
}, {
|
||||
news?: boolean | undefined;
|
||||
xhtml?: boolean | undefined;
|
||||
image?: boolean | undefined;
|
||||
video?: boolean | undefined;
|
||||
}>>>;
|
||||
}, "strict", z.ZodTypeAny, {
|
||||
filenameBase: string;
|
||||
entryLimit: number;
|
||||
namespaces: {
|
||||
news?: boolean | undefined;
|
||||
xhtml?: boolean | undefined;
|
||||
image?: boolean | undefined;
|
||||
video?: boolean | undefined;
|
||||
};
|
||||
changefreq?: ChangeFreq | undefined;
|
||||
priority?: number | undefined;
|
||||
lastmod?: Date | undefined;
|
||||
i18n?: {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
} | undefined;
|
||||
filter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined;
|
||||
customSitemaps?: string[] | undefined;
|
||||
customPages?: string[] | undefined;
|
||||
canonicalURL?: string | undefined;
|
||||
xslURL?: string | undefined;
|
||||
serialize?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
||||
}, {
|
||||
changefreq?: ChangeFreq | undefined;
|
||||
priority?: number | undefined;
|
||||
lastmod?: Date | undefined;
|
||||
i18n?: {
|
||||
defaultLocale: string;
|
||||
locales: Record<string, string>;
|
||||
} | undefined;
|
||||
filter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined;
|
||||
filenameBase?: string | undefined;
|
||||
entryLimit?: number | undefined;
|
||||
customSitemaps?: string[] | undefined;
|
||||
customPages?: string[] | undefined;
|
||||
canonicalURL?: string | undefined;
|
||||
xslURL?: string | undefined;
|
||||
serialize?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
||||
namespaces?: {
|
||||
news?: boolean | undefined;
|
||||
xhtml?: boolean | undefined;
|
||||
image?: boolean | undefined;
|
||||
video?: boolean | undefined;
|
||||
} | undefined;
|
||||
}>>;
|
||||
37
node_modules/@astrojs/sitemap/dist/schema.js
generated
vendored
Normal file
37
node_modules/@astrojs/sitemap/dist/schema.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { EnumChangefreq as ChangeFreq } from "sitemap";
|
||||
import { z } from "zod";
|
||||
import { SITEMAP_CONFIG_DEFAULTS } from "./config-defaults.js";
|
||||
const localeKeySchema = z.string().min(1);
|
||||
const SitemapOptionsSchema = z.object({
|
||||
filenameBase: z.string().optional().default(SITEMAP_CONFIG_DEFAULTS.filenameBase),
|
||||
filter: z.function().args(z.string()).returns(z.boolean()).optional(),
|
||||
customSitemaps: z.string().url().array().optional(),
|
||||
customPages: z.string().url().array().optional(),
|
||||
canonicalURL: z.string().url().optional(),
|
||||
xslURL: z.string().optional(),
|
||||
i18n: z.object({
|
||||
defaultLocale: localeKeySchema,
|
||||
locales: z.record(
|
||||
localeKeySchema,
|
||||
z.string().min(2).regex(/^[a-zA-Z\-]+$/gm, {
|
||||
message: "Only English alphabet symbols and hyphen allowed"
|
||||
})
|
||||
)
|
||||
}).refine((val) => !val || val.locales[val.defaultLocale], {
|
||||
message: "`defaultLocale` must exist in `locales` keys"
|
||||
}).optional(),
|
||||
entryLimit: z.number().nonnegative().optional().default(SITEMAP_CONFIG_DEFAULTS.entryLimit),
|
||||
serialize: z.function().args(z.any()).returns(z.any()).optional(),
|
||||
changefreq: z.nativeEnum(ChangeFreq).optional(),
|
||||
lastmod: z.date().optional(),
|
||||
priority: z.number().min(0).max(1).optional(),
|
||||
namespaces: z.object({
|
||||
news: z.boolean().optional(),
|
||||
xhtml: z.boolean().optional(),
|
||||
image: z.boolean().optional(),
|
||||
video: z.boolean().optional()
|
||||
}).optional().default(SITEMAP_CONFIG_DEFAULTS.namespaces)
|
||||
}).strict().default(SITEMAP_CONFIG_DEFAULTS);
|
||||
export {
|
||||
SitemapOptionsSchema
|
||||
};
|
||||
6
node_modules/@astrojs/sitemap/dist/utils/parse-i18n-url.d.ts
generated
vendored
Normal file
6
node_modules/@astrojs/sitemap/dist/utils/parse-i18n-url.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
interface ParsedI18nUrl {
|
||||
locale: string;
|
||||
path: string;
|
||||
}
|
||||
export declare function parseI18nUrl(url: string, defaultLocale: string, locales: Record<string, string>, base: string): ParsedI18nUrl | undefined;
|
||||
export {};
|
||||
24
node_modules/@astrojs/sitemap/dist/utils/parse-i18n-url.js
generated
vendored
Normal file
24
node_modules/@astrojs/sitemap/dist/utils/parse-i18n-url.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
function parseI18nUrl(url, defaultLocale, locales, base) {
|
||||
if (!url.startsWith(base)) {
|
||||
return void 0;
|
||||
}
|
||||
let s = url.slice(base.length);
|
||||
if (!s || s === "/") {
|
||||
return { locale: defaultLocale, path: "/" };
|
||||
}
|
||||
if (s[0] !== "/") {
|
||||
s = "/" + s;
|
||||
}
|
||||
const locale = s.split("/")[1];
|
||||
if (locale in locales) {
|
||||
let path = s.slice(1 + locale.length);
|
||||
if (!path) {
|
||||
path = "/";
|
||||
}
|
||||
return { locale, path };
|
||||
}
|
||||
return { locale: defaultLocale, path: s };
|
||||
}
|
||||
export {
|
||||
parseI18nUrl
|
||||
};
|
||||
1
node_modules/@astrojs/sitemap/dist/validate-options.d.ts
generated
vendored
Normal file
1
node_modules/@astrojs/sitemap/dist/validate-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
20
node_modules/@astrojs/sitemap/dist/validate-options.js
generated
vendored
Normal file
20
node_modules/@astrojs/sitemap/dist/validate-options.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { z } from "zod";
|
||||
import { SitemapOptionsSchema } from "./schema.js";
|
||||
const validateOptions = (site, opts) => {
|
||||
const result = SitemapOptionsSchema.parse(opts);
|
||||
z.object({
|
||||
site: z.string().optional(),
|
||||
// Astro takes care of `site`: how to validate, transform and refine
|
||||
canonicalURL: z.string().optional()
|
||||
// `canonicalURL` is already validated in prev step
|
||||
}).refine((options) => options.site || options.canonicalURL, {
|
||||
message: "Required `site` astro.config option or `canonicalURL` integration option"
|
||||
}).parse({
|
||||
site,
|
||||
canonicalURL: result.canonicalURL
|
||||
});
|
||||
return result;
|
||||
};
|
||||
export {
|
||||
validateOptions
|
||||
};
|
||||
22
node_modules/@astrojs/sitemap/dist/write-sitemap.d.ts
generated
vendored
Normal file
22
node_modules/@astrojs/sitemap/dist/write-sitemap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { AstroConfig } from 'astro';
|
||||
import type { SitemapItem } from './index.js';
|
||||
type WriteSitemapConfig = {
|
||||
filenameBase: string;
|
||||
hostname: string;
|
||||
sitemapHostname?: string;
|
||||
customSitemaps?: string[];
|
||||
sourceData: SitemapItem[];
|
||||
destinationDir: string;
|
||||
publicBasePath?: string;
|
||||
limit?: number;
|
||||
xslURL?: string;
|
||||
lastmod?: string;
|
||||
namespaces?: {
|
||||
news?: boolean;
|
||||
xhtml?: boolean;
|
||||
image?: boolean;
|
||||
video?: boolean;
|
||||
};
|
||||
};
|
||||
export declare function writeSitemap({ filenameBase, hostname, sitemapHostname, sourceData, destinationDir, limit, customSitemaps, publicBasePath, xslURL: xslUrl, lastmod, namespaces, }: WriteSitemapConfig, astroConfig: AstroConfig): Promise<void>;
|
||||
export {};
|
||||
71
node_modules/@astrojs/sitemap/dist/write-sitemap.js
generated
vendored
Normal file
71
node_modules/@astrojs/sitemap/dist/write-sitemap.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import { createWriteStream } from "node:fs";
|
||||
import { mkdir } from "node:fs/promises";
|
||||
import { normalize, resolve } from "node:path";
|
||||
import { pipeline, Readable } from "node:stream";
|
||||
import { promisify } from "node:util";
|
||||
import { SitemapAndIndexStream, SitemapIndexStream, SitemapStream } from "sitemap";
|
||||
import replace from "stream-replace-string";
|
||||
async function writeSitemap({
|
||||
filenameBase,
|
||||
hostname,
|
||||
sitemapHostname = hostname,
|
||||
sourceData,
|
||||
destinationDir,
|
||||
limit = 5e4,
|
||||
customSitemaps = [],
|
||||
publicBasePath = "./",
|
||||
xslURL: xslUrl,
|
||||
lastmod,
|
||||
namespaces = { news: true, xhtml: true, image: true, video: true }
|
||||
}, astroConfig) {
|
||||
await mkdir(destinationDir, { recursive: true });
|
||||
const sitemapAndIndexStream = new SitemapAndIndexStream({
|
||||
limit,
|
||||
xslUrl,
|
||||
getSitemapStream: (i) => {
|
||||
const sitemapStream = new SitemapStream({
|
||||
hostname,
|
||||
xslUrl,
|
||||
// Custom namespace handling
|
||||
xmlns: {
|
||||
news: namespaces?.news !== false,
|
||||
xhtml: namespaces?.xhtml !== false,
|
||||
image: namespaces?.image !== false,
|
||||
video: namespaces?.video !== false
|
||||
}
|
||||
});
|
||||
const path = `./${filenameBase}-${i}.xml`;
|
||||
const writePath = resolve(destinationDir, path);
|
||||
if (!publicBasePath.endsWith("/")) {
|
||||
publicBasePath += "/";
|
||||
}
|
||||
const publicPath = normalize(publicBasePath + path);
|
||||
let stream;
|
||||
if (astroConfig.trailingSlash === "never" || astroConfig.build.format === "file") {
|
||||
const host = hostname.endsWith("/") ? hostname.slice(0, -1) : hostname;
|
||||
const searchStr = `<loc>${host}/</loc>`;
|
||||
const replaceStr = `<loc>${host}</loc>`;
|
||||
stream = sitemapStream.pipe(replace(searchStr, replaceStr)).pipe(createWriteStream(writePath));
|
||||
} else {
|
||||
stream = sitemapStream.pipe(createWriteStream(writePath));
|
||||
}
|
||||
const url = new URL(publicPath, sitemapHostname).toString();
|
||||
return [{ url, lastmod }, sitemapStream, stream];
|
||||
}
|
||||
});
|
||||
const src = Readable.from(sourceData);
|
||||
const indexPath = resolve(destinationDir, `./${filenameBase}-index.xml`);
|
||||
for (const url of customSitemaps) {
|
||||
SitemapIndexStream.prototype._transform.call(
|
||||
sitemapAndIndexStream,
|
||||
{ url, lastmod },
|
||||
"utf8",
|
||||
() => {
|
||||
}
|
||||
);
|
||||
}
|
||||
return promisify(pipeline)(src, sitemapAndIndexStream, createWriteStream(indexPath));
|
||||
}
|
||||
export {
|
||||
writeSitemap
|
||||
};
|
||||
48
node_modules/@astrojs/sitemap/package.json
generated
vendored
Normal file
48
node_modules/@astrojs/sitemap/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "@astrojs/sitemap",
|
||||
"description": "Generate a sitemap for your Astro site",
|
||||
"version": "3.6.0",
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.ts",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/withastro/astro.git",
|
||||
"directory": "packages/integrations/sitemap"
|
||||
},
|
||||
"keywords": [
|
||||
"astro-integration",
|
||||
"astro-component",
|
||||
"seo",
|
||||
"sitemap"
|
||||
],
|
||||
"bugs": "https://github.com/withastro/astro/issues",
|
||||
"homepage": "https://docs.astro.build/en/guides/integrations-guide/sitemap/",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"sitemap": "^8.0.0",
|
||||
"stream-replace-string": "^2.0.0",
|
||||
"zod": "^3.25.76"
|
||||
},
|
||||
"devDependencies": {
|
||||
"xml2js": "0.6.2",
|
||||
"astro-scripts": "0.0.14",
|
||||
"astro": "5.13.8"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"test": "astro-scripts test \"test/**/*.test.js\""
|
||||
}
|
||||
}
|
||||
46
node_modules/@img/sharp-libvips-linuxmusl-x64/README.md
generated
vendored
Normal file
46
node_modules/@img/sharp-libvips-linuxmusl-x64/README.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# `@img/sharp-libvips-linuxmusl-x64`
|
||||
|
||||
Prebuilt libvips and dependencies for use with sharp on Linux (musl) x64.
|
||||
|
||||
## Licensing
|
||||
|
||||
This software contains third-party libraries
|
||||
used under the terms of the following licences:
|
||||
|
||||
| Library | Used under the terms of |
|
||||
|---------------|-----------------------------------------------------------------------------------------------------------|
|
||||
| aom | BSD 2-Clause + [Alliance for Open Media Patent License 1.0](https://aomedia.org/license/patent-license/) |
|
||||
| cairo | Mozilla Public License 2.0 |
|
||||
| cgif | MIT Licence |
|
||||
| expat | MIT Licence |
|
||||
| fontconfig | [fontconfig Licence](https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/main/COPYING) (BSD-like) |
|
||||
| freetype | [freetype Licence](https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) |
|
||||
| fribidi | LGPLv3 |
|
||||
| glib | LGPLv3 |
|
||||
| harfbuzz | MIT Licence |
|
||||
| highway | Apache-2.0 License, BSD 3-Clause |
|
||||
| lcms | MIT Licence |
|
||||
| libarchive | BSD 2-Clause |
|
||||
| libexif | LGPLv3 |
|
||||
| libffi | MIT Licence |
|
||||
| libheif | LGPLv3 |
|
||||
| libimagequant | [BSD 2-Clause](https://github.com/lovell/libimagequant/blob/main/COPYRIGHT) |
|
||||
| libnsgif | MIT Licence |
|
||||
| libpng | [libpng License](https://github.com/pnggroup/libpng/blob/master/LICENSE) |
|
||||
| librsvg | LGPLv3 |
|
||||
| libspng | [BSD 2-Clause, libpng License](https://github.com/randy408/libspng/blob/master/LICENSE) |
|
||||
| libtiff | [libtiff License](https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md) (BSD-like) |
|
||||
| libvips | LGPLv3 |
|
||||
| libwebp | New BSD License |
|
||||
| libxml2 | MIT Licence |
|
||||
| mozjpeg | [zlib License, IJG License, BSD-3-Clause](https://github.com/mozilla/mozjpeg/blob/master/LICENSE.md) |
|
||||
| pango | LGPLv3 |
|
||||
| pixman | MIT Licence |
|
||||
| proxy-libintl | LGPLv3 |
|
||||
| zlib-ng | [zlib Licence](https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md) |
|
||||
|
||||
Use of libraries under the terms of the LGPLv3 is via the
|
||||
"any later version" clause of the LGPLv2 or LGPLv2.1.
|
||||
|
||||
Please report any errors or omissions via
|
||||
https://github.com/lovell/sharp-libvips/issues/new
|
||||
221
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h
generated
vendored
Normal file
221
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h
generated
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
/* glibconfig.h
|
||||
*
|
||||
* This is a generated file. Please modify 'glibconfig.h.in'
|
||||
*/
|
||||
|
||||
#ifndef __GLIBCONFIG_H__
|
||||
#define __GLIBCONFIG_H__
|
||||
|
||||
#include <glib/gmacros.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
#define GLIB_HAVE_ALLOCA_H
|
||||
|
||||
#define GLIB_STATIC_COMPILATION 1
|
||||
#define GOBJECT_STATIC_COMPILATION 1
|
||||
#define GIO_STATIC_COMPILATION 1
|
||||
#define GMODULE_STATIC_COMPILATION 1
|
||||
#define GI_STATIC_COMPILATION 1
|
||||
#define G_INTL_STATIC_COMPILATION 1
|
||||
#define FFI_STATIC_BUILD 1
|
||||
|
||||
/* Specifies that GLib's g_print*() functions wrap the
|
||||
* system printf functions. This is useful to know, for example,
|
||||
* when using glibc's register_printf_function().
|
||||
*/
|
||||
#define GLIB_USING_SYSTEM_PRINTF
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define G_MINFLOAT FLT_MIN
|
||||
#define G_MAXFLOAT FLT_MAX
|
||||
#define G_MINDOUBLE DBL_MIN
|
||||
#define G_MAXDOUBLE DBL_MAX
|
||||
#define G_MINSHORT SHRT_MIN
|
||||
#define G_MAXSHORT SHRT_MAX
|
||||
#define G_MAXUSHORT USHRT_MAX
|
||||
#define G_MININT INT_MIN
|
||||
#define G_MAXINT INT_MAX
|
||||
#define G_MAXUINT UINT_MAX
|
||||
#define G_MINLONG LONG_MIN
|
||||
#define G_MAXLONG LONG_MAX
|
||||
#define G_MAXULONG ULONG_MAX
|
||||
|
||||
typedef signed char gint8;
|
||||
typedef unsigned char guint8;
|
||||
|
||||
typedef signed short gint16;
|
||||
typedef unsigned short guint16;
|
||||
|
||||
#define G_GINT16_MODIFIER "h"
|
||||
#define G_GINT16_FORMAT "hi"
|
||||
#define G_GUINT16_FORMAT "hu"
|
||||
|
||||
|
||||
typedef signed int gint32;
|
||||
typedef unsigned int guint32;
|
||||
|
||||
#define G_GINT32_MODIFIER ""
|
||||
#define G_GINT32_FORMAT "i"
|
||||
#define G_GUINT32_FORMAT "u"
|
||||
|
||||
|
||||
#define G_HAVE_GINT64 1 /* deprecated, always true */
|
||||
|
||||
typedef signed long gint64;
|
||||
typedef unsigned long guint64;
|
||||
|
||||
#define G_GINT64_CONSTANT(val) (val##L)
|
||||
#define G_GUINT64_CONSTANT(val) (val##UL)
|
||||
|
||||
#define G_GINT64_MODIFIER "l"
|
||||
#define G_GINT64_FORMAT "li"
|
||||
#define G_GUINT64_FORMAT "lu"
|
||||
|
||||
|
||||
#define GLIB_SIZEOF_VOID_P 8
|
||||
#define GLIB_SIZEOF_LONG 8
|
||||
#define GLIB_SIZEOF_SIZE_T 8
|
||||
#define GLIB_SIZEOF_SSIZE_T 8
|
||||
|
||||
typedef signed long gssize;
|
||||
typedef unsigned long gsize;
|
||||
#define G_GSIZE_MODIFIER "l"
|
||||
#define G_GSSIZE_MODIFIER "l"
|
||||
#define G_GSIZE_FORMAT "lu"
|
||||
#define G_GSSIZE_FORMAT "li"
|
||||
|
||||
#define G_MAXSIZE G_MAXULONG
|
||||
#define G_MINSSIZE G_MINLONG
|
||||
#define G_MAXSSIZE G_MAXLONG
|
||||
|
||||
typedef gint64 goffset;
|
||||
#define G_MINOFFSET G_MININT64
|
||||
#define G_MAXOFFSET G_MAXINT64
|
||||
|
||||
#define G_GOFFSET_MODIFIER G_GINT64_MODIFIER
|
||||
#define G_GOFFSET_FORMAT G_GINT64_FORMAT
|
||||
#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
|
||||
|
||||
#define G_POLLFD_FORMAT "%d"
|
||||
|
||||
#define GPOINTER_TO_INT(p) ((gint) (glong) (p))
|
||||
#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p))
|
||||
|
||||
#define GINT_TO_POINTER(i) ((gpointer) (glong) (i))
|
||||
#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u))
|
||||
|
||||
typedef signed long gintptr;
|
||||
typedef unsigned long guintptr;
|
||||
|
||||
#define G_GINTPTR_MODIFIER "l"
|
||||
#define G_GINTPTR_FORMAT "li"
|
||||
#define G_GUINTPTR_FORMAT "lu"
|
||||
|
||||
#define GLIB_MAJOR_VERSION 2
|
||||
#define GLIB_MINOR_VERSION 86
|
||||
#define GLIB_MICRO_VERSION 0
|
||||
|
||||
#define G_OS_UNIX
|
||||
|
||||
#define G_VA_COPY va_copy
|
||||
|
||||
#define G_VA_COPY_AS_ARRAY 1
|
||||
|
||||
#define G_HAVE_ISO_VARARGS 1
|
||||
|
||||
/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
|
||||
* is passed ISO vararg support is turned off, and there is no work
|
||||
* around to turn it on, so we unconditionally turn it off.
|
||||
*/
|
||||
#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
|
||||
# undef G_HAVE_ISO_VARARGS
|
||||
#endif
|
||||
|
||||
#define G_HAVE_GROWING_STACK 0
|
||||
|
||||
#ifndef _MSC_VER
|
||||
# define G_HAVE_GNUC_VARARGS 1
|
||||
#endif
|
||||
|
||||
#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
|
||||
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
#define G_GNUC_INTERNAL __hidden
|
||||
#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY)
|
||||
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
|
||||
#else
|
||||
#define G_GNUC_INTERNAL
|
||||
#endif
|
||||
|
||||
#define G_THREADS_ENABLED
|
||||
#define G_THREADS_IMPL_POSIX
|
||||
|
||||
#define G_ATOMIC_LOCK_FREE
|
||||
|
||||
#define GINT16_TO_LE(val) ((gint16) (val))
|
||||
#define GUINT16_TO_LE(val) ((guint16) (val))
|
||||
#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
|
||||
#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
|
||||
|
||||
#define GINT32_TO_LE(val) ((gint32) (val))
|
||||
#define GUINT32_TO_LE(val) ((guint32) (val))
|
||||
#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
|
||||
#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
|
||||
|
||||
#define GINT64_TO_LE(val) ((gint64) (val))
|
||||
#define GUINT64_TO_LE(val) ((guint64) (val))
|
||||
#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
|
||||
#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
|
||||
|
||||
#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val))
|
||||
#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val))
|
||||
#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val))
|
||||
#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val))
|
||||
#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
|
||||
#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
|
||||
#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
|
||||
#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
|
||||
#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val))
|
||||
#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val))
|
||||
#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val))
|
||||
#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val))
|
||||
#define G_BYTE_ORDER G_LITTLE_ENDIAN
|
||||
|
||||
#define GLIB_SYSDEF_POLLIN =1
|
||||
#define GLIB_SYSDEF_POLLOUT =4
|
||||
#define GLIB_SYSDEF_POLLPRI =2
|
||||
#define GLIB_SYSDEF_POLLHUP =16
|
||||
#define GLIB_SYSDEF_POLLERR =8
|
||||
#define GLIB_SYSDEF_POLLNVAL =32
|
||||
|
||||
/* No way to disable deprecation warnings for macros, so only emit deprecation
|
||||
* warnings on platforms where usage of this macro is broken */
|
||||
#if defined(__APPLE__) || defined(_MSC_VER) || defined(__CYGWIN__)
|
||||
#define G_MODULE_SUFFIX "so" GLIB_DEPRECATED_MACRO_IN_2_76
|
||||
#else
|
||||
#define G_MODULE_SUFFIX "so"
|
||||
#endif
|
||||
|
||||
typedef int GPid;
|
||||
#define G_PID_FORMAT "i"
|
||||
|
||||
#define GLIB_SYSDEF_AF_UNIX 1
|
||||
#define GLIB_SYSDEF_AF_INET 2
|
||||
#define GLIB_SYSDEF_AF_INET6 10
|
||||
|
||||
#define GLIB_SYSDEF_MSG_OOB 1
|
||||
#define GLIB_SYSDEF_MSG_PEEK 2
|
||||
#define GLIB_SYSDEF_MSG_DONTROUTE 4
|
||||
|
||||
#define G_DIR_SEPARATOR '/'
|
||||
#define G_DIR_SEPARATOR_S "/"
|
||||
#define G_SEARCHPATH_SEPARATOR ':'
|
||||
#define G_SEARCHPATH_SEPARATOR_S ":"
|
||||
|
||||
#undef G_HAVE_FREE_SIZED
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GLIBCONFIG_H__ */
|
||||
1
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js
generated
vendored
Normal file
1
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = __dirname;
|
||||
BIN
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.2
generated
vendored
Normal file
BIN
node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.2
generated
vendored
Normal file
Binary file not shown.
42
node_modules/@img/sharp-libvips-linuxmusl-x64/package.json
generated
vendored
Normal file
42
node_modules/@img/sharp-libvips-linuxmusl-x64/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@img/sharp-libvips-linuxmusl-x64",
|
||||
"version": "1.2.3",
|
||||
"description": "Prebuilt libvips and dependencies for use with sharp on Linux (musl) x64",
|
||||
"author": "Lovell Fuller <npm@lovell.info>",
|
||||
"homepage": "https://sharp.pixelplumbing.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lovell/sharp-libvips.git",
|
||||
"directory": "npm/linuxmusl-x64"
|
||||
},
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"preferUnplugged": true,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"versions.json"
|
||||
],
|
||||
"type": "commonjs",
|
||||
"exports": {
|
||||
"./lib": "./lib/index.js",
|
||||
"./package": "./package.json",
|
||||
"./versions": "./versions.json"
|
||||
},
|
||||
"config": {
|
||||
"musl": ">=1.2.2"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
30
node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json
generated
vendored
Normal file
30
node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"aom": "3.13.1",
|
||||
"archive": "3.8.1",
|
||||
"cairo": "1.18.4",
|
||||
"cgif": "0.5.0",
|
||||
"exif": "0.6.25",
|
||||
"expat": "2.7.2",
|
||||
"ffi": "3.5.2",
|
||||
"fontconfig": "2.17.1",
|
||||
"freetype": "2.14.1",
|
||||
"fribidi": "1.0.16",
|
||||
"glib": "2.86.0",
|
||||
"harfbuzz": "11.5.0",
|
||||
"heif": "1.20.2",
|
||||
"highway": "1.3.0",
|
||||
"imagequant": "2.4.1",
|
||||
"lcms": "2.17",
|
||||
"mozjpeg": "4.1.5",
|
||||
"pango": "1.57.0",
|
||||
"pixman": "0.46.4",
|
||||
"png": "1.6.50",
|
||||
"proxy-libintl": "0.5",
|
||||
"rsvg": "2.61.1",
|
||||
"spng": "0.7.4",
|
||||
"tiff": "4.7.0",
|
||||
"vips": "8.17.2",
|
||||
"webp": "1.6.0",
|
||||
"xml2": "2.15.0",
|
||||
"zlib-ng": "2.2.5"
|
||||
}
|
||||
191
node_modules/@img/sharp-linuxmusl-x64/LICENSE
generated
vendored
Normal file
191
node_modules/@img/sharp-linuxmusl-x64/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, "control" means (i) the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code,
|
||||
generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included
|
||||
in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
||||
is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative Works
|
||||
shall not include works that remain separable from, or merely link (or bind by
|
||||
name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative Works
|
||||
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
||||
by the copyright owner or by an individual or Legal Entity authorized to submit
|
||||
on behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
||||
such license applies only to those patent claims licensable by such Contributor
|
||||
that are necessarily infringed by their Contribution(s) alone or by combination
|
||||
of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory
|
||||
patent infringement, then any patent licenses granted to You under this License
|
||||
for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form,
|
||||
provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of
|
||||
this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form
|
||||
of the Work, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the
|
||||
attribution notices contained within such NOTICE file, excluding those notices
|
||||
that do not pertain to any part of the Derivative Works, in at least one of the
|
||||
following places: within a NOTICE text file distributed as part of the
|
||||
Derivative Works; within the Source form or documentation, if provided along
|
||||
with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents of
|
||||
the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works that
|
||||
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
||||
provided that such additional attribution notices cannot be construed as
|
||||
modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction, or
|
||||
distribution of Your modifications, or for any such Derivative Works as a whole,
|
||||
provided Your use, reproduction, and distribution of the Work otherwise complies
|
||||
with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
||||
for inclusion in the Work by You to the Licensor shall be under the terms and
|
||||
conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
||||
any separate license agreement you may have executed with Licensor regarding
|
||||
such Contributions.
|
||||
|
||||
6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the Licensor, except as required for
|
||||
reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the
|
||||
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||
including, without limitation, any warranties or conditions of TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
||||
solely responsible for determining the appropriateness of using or
|
||||
redistributing the Work and assume any risks associated with Your exercise of
|
||||
permissions under this License.
|
||||
|
||||
8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence),
|
||||
contract, or otherwise, unless required by applicable law (such as deliberate
|
||||
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License or
|
||||
out of the use or inability to use the Work (including but not limited to
|
||||
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||
any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to
|
||||
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
||||
other liability obligations and/or rights consistent with this License. However,
|
||||
in accepting such obligations, You may act only on Your own behalf and on Your
|
||||
sole responsibility, not on behalf of any other Contributor, and only if You
|
||||
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate
|
||||
notice, with the fields enclosed by brackets "[]" replaced with your own
|
||||
identifying information. (Don't include the brackets!) The text should be
|
||||
enclosed in the appropriate comment syntax for the file format. We also
|
||||
recommend that a file or class name and description of purpose be included on
|
||||
the same "printed page" as the copyright notice for easier identification within
|
||||
third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
18
node_modules/@img/sharp-linuxmusl-x64/README.md
generated
vendored
Normal file
18
node_modules/@img/sharp-linuxmusl-x64/README.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# `@img/sharp-linuxmusl-x64`
|
||||
|
||||
Prebuilt sharp for use with Linux (musl) x64.
|
||||
|
||||
## Licensing
|
||||
|
||||
Copyright 2013 Lovell Fuller and others.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
BIN
node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node
generated
vendored
Normal file
BIN
node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node
generated
vendored
Normal file
Binary file not shown.
46
node_modules/@img/sharp-linuxmusl-x64/package.json
generated
vendored
Normal file
46
node_modules/@img/sharp-linuxmusl-x64/package.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@img/sharp-linuxmusl-x64",
|
||||
"version": "0.34.4",
|
||||
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
||||
"author": "Lovell Fuller <npm@lovell.info>",
|
||||
"homepage": "https://sharp.pixelplumbing.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lovell/sharp.git",
|
||||
"directory": "npm/linuxmusl-x64"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"preferUnplugged": true,
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linuxmusl-x64": "1.2.3"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"type": "commonjs",
|
||||
"exports": {
|
||||
"./sharp.node": "./lib/sharp-linuxmusl-x64.node",
|
||||
"./package": "./package.json"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
||||
},
|
||||
"config": {
|
||||
"musl": ">=1.2.2"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
3
node_modules/@rollup/rollup-linux-x64-musl/README.md
generated
vendored
Normal file
3
node_modules/@rollup/rollup-linux-x64-musl/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# `@rollup/rollup-linux-x64-musl`
|
||||
|
||||
This is the **x86_64-unknown-linux-musl** binary for `rollup`
|
||||
25
node_modules/@rollup/rollup-linux-x64-musl/package.json
generated
vendored
Normal file
25
node_modules/@rollup/rollup-linux-x64-musl/package.json
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@rollup/rollup-linux-x64-musl",
|
||||
"version": "4.52.4",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"files": [
|
||||
"rollup.linux-x64-musl.node"
|
||||
],
|
||||
"description": "Native bindings for Rollup",
|
||||
"author": "Lukas Taegert-Atkinson",
|
||||
"homepage": "https://rollupjs.org/",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rollup/rollup.git"
|
||||
},
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"main": "./rollup.linux-x64-musl.node"
|
||||
}
|
||||
BIN
node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node
generated
vendored
Normal file
BIN
node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node
generated
vendored
Normal file
Binary file not shown.
21
node_modules/@types/sax/LICENSE
generated
vendored
Normal file
21
node_modules/@types/sax/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
15
node_modules/@types/sax/README.md
generated
vendored
Normal file
15
node_modules/@types/sax/README.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/sax`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for sax (https://github.com/isaacs/sax-js).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sax.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
|
||||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Vincent Siao (Asana, Inc.)](https://github.com/vsiao), [Evert Pot](https://github.com/evert), [Daniel Cassidy](https://github.com/djcsdy), and [Fabian van der Veen](https://github.com/fvanderveen).
|
||||
111
node_modules/@types/sax/index.d.ts
generated
vendored
Normal file
111
node_modules/@types/sax/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
export const EVENTS: string[];
|
||||
|
||||
export interface SAXOptions {
|
||||
trim?: boolean | undefined;
|
||||
normalize?: boolean | undefined;
|
||||
lowercase?: boolean | undefined;
|
||||
xmlns?: boolean | undefined;
|
||||
noscript?: boolean | undefined;
|
||||
position?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface QualifiedName {
|
||||
name: string;
|
||||
prefix: string;
|
||||
local: string;
|
||||
uri: string;
|
||||
}
|
||||
|
||||
export interface QualifiedAttribute extends QualifiedName {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface BaseTag {
|
||||
name: string;
|
||||
isSelfClosing: boolean;
|
||||
}
|
||||
|
||||
// Interface used when the xmlns option is set
|
||||
export interface QualifiedTag extends QualifiedName, BaseTag {
|
||||
ns: { [key: string]: string };
|
||||
attributes: { [key: string]: QualifiedAttribute };
|
||||
}
|
||||
|
||||
export interface Tag extends BaseTag {
|
||||
attributes: { [key: string]: string };
|
||||
}
|
||||
|
||||
export function parser(strict?: boolean, opt?: SAXOptions): SAXParser;
|
||||
export class SAXParser {
|
||||
constructor(strict?: boolean, opt?: SAXOptions);
|
||||
|
||||
// Methods
|
||||
end(): void;
|
||||
write(s: string): SAXParser;
|
||||
resume(): SAXParser;
|
||||
close(): SAXParser;
|
||||
flush(): void;
|
||||
|
||||
// Members
|
||||
line: number;
|
||||
column: number;
|
||||
error: Error;
|
||||
position: number;
|
||||
startTagPosition: number;
|
||||
closed: boolean;
|
||||
strict: boolean;
|
||||
opt: SAXOptions;
|
||||
tag: Tag;
|
||||
ENTITIES: { [key: string]: string };
|
||||
|
||||
// Events
|
||||
onerror(e: Error): void;
|
||||
ontext(t: string): void;
|
||||
ondoctype(doctype: string): void;
|
||||
onprocessinginstruction(node: { name: string; body: string }): void;
|
||||
onsgmldeclaration(sgmlDecl: string): void;
|
||||
onopentag(tag: Tag | QualifiedTag): void;
|
||||
onopentagstart(tag: Tag | QualifiedTag): void;
|
||||
onclosetag(tagName: string): void;
|
||||
onattribute(attr: { name: string; value: string }): void;
|
||||
oncomment(comment: string): void;
|
||||
onopencdata(): void;
|
||||
oncdata(cdata: string): void;
|
||||
onclosecdata(): void;
|
||||
onopennamespace(ns: { prefix: string; uri: string }): void;
|
||||
onclosenamespace(ns: { prefix: string; uri: string }): void;
|
||||
onend(): void;
|
||||
onready(): void;
|
||||
onscript(script: string): void;
|
||||
}
|
||||
|
||||
import stream = require("stream");
|
||||
export function createStream(strict?: boolean, opt?: SAXOptions): SAXStream;
|
||||
export class SAXStream extends stream.Duplex {
|
||||
constructor(strict?: boolean, opt?: SAXOptions);
|
||||
_parser: SAXParser;
|
||||
on(event: "text", listener: (this: this, text: string) => void): this;
|
||||
on(event: "doctype", listener: (this: this, doctype: string) => void): this;
|
||||
on(event: "processinginstruction", listener: (this: this, node: { name: string; body: string }) => void): this;
|
||||
on(event: "sgmldeclaration", listener: (this: this, sgmlDecl: string) => void): this;
|
||||
on(event: "opentag" | "opentagstart", listener: (this: this, tag: Tag | QualifiedTag) => void): this;
|
||||
on(event: "closetag", listener: (this: this, tagName: string) => void): this;
|
||||
on(event: "attribute", listener: (this: this, attr: { name: string; value: string }) => void): this;
|
||||
on(event: "comment", listener: (this: this, comment: string) => void): this;
|
||||
on(
|
||||
event: "opencdata" | "closecdata" | "end" | "ready" | "close" | "readable" | "drain" | "finish",
|
||||
listener: (this: this) => void,
|
||||
): this;
|
||||
on(event: "cdata", listener: (this: this, cdata: string) => void): this;
|
||||
on(
|
||||
event: "opennamespace" | "closenamespace",
|
||||
listener: (this: this, ns: { prefix: string; uri: string }) => void,
|
||||
): this;
|
||||
on(event: "script", listener: (this: this, script: string) => void): this;
|
||||
on(event: "data", listener: (this: this, chunk: any) => void): this;
|
||||
on(event: "error", listener: (this: this, err: Error) => void): this;
|
||||
on(event: "pipe" | "unpipe", listener: (this: this, src: stream.Readable) => void): this;
|
||||
on(event: string | symbol, listener: (this: this, ...args: any[]) => void): this;
|
||||
}
|
||||
42
node_modules/@types/sax/package.json
generated
vendored
Normal file
42
node_modules/@types/sax/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@types/sax",
|
||||
"version": "1.2.7",
|
||||
"description": "TypeScript definitions for sax",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sax",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Vincent Siao (Asana, Inc.)",
|
||||
"githubUsername": "vsiao",
|
||||
"url": "https://github.com/vsiao"
|
||||
},
|
||||
{
|
||||
"name": "Evert Pot",
|
||||
"githubUsername": "evert",
|
||||
"url": "https://github.com/evert"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Cassidy",
|
||||
"githubUsername": "djcsdy",
|
||||
"url": "https://github.com/djcsdy"
|
||||
},
|
||||
{
|
||||
"name": "Fabian van der Veen",
|
||||
"githubUsername": "fvanderveen",
|
||||
"url": "https://github.com/fvanderveen"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/sax"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "30ff89927c6c888d3113b0a9453e6166ca211ed5d328e36eed86e90eae239b88",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/arg/LICENSE.md
generated
vendored
Normal file
21
node_modules/arg/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 Vercel, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
317
node_modules/arg/README.md
generated
vendored
Normal file
317
node_modules/arg/README.md
generated
vendored
Normal file
@@ -0,0 +1,317 @@
|
||||
# Arg
|
||||
|
||||
`arg` is an unopinionated, no-frills CLI argument parser.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install arg
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`arg()` takes either 1 or 2 arguments:
|
||||
|
||||
1. Command line specification object (see below)
|
||||
2. Parse options (_Optional_, defaults to `{permissive: false, argv: process.argv.slice(2), stopAtPositional: false}`)
|
||||
|
||||
It returns an object with any values present on the command-line (missing options are thus
|
||||
missing from the resulting object). Arg performs no validation/requirement checking - we
|
||||
leave that up to the application.
|
||||
|
||||
All parameters that aren't consumed by options (commonly referred to as "extra" parameters)
|
||||
are added to `result._`, which is _always_ an array (even if no extra parameters are passed,
|
||||
in which case an empty array is returned).
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
// `options` is an optional parameter
|
||||
const args = arg(
|
||||
spec,
|
||||
(options = { permissive: false, argv: process.argv.slice(2) })
|
||||
);
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```console
|
||||
$ node ./hello.js --verbose -vvv --port=1234 -n 'My name' foo bar --tag qux --tag=qix -- --foobar
|
||||
```
|
||||
|
||||
```javascript
|
||||
// hello.js
|
||||
const arg = require('arg');
|
||||
|
||||
const args = arg({
|
||||
// Types
|
||||
'--help': Boolean,
|
||||
'--version': Boolean,
|
||||
'--verbose': arg.COUNT, // Counts the number of times --verbose is passed
|
||||
'--port': Number, // --port <number> or --port=<number>
|
||||
'--name': String, // --name <string> or --name=<string>
|
||||
'--tag': [String], // --tag <string> or --tag=<string>
|
||||
|
||||
// Aliases
|
||||
'-v': '--verbose',
|
||||
'-n': '--name', // -n <string>; result is stored in --name
|
||||
'--label': '--name' // --label <string> or --label=<string>;
|
||||
// result is stored in --name
|
||||
});
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: ["foo", "bar", "--foobar"],
|
||||
'--port': 1234,
|
||||
'--verbose': 4,
|
||||
'--name': "My name",
|
||||
'--tag': ["qux", "qix"]
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
The values for each key=>value pair is either a type (function or [function]) or a string (indicating an alias).
|
||||
|
||||
- In the case of a function, the string value of the argument's value is passed to it,
|
||||
and the return value is used as the ultimate value.
|
||||
|
||||
- In the case of an array, the only element _must_ be a type function. Array types indicate
|
||||
that the argument may be passed multiple times, and as such the resulting value in the returned
|
||||
object is an array with all of the values that were passed using the specified flag.
|
||||
|
||||
- In the case of a string, an alias is established. If a flag is passed that matches the _key_,
|
||||
then the _value_ is substituted in its place.
|
||||
|
||||
Type functions are passed three arguments:
|
||||
|
||||
1. The parameter value (always a string)
|
||||
2. The parameter name (e.g. `--label`)
|
||||
3. The previous value for the destination (useful for reduce-like operations or for supporting `-v` multiple times, etc.)
|
||||
|
||||
This means the built-in `String`, `Number`, and `Boolean` type constructors "just work" as type functions.
|
||||
|
||||
Note that `Boolean` and `[Boolean]` have special treatment - an option argument is _not_ consumed or passed, but instead `true` is
|
||||
returned. These options are called "flags".
|
||||
|
||||
For custom handlers that wish to behave as flags, you may pass the function through `arg.flag()`:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = [
|
||||
'--foo',
|
||||
'bar',
|
||||
'-ff',
|
||||
'baz',
|
||||
'--foo',
|
||||
'--foo',
|
||||
'qux',
|
||||
'-fff',
|
||||
'qix'
|
||||
];
|
||||
|
||||
function myHandler(value, argName, previousValue) {
|
||||
/* `value` is always `true` */
|
||||
return 'na ' + (previousValue || 'batman!');
|
||||
}
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': arg.flag(myHandler),
|
||||
'-f': '--foo'
|
||||
},
|
||||
{
|
||||
argv
|
||||
}
|
||||
);
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: ['bar', 'baz', 'qux', 'qix'],
|
||||
'--foo': 'na na na na na na na na batman!'
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
As well, `arg` supplies a helper argument handler called `arg.COUNT`, which equivalent to a `[Boolean]` argument's `.length`
|
||||
property - effectively counting the number of times the boolean flag, denoted by the key, is passed on the command line..
|
||||
For example, this is how you could implement `ssh`'s multiple levels of verbosity (`-vvvv` being the most verbose).
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = ['-AAAA', '-BBBB'];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'-A': arg.COUNT,
|
||||
'-B': [Boolean]
|
||||
},
|
||||
{
|
||||
argv
|
||||
}
|
||||
);
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: [],
|
||||
'-A': 4,
|
||||
'-B': [true, true, true, true]
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
If a second parameter is specified and is an object, it specifies parsing options to modify the behavior of `arg()`.
|
||||
|
||||
#### `argv`
|
||||
|
||||
If you have already sliced or generated a number of raw arguments to be parsed (as opposed to letting `arg`
|
||||
slice them from `process.argv`) you may specify them in the `argv` option.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': String
|
||||
},
|
||||
{
|
||||
argv: ['hello', '--foo', 'world']
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['hello'],
|
||||
'--foo': 'world'
|
||||
};
|
||||
```
|
||||
|
||||
#### `permissive`
|
||||
|
||||
When `permissive` set to `true`, `arg` will push any unknown arguments
|
||||
onto the "extra" argument array (`result._`) instead of throwing an error about
|
||||
an unknown flag.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = [
|
||||
'--foo',
|
||||
'hello',
|
||||
'--qux',
|
||||
'qix',
|
||||
'--bar',
|
||||
'12345',
|
||||
'hello again'
|
||||
];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': String,
|
||||
'--bar': Number
|
||||
},
|
||||
{
|
||||
argv,
|
||||
permissive: true
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['--qux', 'qix', 'hello again'],
|
||||
'--foo': 'hello',
|
||||
'--bar': 12345
|
||||
};
|
||||
```
|
||||
|
||||
#### `stopAtPositional`
|
||||
|
||||
When `stopAtPositional` is set to `true`, `arg` will halt parsing at the first
|
||||
positional argument.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = ['--foo', 'hello', '--bar'];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': Boolean,
|
||||
'--bar': Boolean
|
||||
},
|
||||
{
|
||||
argv,
|
||||
stopAtPositional: true
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['hello', '--bar'],
|
||||
'--foo': true
|
||||
};
|
||||
```
|
||||
|
||||
### Errors
|
||||
|
||||
Some errors that `arg` throws provide a `.code` property in order to aid in recovering from user error, or to
|
||||
differentiate between user error and developer error (bug).
|
||||
|
||||
##### ARG_UNKNOWN_OPTION
|
||||
|
||||
If an unknown option (not defined in the spec object) is passed, an error with code `ARG_UNKNOWN_OPTION` will be thrown:
|
||||
|
||||
```js
|
||||
// cli.js
|
||||
try {
|
||||
require('arg')({ '--hi': String });
|
||||
} catch (err) {
|
||||
if (err.code === 'ARG_UNKNOWN_OPTION') {
|
||||
console.log(err.message);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```shell
|
||||
node cli.js --extraneous true
|
||||
Unknown or unexpected option: --extraneous
|
||||
```
|
||||
|
||||
# FAQ
|
||||
|
||||
A few questions and answers that have been asked before:
|
||||
|
||||
### How do I require an argument with `arg`?
|
||||
|
||||
Do the assertion yourself, such as:
|
||||
|
||||
```javascript
|
||||
const args = arg({ '--name': String });
|
||||
|
||||
if (!args['--name']) throw new Error('missing required argument: --name');
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
Released under the [MIT License](LICENSE.md).
|
||||
44
node_modules/arg/index.d.ts
generated
vendored
Normal file
44
node_modules/arg/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
declare function arg<T extends arg.Spec>(
|
||||
spec: T,
|
||||
options?: arg.Options
|
||||
): arg.Result<T>;
|
||||
|
||||
declare namespace arg {
|
||||
export const flagSymbol: unique symbol;
|
||||
|
||||
export function flag<T>(fn: T): T & { [arg.flagSymbol]: true };
|
||||
|
||||
export const COUNT: Handler<number> & { [arg.flagSymbol]: true };
|
||||
|
||||
export type Handler<T = any> = (
|
||||
value: string,
|
||||
name: string,
|
||||
previousValue?: T
|
||||
) => T;
|
||||
|
||||
export class ArgError extends Error {
|
||||
constructor(message: string, code: string);
|
||||
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface Spec {
|
||||
[key: string]: string | Handler | [Handler];
|
||||
}
|
||||
|
||||
export type Result<T extends Spec> = { _: string[] } & {
|
||||
[K in keyof T]?: T[K] extends Handler
|
||||
? ReturnType<T[K]>
|
||||
: T[K] extends [Handler]
|
||||
? Array<ReturnType<T[K][0]>>
|
||||
: never;
|
||||
};
|
||||
|
||||
export interface Options {
|
||||
argv?: string[];
|
||||
permissive?: boolean;
|
||||
stopAtPositional?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = arg;
|
||||
195
node_modules/arg/index.js
generated
vendored
Normal file
195
node_modules/arg/index.js
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
const flagSymbol = Symbol('arg flag');
|
||||
|
||||
class ArgError extends Error {
|
||||
constructor(msg, code) {
|
||||
super(msg);
|
||||
this.name = 'ArgError';
|
||||
this.code = code;
|
||||
|
||||
Object.setPrototypeOf(this, ArgError.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
function arg(
|
||||
opts,
|
||||
{
|
||||
argv = process.argv.slice(2),
|
||||
permissive = false,
|
||||
stopAtPositional = false
|
||||
} = {}
|
||||
) {
|
||||
if (!opts) {
|
||||
throw new ArgError(
|
||||
'argument specification object is required',
|
||||
'ARG_CONFIG_NO_SPEC'
|
||||
);
|
||||
}
|
||||
|
||||
const result = { _: [] };
|
||||
|
||||
const aliases = {};
|
||||
const handlers = {};
|
||||
|
||||
for (const key of Object.keys(opts)) {
|
||||
if (!key) {
|
||||
throw new ArgError(
|
||||
'argument key cannot be an empty string',
|
||||
'ARG_CONFIG_EMPTY_KEY'
|
||||
);
|
||||
}
|
||||
|
||||
if (key[0] !== '-') {
|
||||
throw new ArgError(
|
||||
`argument key must start with '-' but found: '${key}'`,
|
||||
'ARG_CONFIG_NONOPT_KEY'
|
||||
);
|
||||
}
|
||||
|
||||
if (key.length === 1) {
|
||||
throw new ArgError(
|
||||
`argument key must have a name; singular '-' keys are not allowed: ${key}`,
|
||||
'ARG_CONFIG_NONAME_KEY'
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof opts[key] === 'string') {
|
||||
aliases[key] = opts[key];
|
||||
continue;
|
||||
}
|
||||
|
||||
let type = opts[key];
|
||||
let isFlag = false;
|
||||
|
||||
if (
|
||||
Array.isArray(type) &&
|
||||
type.length === 1 &&
|
||||
typeof type[0] === 'function'
|
||||
) {
|
||||
const [fn] = type;
|
||||
type = (value, name, prev = []) => {
|
||||
prev.push(fn(value, name, prev[prev.length - 1]));
|
||||
return prev;
|
||||
};
|
||||
isFlag = fn === Boolean || fn[flagSymbol] === true;
|
||||
} else if (typeof type === 'function') {
|
||||
isFlag = type === Boolean || type[flagSymbol] === true;
|
||||
} else {
|
||||
throw new ArgError(
|
||||
`type missing or not a function or valid array type: ${key}`,
|
||||
'ARG_CONFIG_VAD_TYPE'
|
||||
);
|
||||
}
|
||||
|
||||
if (key[1] !== '-' && key.length > 2) {
|
||||
throw new ArgError(
|
||||
`short argument keys (with a single hyphen) must have only one character: ${key}`,
|
||||
'ARG_CONFIG_SHORTOPT_TOOLONG'
|
||||
);
|
||||
}
|
||||
|
||||
handlers[key] = [type, isFlag];
|
||||
}
|
||||
|
||||
for (let i = 0, len = argv.length; i < len; i++) {
|
||||
const wholeArg = argv[i];
|
||||
|
||||
if (stopAtPositional && result._.length > 0) {
|
||||
result._ = result._.concat(argv.slice(i));
|
||||
break;
|
||||
}
|
||||
|
||||
if (wholeArg === '--') {
|
||||
result._ = result._.concat(argv.slice(i + 1));
|
||||
break;
|
||||
}
|
||||
|
||||
if (wholeArg.length > 1 && wholeArg[0] === '-') {
|
||||
/* eslint-disable operator-linebreak */
|
||||
const separatedArguments =
|
||||
wholeArg[1] === '-' || wholeArg.length === 2
|
||||
? [wholeArg]
|
||||
: wholeArg
|
||||
.slice(1)
|
||||
.split('')
|
||||
.map((a) => `-${a}`);
|
||||
/* eslint-enable operator-linebreak */
|
||||
|
||||
for (let j = 0; j < separatedArguments.length; j++) {
|
||||
const arg = separatedArguments[j];
|
||||
const [originalArgName, argStr] =
|
||||
arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined];
|
||||
|
||||
let argName = originalArgName;
|
||||
while (argName in aliases) {
|
||||
argName = aliases[argName];
|
||||
}
|
||||
|
||||
if (!(argName in handlers)) {
|
||||
if (permissive) {
|
||||
result._.push(arg);
|
||||
continue;
|
||||
} else {
|
||||
throw new ArgError(
|
||||
`unknown or unexpected option: ${originalArgName}`,
|
||||
'ARG_UNKNOWN_OPTION'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const [type, isFlag] = handlers[argName];
|
||||
|
||||
if (!isFlag && j + 1 < separatedArguments.length) {
|
||||
throw new ArgError(
|
||||
`option requires argument (but was followed by another short argument): ${originalArgName}`,
|
||||
'ARG_MISSING_REQUIRED_SHORTARG'
|
||||
);
|
||||
}
|
||||
|
||||
if (isFlag) {
|
||||
result[argName] = type(true, argName, result[argName]);
|
||||
} else if (argStr === undefined) {
|
||||
if (
|
||||
argv.length < i + 2 ||
|
||||
(argv[i + 1].length > 1 &&
|
||||
argv[i + 1][0] === '-' &&
|
||||
!(
|
||||
argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) &&
|
||||
(type === Number ||
|
||||
// eslint-disable-next-line no-undef
|
||||
(typeof BigInt !== 'undefined' && type === BigInt))
|
||||
))
|
||||
) {
|
||||
const extended =
|
||||
originalArgName === argName ? '' : ` (alias for ${argName})`;
|
||||
throw new ArgError(
|
||||
`option requires argument: ${originalArgName}${extended}`,
|
||||
'ARG_MISSING_REQUIRED_LONGARG'
|
||||
);
|
||||
}
|
||||
|
||||
result[argName] = type(argv[i + 1], argName, result[argName]);
|
||||
++i;
|
||||
} else {
|
||||
result[argName] = type(argStr, argName, result[argName]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result._.push(wholeArg);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
arg.flag = (fn) => {
|
||||
fn[flagSymbol] = true;
|
||||
return fn;
|
||||
};
|
||||
|
||||
// Utility types
|
||||
arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1);
|
||||
|
||||
// Expose error class
|
||||
arg.ArgError = ArgError;
|
||||
|
||||
module.exports = arg;
|
||||
28
node_modules/arg/package.json
generated
vendored
Normal file
28
node_modules/arg/package.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "arg",
|
||||
"version": "5.0.2",
|
||||
"description": "Unopinionated, no-frills CLI argument parser",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"repository": "vercel/arg",
|
||||
"author": "Josh Junon <junon@wavetilt.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "WARN_EXIT=1 jest --coverage -w 2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.1",
|
||||
"jest": "^27.0.6",
|
||||
"prettier": "^2.3.2"
|
||||
},
|
||||
"prettier": {
|
||||
"arrowParens": "always",
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
}
|
||||
103
node_modules/depd/History.md
generated
vendored
Normal file
103
node_modules/depd/History.md
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
2.0.0 / 2018-10-26
|
||||
==================
|
||||
|
||||
* Drop support for Node.js 0.6
|
||||
* Replace internal `eval` usage with `Function` constructor
|
||||
* Use instance methods on `process` to check for listeners
|
||||
|
||||
1.1.2 / 2018-01-11
|
||||
==================
|
||||
|
||||
* perf: remove argument reassignment
|
||||
* Support Node.js 0.6 to 9.x
|
||||
|
||||
1.1.1 / 2017-07-27
|
||||
==================
|
||||
|
||||
* Remove unnecessary `Buffer` loading
|
||||
* Support Node.js 0.6 to 8.x
|
||||
|
||||
1.1.0 / 2015-09-14
|
||||
==================
|
||||
|
||||
* Enable strict mode in more places
|
||||
* Support io.js 3.x
|
||||
* Support io.js 2.x
|
||||
* Support web browser loading
|
||||
- Requires bundler like Browserify or webpack
|
||||
|
||||
1.0.1 / 2015-04-07
|
||||
==================
|
||||
|
||||
* Fix `TypeError`s when under `'use strict'` code
|
||||
* Fix useless type name on auto-generated messages
|
||||
* Support io.js 1.x
|
||||
* Support Node.js 0.12
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* No changes
|
||||
|
||||
0.4.5 / 2014-09-09
|
||||
==================
|
||||
|
||||
* Improve call speed to functions using the function wrapper
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.4.4 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Work-around v8 generating empty stack traces
|
||||
|
||||
0.4.3 / 2014-07-26
|
||||
==================
|
||||
|
||||
* Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.4.2 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Correct call site for wrapped functions and properties
|
||||
|
||||
0.4.1 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Improve automatic message generation for function properties
|
||||
|
||||
0.4.0 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Add `TRACE_DEPRECATION` environment variable
|
||||
* Remove non-standard grey color from color output
|
||||
* Support `--no-deprecation` argument
|
||||
* Support `--trace-deprecation` argument
|
||||
* Support `deprecate.property(fn, prop, message)`
|
||||
|
||||
0.3.0 / 2014-06-16
|
||||
==================
|
||||
|
||||
* Add `NO_DEPRECATION` environment variable
|
||||
|
||||
0.2.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.property(obj, prop, message)`
|
||||
* Remove `supports-color` dependency for node.js 0.8
|
||||
|
||||
0.1.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.function(fn, message)`
|
||||
* Add `process.on('deprecation', fn)` emitter
|
||||
* Automatically generate message when omitted from `deprecate()`
|
||||
|
||||
0.0.1 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Fix warning for dynamic calls at singe call site
|
||||
|
||||
0.0.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Initial implementation
|
||||
22
node_modules/depd/LICENSE
generated
vendored
Normal file
22
node_modules/depd/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2018 Douglas Christopher Wilson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
280
node_modules/depd/Readme.md
generated
vendored
Normal file
280
node_modules/depd/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
# depd
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Deprecate all the things
|
||||
|
||||
> With great modules comes great responsibility; mark things deprecated!
|
||||
|
||||
## Install
|
||||
|
||||
This module is installed directly using `npm`:
|
||||
|
||||
```sh
|
||||
$ npm install depd
|
||||
```
|
||||
|
||||
This module can also be bundled with systems like
|
||||
[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/),
|
||||
though by default this module will alter it's API to no longer display or
|
||||
track deprecations.
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-module')
|
||||
```
|
||||
|
||||
This library allows you to display deprecation messages to your users.
|
||||
This library goes above and beyond with deprecation warnings by
|
||||
introspection of the call stack (but only the bits that it is interested
|
||||
in).
|
||||
|
||||
Instead of just warning on the first invocation of a deprecated
|
||||
function and never again, this module will warn on the first invocation
|
||||
of a deprecated function per unique call site, making it ideal to alert
|
||||
users of all deprecated uses across the code base, rather than just
|
||||
whatever happens to execute first.
|
||||
|
||||
The deprecation warnings from this module also include the file and line
|
||||
information for the call into the module that the deprecated function was
|
||||
in.
|
||||
|
||||
**NOTE** this library has a similar interface to the `debug` module, and
|
||||
this module uses the calling file to get the boundary for the call stacks,
|
||||
so you should always create a new `deprecate` object in each file and not
|
||||
within some central file.
|
||||
|
||||
### depd(namespace)
|
||||
|
||||
Create a new deprecate function that uses the given namespace name in the
|
||||
messages and will display the call site prior to the stack entering the
|
||||
file this function was called from. It is highly suggested you use the
|
||||
name of your module as the namespace.
|
||||
|
||||
### deprecate(message)
|
||||
|
||||
Call this function from deprecated code to display a deprecation message.
|
||||
This message will appear once per unique caller site. Caller site is the
|
||||
first call site in the stack in a different file from the caller of this
|
||||
function.
|
||||
|
||||
If the message is omitted, a message is generated for you based on the site
|
||||
of the `deprecate()` call and will display the name of the function called,
|
||||
similar to the name displayed in a stack trace.
|
||||
|
||||
### deprecate.function(fn, message)
|
||||
|
||||
Call this function to wrap a given function in a deprecation message on any
|
||||
call to the function. An optional message can be supplied to provide a custom
|
||||
message.
|
||||
|
||||
### deprecate.property(obj, prop, message)
|
||||
|
||||
Call this function to wrap a given property on object in a deprecation message
|
||||
on any accessing or setting of the property. An optional message can be supplied
|
||||
to provide a custom message.
|
||||
|
||||
The method must be called on the object where the property belongs (not
|
||||
inherited from the prototype).
|
||||
|
||||
If the property is a data descriptor, it will be converted to an accessor
|
||||
descriptor in order to display the deprecation message.
|
||||
|
||||
### process.on('deprecation', fn)
|
||||
|
||||
This module will allow easy capturing of deprecation errors by emitting the
|
||||
errors as the type "deprecation" on the global `process`. If there are no
|
||||
listeners for this type, the errors are written to STDERR as normal, but if
|
||||
there are any listeners, nothing will be written to STDERR and instead only
|
||||
emitted. From there, you can write the errors in a different format or to a
|
||||
logging source.
|
||||
|
||||
The error represents the deprecation and is emitted only once with the same
|
||||
rules as writing to STDERR. The error has the following properties:
|
||||
|
||||
- `message` - This is the message given by the library
|
||||
- `name` - This is always `'DeprecationError'`
|
||||
- `namespace` - This is the namespace the deprecation came from
|
||||
- `stack` - This is the stack of the call to the deprecated thing
|
||||
|
||||
Example `error.stack` output:
|
||||
|
||||
```
|
||||
DeprecationError: my-cool-module deprecated oldfunction
|
||||
at Object.<anonymous> ([eval]-wrapper:6:22)
|
||||
at Module._compile (module.js:456:26)
|
||||
at evalScript (node.js:532:25)
|
||||
at startup (node.js:80:7)
|
||||
at node.js:902:3
|
||||
```
|
||||
|
||||
### process.env.NO_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `NO_DEPRECATION`
|
||||
is provided as a quick solution to silencing deprecation warnings from being
|
||||
output. The format of this is similar to that of `DEBUG`:
|
||||
|
||||
```sh
|
||||
$ NO_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will suppress deprecations from being output for "my-module" and "othermod".
|
||||
The value is a list of comma-separated namespaces. To suppress every warning
|
||||
across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--no-deprecation` to the `node` executable will suppress
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not suppress the deperecations given to any "deprecation"
|
||||
event listeners, just the output to STDERR.
|
||||
|
||||
### process.env.TRACE_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`
|
||||
is provided as a solution to getting more detailed location information in deprecation
|
||||
warnings by including the entire stack trace. The format of this is the same as
|
||||
`NO_DEPRECATION`:
|
||||
|
||||
```sh
|
||||
$ TRACE_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will include stack traces for deprecations being output for "my-module" and
|
||||
"othermod". The value is a list of comma-separated namespaces. To trace every
|
||||
warning across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--trace-deprecation` to the `node` executable will trace
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.
|
||||
|
||||
## Display
|
||||
|
||||

|
||||
|
||||
When a user calls a function in your library that you mark deprecated, they
|
||||
will see the following written to STDERR (in the given colors, similar colors
|
||||
and layout to the `debug` module):
|
||||
|
||||
```
|
||||
bright cyan bright yellow
|
||||
| | reset cyan
|
||||
| | | |
|
||||
▼ ▼ ▼ ▼
|
||||
my-cool-module deprecated oldfunction [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲
|
||||
| | | |
|
||||
namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
If the user redirects their STDERR to a file or somewhere that does not support
|
||||
colors, they see (similar layout to the `debug` module):
|
||||
|
||||
```
|
||||
Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲ ▲
|
||||
| | | | |
|
||||
timestamp of message namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Deprecating all calls to a function
|
||||
|
||||
This will display a deprecated message about "oldfunction" being deprecated
|
||||
from "my-module" on STDERR.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
// message automatically derived from function name
|
||||
// Object.oldfunction
|
||||
exports.oldfunction = deprecate.function(function oldfunction () {
|
||||
// all calls to function are deprecated
|
||||
})
|
||||
|
||||
// specific message
|
||||
exports.oldfunction = deprecate.function(function () {
|
||||
// all calls to function are deprecated
|
||||
}, 'oldfunction')
|
||||
```
|
||||
|
||||
### Conditionally deprecating a function call
|
||||
|
||||
This will display a deprecated message about "weirdfunction" being deprecated
|
||||
from "my-module" on STDERR when called with less than 2 arguments.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
When calling `deprecate` as a function, the warning is counted per call site
|
||||
within your own module, so you can display different deprecations depending
|
||||
on different situations and the users will still get all the warnings:
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
} else if (typeof arguments[0] !== 'string') {
|
||||
// calls with non-string first argument are deprecated
|
||||
deprecate('weirdfunction non-string first arg')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Deprecating property access
|
||||
|
||||
This will display a deprecated message about "oldprop" being deprecated
|
||||
from "my-module" on STDERR when accessed. A deprecation will be displayed
|
||||
when setting the value and when getting the value.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.oldprop = 'something'
|
||||
|
||||
// message automatically derives from property name
|
||||
deprecate.property(exports, 'oldprop')
|
||||
|
||||
// explicit message
|
||||
deprecate.property(exports, 'oldprop', 'oldprop >= 0.10')
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master
|
||||
[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master
|
||||
[node-image]: https://badgen.net/npm/node/depd
|
||||
[node-url]: https://nodejs.org/en/download/
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/depd
|
||||
[npm-url]: https://npmjs.org/package/depd
|
||||
[npm-version-image]: https://badgen.net/npm/v/depd
|
||||
[travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux
|
||||
[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd
|
||||
538
node_modules/depd/index.js
generated
vendored
Normal file
538
node_modules/depd/index.js
generated
vendored
Normal file
@@ -0,0 +1,538 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var relative = require('path').relative
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Get the path to base files on.
|
||||
*/
|
||||
|
||||
var basePath = process.cwd()
|
||||
|
||||
/**
|
||||
* Determine if namespace is contained in the string.
|
||||
*/
|
||||
|
||||
function containsNamespace (str, namespace) {
|
||||
var vals = str.split(/[ ,]+/)
|
||||
var ns = String(namespace).toLowerCase()
|
||||
|
||||
for (var i = 0; i < vals.length; i++) {
|
||||
var val = vals[i]
|
||||
|
||||
// namespace contained
|
||||
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a data descriptor to accessor descriptor.
|
||||
*/
|
||||
|
||||
function convertDataDescriptorToAccessor (obj, prop, message) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
var value = descriptor.value
|
||||
|
||||
descriptor.get = function getter () { return value }
|
||||
|
||||
if (descriptor.writable) {
|
||||
descriptor.set = function setter (val) { return (value = val) }
|
||||
}
|
||||
|
||||
delete descriptor.value
|
||||
delete descriptor.writable
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
|
||||
return descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create arguments string to keep arity.
|
||||
*/
|
||||
|
||||
function createArgumentsString (arity) {
|
||||
var str = ''
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
str += ', arg' + i
|
||||
}
|
||||
|
||||
return str.substr(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stack string from stack.
|
||||
*/
|
||||
|
||||
function createStackString (stack) {
|
||||
var str = this.name + ': ' + this.namespace
|
||||
|
||||
if (this.message) {
|
||||
str += ' deprecated ' + this.message
|
||||
}
|
||||
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
str += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
var file = site[0]
|
||||
|
||||
function deprecate (message) {
|
||||
// call to self as log
|
||||
log.call(deprecate, message)
|
||||
}
|
||||
|
||||
deprecate._file = file
|
||||
deprecate._ignored = isignored(namespace)
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = istraced(namespace)
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if event emitter has listeners of a given type.
|
||||
*
|
||||
* The way to do this check is done three different ways in Node.js >= 0.8
|
||||
* so this consolidates them into a minimal set using instance methods.
|
||||
*
|
||||
* @param {EventEmitter} emitter
|
||||
* @param {string} type
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function eehaslisteners (emitter, type) {
|
||||
var count = typeof emitter.listenerCount !== 'function'
|
||||
? emitter.listeners(type).length
|
||||
: emitter.listenerCount(type)
|
||||
|
||||
return count > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is ignored.
|
||||
*/
|
||||
|
||||
function isignored (namespace) {
|
||||
if (process.noDeprecation) {
|
||||
// --no-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.NO_DEPRECATION || ''
|
||||
|
||||
// namespace ignored
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is traced.
|
||||
*/
|
||||
|
||||
function istraced (namespace) {
|
||||
if (process.traceDeprecation) {
|
||||
// --trace-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.TRACE_DEPRECATION || ''
|
||||
|
||||
// namespace traced
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Display deprecation message.
|
||||
*/
|
||||
|
||||
function log (message, site) {
|
||||
var haslisteners = eehaslisteners(process, 'deprecation')
|
||||
|
||||
// abort early if no destination
|
||||
if (!haslisteners && this._ignored) {
|
||||
return
|
||||
}
|
||||
|
||||
var caller
|
||||
var callFile
|
||||
var callSite
|
||||
var depSite
|
||||
var i = 0
|
||||
var seen = false
|
||||
var stack = getStack()
|
||||
var file = this._file
|
||||
|
||||
if (site) {
|
||||
// provided site
|
||||
depSite = site
|
||||
callSite = callSiteLocation(stack[1])
|
||||
callSite.name = depSite.name
|
||||
file = callSite[0]
|
||||
} else {
|
||||
// get call site
|
||||
i = 2
|
||||
depSite = callSiteLocation(stack[i])
|
||||
callSite = depSite
|
||||
}
|
||||
|
||||
// get caller of deprecated thing in relation to file
|
||||
for (; i < stack.length; i++) {
|
||||
caller = callSiteLocation(stack[i])
|
||||
callFile = caller[0]
|
||||
|
||||
if (callFile === file) {
|
||||
seen = true
|
||||
} else if (callFile === this._file) {
|
||||
file = this._file
|
||||
} else if (seen) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var key = caller
|
||||
? depSite.join(':') + '__' + caller.join(':')
|
||||
: undefined
|
||||
|
||||
if (key !== undefined && key in this._warned) {
|
||||
// already warned
|
||||
return
|
||||
}
|
||||
|
||||
this._warned[key] = true
|
||||
|
||||
// generate automatic message from call site
|
||||
var msg = message
|
||||
if (!msg) {
|
||||
msg = callSite === depSite || !callSite.name
|
||||
? defaultMessage(depSite)
|
||||
: defaultMessage(callSite)
|
||||
}
|
||||
|
||||
// emit deprecation if listeners exist
|
||||
if (haslisteners) {
|
||||
var err = DeprecationError(this._namespace, msg, stack.slice(i))
|
||||
process.emit('deprecation', err)
|
||||
return
|
||||
}
|
||||
|
||||
// format and write message
|
||||
var format = process.stderr.isTTY
|
||||
? formatColor
|
||||
: formatPlain
|
||||
var output = format.call(this, msg, caller, stack.slice(i))
|
||||
process.stderr.write(output + '\n', 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call site location as array.
|
||||
*/
|
||||
|
||||
function callSiteLocation (callSite) {
|
||||
var file = callSite.getFileName() || '<anonymous>'
|
||||
var line = callSite.getLineNumber()
|
||||
var colm = callSite.getColumnNumber()
|
||||
|
||||
if (callSite.isEval()) {
|
||||
file = callSite.getEvalOrigin() + ', ' + file
|
||||
}
|
||||
|
||||
var site = [file, line, colm]
|
||||
|
||||
site.callSite = callSite
|
||||
site.name = callSite.getFunctionName()
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a default message from the site.
|
||||
*/
|
||||
|
||||
function defaultMessage (site) {
|
||||
var callSite = site.callSite
|
||||
var funcName = site.name
|
||||
|
||||
// make useful anonymous name
|
||||
if (!funcName) {
|
||||
funcName = '<anonymous@' + formatLocation(site) + '>'
|
||||
}
|
||||
|
||||
var context = callSite.getThis()
|
||||
var typeName = context && callSite.getTypeName()
|
||||
|
||||
// ignore useless type name
|
||||
if (typeName === 'Object') {
|
||||
typeName = undefined
|
||||
}
|
||||
|
||||
// make useful type name
|
||||
if (typeName === 'Function') {
|
||||
typeName = context.name || typeName
|
||||
}
|
||||
|
||||
return typeName && callSite.getMethodName()
|
||||
? typeName + '.' + funcName
|
||||
: funcName
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message without color.
|
||||
*/
|
||||
|
||||
function formatPlain (msg, caller, stack) {
|
||||
var timestamp = new Date().toUTCString()
|
||||
|
||||
var formatted = timestamp +
|
||||
' ' + this._namespace +
|
||||
' deprecated ' + msg
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' at ' + formatLocation(caller)
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message with color.
|
||||
*/
|
||||
|
||||
function formatColor (msg, caller, stack) {
|
||||
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
|
||||
' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
|
||||
' \x1b[0m' + msg + '\x1b[39m' // reset
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format call site location.
|
||||
*/
|
||||
|
||||
function formatLocation (callSite) {
|
||||
return relative(basePath, callSite[0]) +
|
||||
':' + callSite[1] +
|
||||
':' + callSite[2]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack as array of call sites.
|
||||
*/
|
||||
|
||||
function getStack () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = Math.max(10, limit)
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice this function off the top
|
||||
var stack = obj.stack.slice(1)
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture call site stack from v8.
|
||||
*/
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
var args = createArgumentsString(fn.length)
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
site.name = fn.name
|
||||
|
||||
// eslint-disable-next-line no-new-func
|
||||
var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',
|
||||
'"use strict"\n' +
|
||||
'return function (' + args + ') {' +
|
||||
'log.call(deprecate, message, site)\n' +
|
||||
'return fn.apply(this, arguments)\n' +
|
||||
'}')(fn, log, this, message, site)
|
||||
|
||||
return deprecatedfn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
|
||||
var deprecate = this
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
// set site name
|
||||
site.name = prop
|
||||
|
||||
// convert data descriptor
|
||||
if ('value' in descriptor) {
|
||||
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
||||
}
|
||||
|
||||
var get = descriptor.get
|
||||
var set = descriptor.set
|
||||
|
||||
// wrap getter
|
||||
if (typeof get === 'function') {
|
||||
descriptor.get = function getter () {
|
||||
log.call(deprecate, message, site)
|
||||
return get.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
// wrap setter
|
||||
if (typeof set === 'function') {
|
||||
descriptor.set = function setter () {
|
||||
log.call(deprecate, message, site)
|
||||
return set.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecationError for deprecation
|
||||
*/
|
||||
|
||||
function DeprecationError (namespace, message, stack) {
|
||||
var error = new Error()
|
||||
var stackString
|
||||
|
||||
Object.defineProperty(error, 'constructor', {
|
||||
value: DeprecationError
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'message', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: message,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: 'DeprecationError',
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'namespace', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: namespace,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (stackString !== undefined) {
|
||||
return stackString
|
||||
}
|
||||
|
||||
// prepare stack trace
|
||||
return (stackString = createStackString.call(this, stack))
|
||||
},
|
||||
set: function setter (val) {
|
||||
stackString = val
|
||||
}
|
||||
})
|
||||
|
||||
return error
|
||||
}
|
||||
77
node_modules/depd/lib/browser/index.js
generated
vendored
Normal file
77
node_modules/depd/lib/browser/index.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
function deprecate (message) {
|
||||
// no-op in browser
|
||||
}
|
||||
|
||||
deprecate._file = undefined
|
||||
deprecate._ignored = true
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = false
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
return fn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
}
|
||||
45
node_modules/depd/package.json
generated
vendored
Normal file
45
node_modules/depd/package.json
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "depd",
|
||||
"description": "Deprecate all the things",
|
||||
"version": "2.0.0",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"deprecate",
|
||||
"deprecated"
|
||||
],
|
||||
"repository": "dougwilson/nodejs-depd",
|
||||
"browser": "lib/browser/index.js",
|
||||
"devDependencies": {
|
||||
"benchmark": "2.1.4",
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"eslint": "5.7.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.7",
|
||||
"eslint-plugin-node": "7.0.1",
|
||||
"eslint-plugin-promise": "4.0.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "5.2.0",
|
||||
"safe-buffer": "5.1.2",
|
||||
"uid-safe": "2.1.5"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"History.md",
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"Readme.md"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node benchmark/index.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail test/",
|
||||
"test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary",
|
||||
"test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary"
|
||||
}
|
||||
}
|
||||
598
node_modules/dotenv/CHANGELOG.md
generated
vendored
Normal file
598
node_modules/dotenv/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,598 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [Unreleased](https://github.com/motdotla/dotenv/compare/v17.2.3...master)
|
||||
|
||||
## [17.2.3](https://github.com/motdotla/dotenv/compare/v17.2.2...v17.2.3) (2025-09-29)
|
||||
|
||||
### Changed
|
||||
|
||||
* Fixed typescript error definition ([#912](https://github.com/motdotla/dotenv/pull/912))
|
||||
|
||||
## [17.2.2](https://github.com/motdotla/dotenv/compare/v17.2.1...v17.2.2) (2025-09-02)
|
||||
|
||||
### Added
|
||||
|
||||
- 🙏 A big thank you to new sponsor [Tuple.app](https://tuple.app/dotenv) - *the premier screen sharing app for developers on macOS and Windows.* Go check them out. It's wonderful and generous of them to give back to open source by sponsoring dotenv. Give them some love back.
|
||||
|
||||
## [17.2.1](https://github.com/motdotla/dotenv/compare/v17.2.0...v17.2.1) (2025-07-24)
|
||||
|
||||
### Changed
|
||||
|
||||
* Fix clickable tip links by removing parentheses ([#897](https://github.com/motdotla/dotenv/pull/897))
|
||||
|
||||
## [17.2.0](https://github.com/motdotla/dotenv/compare/v17.1.0...v17.2.0) (2025-07-09)
|
||||
|
||||
### Added
|
||||
|
||||
* Optionally specify `DOTENV_CONFIG_QUIET=true` in your environment or `.env` file to quiet the runtime log ([#889](https://github.com/motdotla/dotenv/pull/889))
|
||||
* Just like dotenv any `DOTENV_CONFIG_` environment variables take precedence over any code set options like `({quiet: false})`
|
||||
|
||||
```ini
|
||||
# .env
|
||||
DOTENV_CONFIG_QUIET=true
|
||||
HELLO="World"
|
||||
```
|
||||
```js
|
||||
// index.js
|
||||
require('dotenv').config()
|
||||
console.log(`Hello ${process.env.HELLO}`)
|
||||
```
|
||||
```sh
|
||||
$ node index.js
|
||||
Hello World
|
||||
|
||||
or
|
||||
|
||||
$ DOTENV_CONFIG_QUIET=true node index.js
|
||||
```
|
||||
|
||||
## [17.1.0](https://github.com/motdotla/dotenv/compare/v17.0.1...v17.1.0) (2025-07-07)
|
||||
|
||||
### Added
|
||||
|
||||
* Add additional security and configuration tips to the runtime log ([#884](https://github.com/motdotla/dotenv/pull/884))
|
||||
* Dim the tips text from the main injection information text
|
||||
|
||||
```js
|
||||
const TIPS = [
|
||||
'🔐 encrypt with dotenvx: https://dotenvx.com',
|
||||
'🔐 prevent committing .env to code: https://dotenvx.com/precommit',
|
||||
'🔐 prevent building .env in docker: https://dotenvx.com/prebuild',
|
||||
'🛠️ run anywhere with `dotenvx run -- yourcommand`',
|
||||
'⚙️ specify custom .env file path with { path: \'/custom/path/.env\' }',
|
||||
'⚙️ enable debug logging with { debug: true }',
|
||||
'⚙️ override existing env vars with { override: true }',
|
||||
'⚙️ suppress all logs with { quiet: true }',
|
||||
'⚙️ write to custom object with { processEnv: myObject }',
|
||||
'⚙️ load multiple .env files with { path: [\'.env.local\', \'.env\'] }'
|
||||
]
|
||||
```
|
||||
|
||||
## [17.0.1](https://github.com/motdotla/dotenv/compare/v17.0.0...v17.0.1) (2025-07-01)
|
||||
|
||||
### Changed
|
||||
|
||||
* Patched injected log to count only populated/set keys to process.env ([#879](https://github.com/motdotla/dotenv/pull/879))
|
||||
|
||||
## [17.0.0](https://github.com/motdotla/dotenv/compare/v16.6.1...v17.0.0) (2025-06-27)
|
||||
|
||||
### Changed
|
||||
|
||||
- Default `quiet` to false - informational (file and keys count) runtime log message shows by default ([#875](https://github.com/motdotla/dotenv/pull/875))
|
||||
|
||||
## [16.6.1](https://github.com/motdotla/dotenv/compare/v16.6.0...v16.6.1) (2025-06-27)
|
||||
|
||||
### Changed
|
||||
|
||||
- Default `quiet` to true – hiding the runtime log message ([#874](https://github.com/motdotla/dotenv/pull/874))
|
||||
- NOTICE: 17.0.0 will be released with quiet defaulting to false. Use `config({ quiet: true })` to suppress.
|
||||
- And check out the new [dotenvx](https://github.com/dotenvx/dotenvx). As coding workflows evolve and agents increasingly handle secrets, encrypted .env files offer a much safer way to deploy both agents and code together with secure secrets. Simply switch `require('dotenv').config()` for `require('@dotenvx/dotenvx').config()`.
|
||||
|
||||
## [16.6.0](https://github.com/motdotla/dotenv/compare/v16.5.0...v16.6.0) (2025-06-26)
|
||||
|
||||
### Added
|
||||
|
||||
- Default log helpful message `[dotenv@16.6.0] injecting env (1) from .env` ([#870](https://github.com/motdotla/dotenv/pull/870))
|
||||
- Use `{ quiet: true }` to suppress
|
||||
- Aligns dotenv more closely with [dotenvx](https://github.com/dotenvx/dotenvx).
|
||||
|
||||
## [16.5.0](https://github.com/motdotla/dotenv/compare/v16.4.7...v16.5.0) (2025-04-07)
|
||||
|
||||
### Added
|
||||
|
||||
- 🎉 Added new sponsor [Graphite](https://graphite.dev/?utm_source=github&utm_medium=repo&utm_campaign=dotenv) - *the AI developer productivity platform helping teams on GitHub ship higher quality software, faster*.
|
||||
|
||||
> [!TIP]
|
||||
> **[Become a sponsor](https://github.com/sponsors/motdotla)**
|
||||
>
|
||||
> The dotenvx README is viewed thousands of times DAILY on GitHub and NPM.
|
||||
> Sponsoring dotenv is a great way to get in front of developers and give back to the developer community at the same time.
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove `_log` method. Use `_debug` [#862](https://github.com/motdotla/dotenv/pull/862)
|
||||
|
||||
## [16.4.7](https://github.com/motdotla/dotenv/compare/v16.4.6...v16.4.7) (2024-12-03)
|
||||
|
||||
### Changed
|
||||
|
||||
- Ignore `.tap` folder when publishing. (oops, sorry about that everyone. - @motdotla) [#848](https://github.com/motdotla/dotenv/pull/848)
|
||||
|
||||
## [16.4.6](https://github.com/motdotla/dotenv/compare/v16.4.5...v16.4.6) (2024-12-02)
|
||||
|
||||
### Changed
|
||||
|
||||
- Clean up stale dev dependencies [#847](https://github.com/motdotla/dotenv/pull/847)
|
||||
- Various README updates clarifying usage and alternative solutions using [dotenvx](https://github.com/dotenvx/dotenvx)
|
||||
|
||||
## [16.4.5](https://github.com/motdotla/dotenv/compare/v16.4.4...v16.4.5) (2024-02-19)
|
||||
|
||||
### Changed
|
||||
|
||||
- 🐞 Fix recent regression when using `path` option. return to historical behavior: do not attempt to auto find `.env` if `path` set. (regression was introduced in `16.4.3`) [#814](https://github.com/motdotla/dotenv/pull/814)
|
||||
|
||||
## [16.4.4](https://github.com/motdotla/dotenv/compare/v16.4.3...v16.4.4) (2024-02-13)
|
||||
|
||||
### Changed
|
||||
|
||||
- 🐞 Replaced chaining operator `?.` with old school `&&` (fixing node 12 failures) [#812](https://github.com/motdotla/dotenv/pull/812)
|
||||
|
||||
## [16.4.3](https://github.com/motdotla/dotenv/compare/v16.4.2...v16.4.3) (2024-02-12)
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed processing of multiple files in `options.path` [#805](https://github.com/motdotla/dotenv/pull/805)
|
||||
|
||||
## [16.4.2](https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.2) (2024-02-10)
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com)
|
||||
|
||||
## [16.4.1](https://github.com/motdotla/dotenv/compare/v16.4.0...v16.4.1) (2024-01-24)
|
||||
|
||||
- Patch support for array as `path` option [#797](https://github.com/motdotla/dotenv/pull/797)
|
||||
|
||||
## [16.4.0](https://github.com/motdotla/dotenv/compare/v16.3.2...v16.4.0) (2024-01-23)
|
||||
|
||||
- Add `error.code` to error messages around `.env.vault` decryption handling [#795](https://github.com/motdotla/dotenv/pull/795)
|
||||
- Add ability to find `.env.vault` file when filename(s) passed as an array [#784](https://github.com/motdotla/dotenv/pull/784)
|
||||
|
||||
## [16.3.2](https://github.com/motdotla/dotenv/compare/v16.3.1...v16.3.2) (2024-01-18)
|
||||
|
||||
### Added
|
||||
|
||||
- Add debug message when no encoding set [#735](https://github.com/motdotla/dotenv/pull/735)
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix output typing for `populate` [#792](https://github.com/motdotla/dotenv/pull/792)
|
||||
- Use subarray instead of slice [#793](https://github.com/motdotla/dotenv/pull/793)
|
||||
|
||||
## [16.3.1](https://github.com/motdotla/dotenv/compare/v16.3.0...v16.3.1) (2023-06-17)
|
||||
|
||||
### Added
|
||||
|
||||
- Add missing type definitions for `processEnv` and `DOTENV_KEY` options. [#756](https://github.com/motdotla/dotenv/pull/756)
|
||||
|
||||
## [16.3.0](https://github.com/motdotla/dotenv/compare/v16.2.0...v16.3.0) (2023-06-16)
|
||||
|
||||
### Added
|
||||
|
||||
- Optionally pass `DOTENV_KEY` to options rather than relying on `process.env.DOTENV_KEY`. Defaults to `process.env.DOTENV_KEY` [#754](https://github.com/motdotla/dotenv/pull/754)
|
||||
|
||||
## [16.2.0](https://github.com/motdotla/dotenv/compare/v16.1.4...v16.2.0) (2023-06-15)
|
||||
|
||||
### Added
|
||||
|
||||
- Optionally write to your own target object rather than `process.env`. Defaults to `process.env`. [#753](https://github.com/motdotla/dotenv/pull/753)
|
||||
- Add import type URL to types file [#751](https://github.com/motdotla/dotenv/pull/751)
|
||||
|
||||
## [16.1.4](https://github.com/motdotla/dotenv/compare/v16.1.3...v16.1.4) (2023-06-04)
|
||||
|
||||
### Added
|
||||
|
||||
- Added `.github/` to `.npmignore` [#747](https://github.com/motdotla/dotenv/pull/747)
|
||||
|
||||
## [16.1.3](https://github.com/motdotla/dotenv/compare/v16.1.2...v16.1.3) (2023-05-31)
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed `browser` keys for `path`, `os`, and `crypto` in package.json. These were set to false incorrectly as of 16.1. Instead, if using dotenv on the front-end make sure to include polyfills for `path`, `os`, and `crypto`. [node-polyfill-webpack-plugin](https://github.com/Richienb/node-polyfill-webpack-plugin) provides these.
|
||||
|
||||
## [16.1.2](https://github.com/motdotla/dotenv/compare/v16.1.1...v16.1.2) (2023-05-31)
|
||||
|
||||
### Changed
|
||||
|
||||
- Exposed private function `_configDotenv` as `configDotenv`. [#744](https://github.com/motdotla/dotenv/pull/744)
|
||||
|
||||
## [16.1.1](https://github.com/motdotla/dotenv/compare/v16.1.0...v16.1.1) (2023-05-30)
|
||||
|
||||
### Added
|
||||
|
||||
- Added type definition for `decrypt` function
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed `{crypto: false}` in `packageJson.browser`
|
||||
|
||||
## [16.1.0](https://github.com/motdotla/dotenv/compare/v16.0.3...v16.1.0) (2023-05-30)
|
||||
|
||||
### Added
|
||||
|
||||
- Add `populate` convenience method [#733](https://github.com/motdotla/dotenv/pull/733)
|
||||
- Accept URL as path option [#720](https://github.com/motdotla/dotenv/pull/720)
|
||||
- Add dotenv to `npm fund` command
|
||||
- Spanish language README [#698](https://github.com/motdotla/dotenv/pull/698)
|
||||
- Add `.env.vault` support. 🎉 ([#730](https://github.com/motdotla/dotenv/pull/730))
|
||||
|
||||
ℹ️ `.env.vault` extends the `.env` file format standard with a localized encrypted vault file. Package it securely with your production code deploys. It's cloud agnostic so that you can deploy your secrets anywhere – without [risky third-party integrations](https://techcrunch.com/2023/01/05/circleci-breach/). [read more](https://github.com/motdotla/dotenv#-deploying)
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed "cannot resolve 'fs'" error on tools like Replit [#693](https://github.com/motdotla/dotenv/pull/693)
|
||||
|
||||
## [16.0.3](https://github.com/motdotla/dotenv/compare/v16.0.2...v16.0.3) (2022-09-29)
|
||||
|
||||
### Changed
|
||||
|
||||
- Added library version to debug logs ([#682](https://github.com/motdotla/dotenv/pull/682))
|
||||
|
||||
## [16.0.2](https://github.com/motdotla/dotenv/compare/v16.0.1...v16.0.2) (2022-08-30)
|
||||
|
||||
### Added
|
||||
|
||||
- Export `env-options.js` and `cli-options.js` in package.json for use with downstream [dotenv-expand](https://github.com/motdotla/dotenv-expand) module
|
||||
|
||||
## [16.0.1](https://github.com/motdotla/dotenv/compare/v16.0.0...v16.0.1) (2022-05-10)
|
||||
|
||||
### Changed
|
||||
|
||||
- Minor README clarifications
|
||||
- Development ONLY: updated devDependencies as recommended for development only security risks ([#658](https://github.com/motdotla/dotenv/pull/658))
|
||||
|
||||
## [16.0.0](https://github.com/motdotla/dotenv/compare/v15.0.1...v16.0.0) (2022-02-02)
|
||||
|
||||
### Added
|
||||
|
||||
- _Breaking:_ Backtick support 🎉 ([#615](https://github.com/motdotla/dotenv/pull/615))
|
||||
|
||||
If you had values containing the backtick character, please quote those values with either single or double quotes.
|
||||
|
||||
## [15.0.1](https://github.com/motdotla/dotenv/compare/v15.0.0...v15.0.1) (2022-02-02)
|
||||
|
||||
### Changed
|
||||
|
||||
- Properly parse empty single or double quoted values 🐞 ([#614](https://github.com/motdotla/dotenv/pull/614))
|
||||
|
||||
## [15.0.0](https://github.com/motdotla/dotenv/compare/v14.3.2...v15.0.0) (2022-01-31)
|
||||
|
||||
`v15.0.0` is a major new release with some important breaking changes.
|
||||
|
||||
### Added
|
||||
|
||||
- _Breaking:_ Multiline parsing support (just works. no need for the flag.)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ `#` marks the beginning of a comment (UNLESS the value is wrapped in quotes. Please update your `.env` files to wrap in quotes any values containing `#`. For example: `SECRET_HASH="something-with-a-#-hash"`).
|
||||
|
||||
..Understandably, (as some teams have noted) this is tedious to do across the entire team. To make it less tedious, we recommend using [dotenv cli](https://github.com/dotenv-org/cli) going forward. It's an optional plugin that will keep your `.env` files in sync between machines, environments, or team members.
|
||||
|
||||
### Removed
|
||||
|
||||
- _Breaking:_ Remove multiline option (just works out of the box now. no need for the flag.)
|
||||
|
||||
## [14.3.2](https://github.com/motdotla/dotenv/compare/v14.3.1...v14.3.2) (2022-01-25)
|
||||
|
||||
### Changed
|
||||
|
||||
- Preserve backwards compatibility on values containing `#` 🐞 ([#603](https://github.com/motdotla/dotenv/pull/603))
|
||||
|
||||
## [14.3.1](https://github.com/motdotla/dotenv/compare/v14.3.0...v14.3.1) (2022-01-25)
|
||||
|
||||
### Changed
|
||||
|
||||
- Preserve backwards compatibility on exports by re-introducing the prior in-place exports 🐞 ([#606](https://github.com/motdotla/dotenv/pull/606))
|
||||
|
||||
## [14.3.0](https://github.com/motdotla/dotenv/compare/v14.2.0...v14.3.0) (2022-01-24)
|
||||
|
||||
### Added
|
||||
|
||||
- Add `multiline` option 🎉 ([#486](https://github.com/motdotla/dotenv/pull/486))
|
||||
|
||||
## [14.2.0](https://github.com/motdotla/dotenv/compare/v14.1.1...v14.2.0) (2022-01-17)
|
||||
|
||||
### Added
|
||||
|
||||
- Add `dotenv_config_override` cli option
|
||||
- Add `DOTENV_CONFIG_OVERRIDE` command line env option
|
||||
|
||||
## [14.1.1](https://github.com/motdotla/dotenv/compare/v14.1.0...v14.1.1) (2022-01-17)
|
||||
|
||||
### Added
|
||||
|
||||
- Add React gotcha to FAQ on README
|
||||
|
||||
## [14.1.0](https://github.com/motdotla/dotenv/compare/v14.0.1...v14.1.0) (2022-01-17)
|
||||
|
||||
### Added
|
||||
|
||||
- Add `override` option 🎉 ([#595](https://github.com/motdotla/dotenv/pull/595))
|
||||
|
||||
## [14.0.1](https://github.com/motdotla/dotenv/compare/v14.0.0...v14.0.1) (2022-01-16)
|
||||
|
||||
### Added
|
||||
|
||||
- Log error on failure to load `.env` file ([#594](https://github.com/motdotla/dotenv/pull/594))
|
||||
|
||||
## [14.0.0](https://github.com/motdotla/dotenv/compare/v13.0.1...v14.0.0) (2022-01-16)
|
||||
|
||||
### Added
|
||||
|
||||
- _Breaking:_ Support inline comments for the parser 🎉 ([#568](https://github.com/motdotla/dotenv/pull/568))
|
||||
|
||||
## [13.0.1](https://github.com/motdotla/dotenv/compare/v13.0.0...v13.0.1) (2022-01-16)
|
||||
|
||||
### Changed
|
||||
|
||||
* Hide comments and newlines from debug output ([#404](https://github.com/motdotla/dotenv/pull/404))
|
||||
|
||||
## [13.0.0](https://github.com/motdotla/dotenv/compare/v12.0.4...v13.0.0) (2022-01-16)
|
||||
|
||||
### Added
|
||||
|
||||
* _Breaking:_ Add type file for `config.js` ([#539](https://github.com/motdotla/dotenv/pull/539))
|
||||
|
||||
## [12.0.4](https://github.com/motdotla/dotenv/compare/v12.0.3...v12.0.4) (2022-01-16)
|
||||
|
||||
### Changed
|
||||
|
||||
* README updates
|
||||
* Minor order adjustment to package json format
|
||||
|
||||
## [12.0.3](https://github.com/motdotla/dotenv/compare/v12.0.2...v12.0.3) (2022-01-15)
|
||||
|
||||
### Changed
|
||||
|
||||
* Simplified jsdoc for consistency across editors
|
||||
|
||||
## [12.0.2](https://github.com/motdotla/dotenv/compare/v12.0.1...v12.0.2) (2022-01-15)
|
||||
|
||||
### Changed
|
||||
|
||||
* Improve embedded jsdoc type documentation
|
||||
|
||||
## [12.0.1](https://github.com/motdotla/dotenv/compare/v12.0.0...v12.0.1) (2022-01-15)
|
||||
|
||||
### Changed
|
||||
|
||||
* README updates and clarifications
|
||||
|
||||
## [12.0.0](https://github.com/motdotla/dotenv/compare/v11.0.0...v12.0.0) (2022-01-15)
|
||||
|
||||
### Removed
|
||||
|
||||
- _Breaking:_ drop support for Flow static type checker ([#584](https://github.com/motdotla/dotenv/pull/584))
|
||||
|
||||
### Changed
|
||||
|
||||
- Move types/index.d.ts to lib/main.d.ts ([#585](https://github.com/motdotla/dotenv/pull/585))
|
||||
- Typescript cleanup ([#587](https://github.com/motdotla/dotenv/pull/587))
|
||||
- Explicit typescript inclusion in package.json ([#566](https://github.com/motdotla/dotenv/pull/566))
|
||||
|
||||
## [11.0.0](https://github.com/motdotla/dotenv/compare/v10.0.0...v11.0.0) (2022-01-11)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v10 ([#558](https://github.com/motdotla/dotenv/pull/558))
|
||||
- Patch debug option ([#550](https://github.com/motdotla/dotenv/pull/550))
|
||||
|
||||
## [10.0.0](https://github.com/motdotla/dotenv/compare/v9.0.2...v10.0.0) (2021-05-20)
|
||||
|
||||
### Added
|
||||
|
||||
- Add generic support to parse function
|
||||
- Allow for import "dotenv/config.js"
|
||||
- Add support to resolve home directory in path via ~
|
||||
|
||||
## [9.0.2](https://github.com/motdotla/dotenv/compare/v9.0.1...v9.0.2) (2021-05-10)
|
||||
|
||||
### Changed
|
||||
|
||||
- Support windows newlines with debug mode
|
||||
|
||||
## [9.0.1](https://github.com/motdotla/dotenv/compare/v9.0.0...v9.0.1) (2021-05-08)
|
||||
|
||||
### Changed
|
||||
|
||||
- Updates to README
|
||||
|
||||
## [9.0.0](https://github.com/motdotla/dotenv/compare/v8.6.0...v9.0.0) (2021-05-05)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v8
|
||||
|
||||
## [8.6.0](https://github.com/motdotla/dotenv/compare/v8.5.1...v8.6.0) (2021-05-05)
|
||||
|
||||
### Added
|
||||
|
||||
- define package.json in exports
|
||||
|
||||
## [8.5.1](https://github.com/motdotla/dotenv/compare/v8.5.0...v8.5.1) (2021-05-05)
|
||||
|
||||
### Changed
|
||||
|
||||
- updated dev dependencies via npm audit
|
||||
|
||||
## [8.5.0](https://github.com/motdotla/dotenv/compare/v8.4.0...v8.5.0) (2021-05-05)
|
||||
|
||||
### Added
|
||||
|
||||
- allow for `import "dotenv/config"`
|
||||
|
||||
## [8.4.0](https://github.com/motdotla/dotenv/compare/v8.3.0...v8.4.0) (2021-05-05)
|
||||
|
||||
### Changed
|
||||
|
||||
- point to exact types file to work with VS Code
|
||||
|
||||
## [8.3.0](https://github.com/motdotla/dotenv/compare/v8.2.0...v8.3.0) (2021-05-05)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v8 (mistake to be released as minor bump. later bumped to 9.0.0. see above.)
|
||||
|
||||
## [8.2.0](https://github.com/motdotla/dotenv/compare/v8.1.0...v8.2.0) (2019-10-16)
|
||||
|
||||
### Added
|
||||
|
||||
- TypeScript types
|
||||
|
||||
## [8.1.0](https://github.com/motdotla/dotenv/compare/v8.0.0...v8.1.0) (2019-08-18)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v6 ([#392](https://github.com/motdotla/dotenv/issues/392))
|
||||
|
||||
# [8.0.0](https://github.com/motdotla/dotenv/compare/v7.0.0...v8.0.0) (2019-05-02)
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v6 ([#302](https://github.com/motdotla/dotenv/issues/392))
|
||||
|
||||
## [7.0.0] - 2019-03-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix removing unbalanced quotes ([#376](https://github.com/motdotla/dotenv/pull/376))
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed `load` alias for `config` for consistency throughout code and documentation.
|
||||
|
||||
## [6.2.0] - 2018-12-03
|
||||
|
||||
### Added
|
||||
|
||||
- Support preload configuration via environment variables ([#351](https://github.com/motdotla/dotenv/issues/351))
|
||||
|
||||
## [6.1.0] - 2018-10-08
|
||||
|
||||
### Added
|
||||
|
||||
- `debug` option for `config` and `parse` methods will turn on logging
|
||||
|
||||
## [6.0.0] - 2018-06-02
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking:_ drop support for Node v4 ([#304](https://github.com/motdotla/dotenv/pull/304))
|
||||
|
||||
## [5.0.0] - 2018-01-29
|
||||
|
||||
### Added
|
||||
|
||||
- Testing against Node v8 and v9
|
||||
- Documentation on trim behavior of values
|
||||
- Documentation on how to use with `import`
|
||||
|
||||
### Changed
|
||||
|
||||
- _Breaking_: default `path` is now `path.resolve(process.cwd(), '.env')`
|
||||
- _Breaking_: does not write over keys already in `process.env` if the key has a falsy value
|
||||
- using `const` and `let` instead of `var`
|
||||
|
||||
### Removed
|
||||
|
||||
- Testing against Node v7
|
||||
|
||||
## [4.0.0] - 2016-12-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Return Object with parsed content or error instead of false ([#165](https://github.com/motdotla/dotenv/pull/165)).
|
||||
|
||||
### Removed
|
||||
|
||||
- `verbose` option removed in favor of returning result.
|
||||
|
||||
## [3.0.0] - 2016-12-20
|
||||
|
||||
### Added
|
||||
|
||||
- `verbose` option will log any error messages. Off by default.
|
||||
- parses email addresses correctly
|
||||
- allow importing config method directly in ES6
|
||||
|
||||
### Changed
|
||||
|
||||
- Suppress error messages by default ([#154](https://github.com/motdotla/dotenv/pull/154))
|
||||
- Ignoring more files for NPM to make package download smaller
|
||||
|
||||
### Fixed
|
||||
|
||||
- False positive test due to case-sensitive variable ([#124](https://github.com/motdotla/dotenv/pull/124))
|
||||
|
||||
### Removed
|
||||
|
||||
- `silent` option removed in favor of `verbose`
|
||||
|
||||
## [2.0.0] - 2016-01-20
|
||||
|
||||
### Added
|
||||
|
||||
- CHANGELOG to ["make it easier for users and contributors to see precisely what notable changes have been made between each release"](http://keepachangelog.com/). Linked to from README
|
||||
- LICENSE to be more explicit about what was defined in `package.json`. Linked to from README
|
||||
- Testing nodejs v4 on travis-ci
|
||||
- added examples of how to use dotenv in different ways
|
||||
- return parsed object on success rather than boolean true
|
||||
|
||||
### Changed
|
||||
|
||||
- README has shorter description not referencing ruby gem since we don't have or want feature parity
|
||||
|
||||
### Removed
|
||||
|
||||
- Variable expansion and escaping so environment variables are encouraged to be fully orthogonal
|
||||
|
||||
## [1.2.0] - 2015-06-20
|
||||
|
||||
### Added
|
||||
|
||||
- Preload hook to require dotenv without including it in your code
|
||||
|
||||
### Changed
|
||||
|
||||
- clarified license to be "BSD-2-Clause" in `package.json`
|
||||
|
||||
### Fixed
|
||||
|
||||
- retain spaces in string vars
|
||||
|
||||
## [1.1.0] - 2015-03-31
|
||||
|
||||
### Added
|
||||
|
||||
- Silent option to silence `console.log` when `.env` missing
|
||||
|
||||
## [1.0.0] - 2015-03-13
|
||||
|
||||
### Removed
|
||||
|
||||
- support for multiple `.env` files. should always use one `.env` file for the current environment
|
||||
|
||||
[7.0.0]: https://github.com/motdotla/dotenv/compare/v6.2.0...v7.0.0
|
||||
[6.2.0]: https://github.com/motdotla/dotenv/compare/v6.1.0...v6.2.0
|
||||
[6.1.0]: https://github.com/motdotla/dotenv/compare/v6.0.0...v6.1.0
|
||||
[6.0.0]: https://github.com/motdotla/dotenv/compare/v5.0.0...v6.0.0
|
||||
[5.0.0]: https://github.com/motdotla/dotenv/compare/v4.0.0...v5.0.0
|
||||
[4.0.0]: https://github.com/motdotla/dotenv/compare/v3.0.0...v4.0.0
|
||||
[3.0.0]: https://github.com/motdotla/dotenv/compare/v2.0.0...v3.0.0
|
||||
[2.0.0]: https://github.com/motdotla/dotenv/compare/v1.2.0...v2.0.0
|
||||
[1.2.0]: https://github.com/motdotla/dotenv/compare/v1.1.0...v1.2.0
|
||||
[1.1.0]: https://github.com/motdotla/dotenv/compare/v1.0.0...v1.1.0
|
||||
[1.0.0]: https://github.com/motdotla/dotenv/compare/v0.4.0...v1.0.0
|
||||
23
node_modules/dotenv/LICENSE
generated
vendored
Normal file
23
node_modules/dotenv/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright (c) 2015, Scott Motte
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
405
node_modules/dotenv/README-es.md
generated
vendored
Normal file
405
node_modules/dotenv/README-es.md
generated
vendored
Normal file
@@ -0,0 +1,405 @@
|
||||
<div align="center">
|
||||
🎉 announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Special thanks to [our sponsors](https://github.com/sponsors/motdotla)**
|
||||
|
||||
<a href="https://tuple.app/dotenv">
|
||||
<div>
|
||||
<img src="https://res.cloudinary.com/dotenv-org/image/upload/w_1000,ar_16:9,c_fill,g_auto,e_sharpen/v1756831704/github_repo_sponsorship_gq4hvx.png" width="600" alt="Tuple">
|
||||
</div>
|
||||
<b>Tuple, the premier screen sharing app for developers on macOS and Windows.</b>
|
||||
</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
# dotenv [](https://www.npmjs.com/package/dotenv)
|
||||
|
||||
<img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv" align="right" width="200" />
|
||||
|
||||
Dotenv es un módulo de dependencia cero que carga las variables de entorno desde un archivo `.env` en [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). El almacenamiento de la configuración del entorno separado del código está basado en la metodología [The Twelve-Factor App](http://12factor.net/config).
|
||||
|
||||
[](https://github.com/feross/standard)
|
||||
[](LICENSE)
|
||||
|
||||
## Instalación
|
||||
|
||||
```bash
|
||||
# instalación local (recomendado)
|
||||
npm install dotenv --save
|
||||
```
|
||||
|
||||
O installación con yarn? `yarn add dotenv`
|
||||
|
||||
## Uso
|
||||
|
||||
Cree un archivo `.env` en la raíz de su proyecto:
|
||||
|
||||
```dosini
|
||||
S3_BUCKET="YOURS3BUCKET"
|
||||
SECRET_KEY="YOURSECRETKEYGOESHERE"
|
||||
```
|
||||
|
||||
Tan prónto como sea posible en su aplicación, importe y configure dotenv:
|
||||
|
||||
```javascript
|
||||
require('dotenv').config()
|
||||
console.log(process.env) // elimine esto después que haya confirmado que esta funcionando
|
||||
```
|
||||
|
||||
.. o usa ES6?
|
||||
|
||||
```javascript
|
||||
import * as dotenv from 'dotenv' // vea en https://github.com/motdotla/dotenv#como-uso-dotenv-con-import
|
||||
// REVISAR LINK DE REFERENCIA DE IMPORTACIÓN
|
||||
dotenv.config()
|
||||
import express from 'express'
|
||||
```
|
||||
|
||||
Eso es todo. `process.env` ahora tiene las claves y los valores que definiste en tu archivo `.env`:
|
||||
|
||||
```javascript
|
||||
require('dotenv').config()
|
||||
|
||||
...
|
||||
|
||||
s3.getBucketCors({Bucket: process.env.S3_BUCKET}, function(err, data) {})
|
||||
```
|
||||
|
||||
### Valores multilínea
|
||||
|
||||
Si necesita variables de varias líneas, por ejemplo, claves privadas, ahora se admiten en la versión (`>= v15.0.0`) con saltos de línea:
|
||||
|
||||
```dosini
|
||||
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
Kh9NV...
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----"
|
||||
```
|
||||
|
||||
Alternativamente, puede usar comillas dobles y usar el carácter `\n`:
|
||||
|
||||
```dosini
|
||||
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nKh9NV...\n-----END RSA PRIVATE KEY-----\n"
|
||||
```
|
||||
|
||||
### Comentarios
|
||||
|
||||
Los comentarios pueden ser agregados en tu archivo o en la misma línea:
|
||||
|
||||
```dosini
|
||||
# This is a comment
|
||||
SECRET_KEY=YOURSECRETKEYGOESHERE # comment
|
||||
SECRET_HASH="something-with-a-#-hash"
|
||||
```
|
||||
|
||||
Los comentarios comienzan donde existe un `#`, entonces, si su valor contiene un `#`, enciérrelo entre comillas. Este es un cambio importante desde la versión `>= v15.0.0` en adelante.
|
||||
|
||||
### Análisis
|
||||
|
||||
El motor que analiza el contenido de su archivo que contiene variables de entorno está disponible para su uso. Este Acepta una Cadena o un Búfer y devolverá un Objeto con las claves y los valores analizados.
|
||||
|
||||
```javascript
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('BASICO=basico')
|
||||
const config = dotenv.parse(buf) // devolverá un objeto
|
||||
console.log(typeof config, config) // objeto { BASICO : 'basico' }
|
||||
```
|
||||
|
||||
### Precarga
|
||||
|
||||
Puede usar el `--require` (`-r`) [opción de línea de comando](https://nodejs.org/api/cli.html#-r---require-module) para precargar dotenv. Al hacer esto, no necesita requerir ni cargar dotnev en el código de su aplicación.
|
||||
|
||||
```bash
|
||||
$ node -r dotenv/config tu_script.js
|
||||
```
|
||||
|
||||
Las opciones de configuración a continuación se admiten como argumentos de línea de comandos en el formato `dotenv_config_<option>=value`
|
||||
|
||||
```bash
|
||||
$ node -r dotenv/config tu_script.js dotenv_config_path=/custom/path/to/.env dotenv_config_debug=true
|
||||
```
|
||||
|
||||
Además, puede usar variables de entorno para establecer opciones de configuración. Los argumentos de línea de comandos precederán a estos.
|
||||
|
||||
```bash
|
||||
$ DOTENV_CONFIG_<OPTION>=value node -r dotenv/config tu_script.js
|
||||
```
|
||||
|
||||
```bash
|
||||
$ DOTENV_CONFIG_ENCODING=latin1 DOTENV_CONFIG_DEBUG=true node -r dotenv/config tu_script.js dotenv_config_path=/custom/path/to/.env
|
||||
```
|
||||
|
||||
### Expansión Variable
|
||||
|
||||
Necesitaras agregar el valor de otro variable en una de sus variables? Usa [dotenv-expand](https://github.com/motdotla/dotenv-expand).
|
||||
|
||||
## Ejemplos
|
||||
|
||||
Vea [ejemplos](https://github.com/dotenv-org/examples) sobre el uso de dotenv con varios frameworks, lenguajes y configuraciones.
|
||||
|
||||
* [nodejs](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs)
|
||||
* [nodejs (depurar en)](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs-debug)
|
||||
* [nodejs (anular en)](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs-override)
|
||||
* [esm](https://github.com/dotenv-org/examples/tree/master/dotenv-esm)
|
||||
* [esm (precarga)](https://github.com/dotenv-org/examples/tree/master/dotenv-esm-preload)
|
||||
* [typescript](https://github.com/dotenv-org/examples/tree/master/dotenv-typescript)
|
||||
* [typescript parse](https://github.com/dotenv-org/examples/tree/master/dotenv-typescript-parse)
|
||||
* [typescript config](https://github.com/dotenv-org/examples/tree/master/dotenv-typescript-config)
|
||||
* [webpack](https://github.com/dotenv-org/examples/tree/master/dotenv-webpack)
|
||||
* [webpack (plugin)](https://github.com/dotenv-org/examples/tree/master/dotenv-webpack2)
|
||||
* [react](https://github.com/dotenv-org/examples/tree/master/dotenv-react)
|
||||
* [react (typescript)](https://github.com/dotenv-org/examples/tree/master/dotenv-react-typescript)
|
||||
* [express](https://github.com/dotenv-org/examples/tree/master/dotenv-express)
|
||||
* [nestjs](https://github.com/dotenv-org/examples/tree/master/dotenv-nestjs)
|
||||
|
||||
## Documentación
|
||||
|
||||
Dotenv expone dos funciones:
|
||||
|
||||
* `configuración`
|
||||
* `analizar`
|
||||
|
||||
### Configuración
|
||||
|
||||
`Configuración` leerá su archivo `.env`, analizará el contenido, lo asignará a [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env),
|
||||
y devolverá un Objeto con una clave `parsed` que contiene el contenido cargado o una clave `error` si falla.
|
||||
|
||||
```js
|
||||
const result = dotenv.config()
|
||||
|
||||
if (result.error) {
|
||||
throw result.error
|
||||
}
|
||||
|
||||
console.log(result.parsed)
|
||||
```
|
||||
|
||||
Adicionalmente, puede pasar opciones a `configuracion`.
|
||||
|
||||
#### Opciones
|
||||
|
||||
##### Ruta
|
||||
|
||||
Por defecto: `path.resolve(process.cwd(), '.env')`
|
||||
|
||||
Especifique una ruta personalizada si el archivo que contiene las variables de entorno se encuentra localizado en otro lugar.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ path: '/personalizado/ruta/a/.env' })
|
||||
```
|
||||
|
||||
##### Codificación
|
||||
|
||||
Por defecto: `utf8`
|
||||
|
||||
Especifique la codificación del archivo que contiene las variables de entorno.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ encoding: 'latin1' })
|
||||
```
|
||||
|
||||
##### Depurar
|
||||
|
||||
Por defecto: `false`
|
||||
|
||||
Active el registro de ayuda para depurar por qué ciertas claves o valores no se inician como lo esperabas.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ debug: process.env.DEBUG })
|
||||
```
|
||||
|
||||
##### Anular
|
||||
|
||||
Por defecto: `false`
|
||||
|
||||
Anule cualquier variable de entorno que ya se haya configurada en su maquina con los valores de su archivo .env.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ override: true })
|
||||
```
|
||||
|
||||
### Analizar
|
||||
|
||||
El motor que analiza el contenido del archivo que contiene las variables de entorno está disponible para su uso. Acepta una Cadena o un Búfer y retornará un objecto con los valores analizados.
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('BASICO=basico')
|
||||
const config = dotenv.parse(buf) // devolverá un objeto
|
||||
console.log(typeof config, config) // objeto { BASICO : 'basico' }
|
||||
```
|
||||
|
||||
#### Opciones
|
||||
|
||||
##### Depurar
|
||||
|
||||
Por defecto: `false`
|
||||
|
||||
Active el registro de ayuda para depurar por qué ciertas claves o valores no se inician como lo esperabas.
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('hola mundo')
|
||||
const opt = { debug: true }
|
||||
const config = dotenv.parse(buf, opt)
|
||||
// espere por un mensaje de depuración porque el búfer no esta listo KEY=VAL
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### ¿Por qué el archivo `.env` no carga mis variables de entorno correctamente?
|
||||
|
||||
Lo más probable es que su archivo `.env` no esté en el lugar correcto. [Vea este stack overflow](https://stackoverflow.com/questions/42335016/dotenv-file-is-not-loading-environment-variables).
|
||||
|
||||
Active el modo de depuración y vuelva a intentarlo...
|
||||
|
||||
```js
|
||||
require('dotenv').config({ debug: true })
|
||||
```
|
||||
|
||||
Recibirá un error apropiado en su consola.
|
||||
|
||||
### ¿Debo confirmar mi archivo `.env`?
|
||||
|
||||
No. Recomendamos **enfáticamente** no enviar su archivo `.env` a la versión de control. Solo debe incluir los valores especificos del entorno, como la base de datos, contraseñas o claves API.
|
||||
|
||||
### ¿Debería tener multiples archivos `.env`?
|
||||
|
||||
No. Recomendamos **enfáticamente** no tener un archivo `.env` "principal" y un archivo `.env` de "entorno" como `.env.test`. Su configuración debe variar entre implementaciones y no debe compartir valores entre entornos.
|
||||
|
||||
> En una Aplicación de Doce Factores, las variables de entorno son controles diferenciados, cada uno totalmente independiente a otras variables de entorno. Nunca se agrupan como "entornos", sino que se gestionan de manera independiente para cada despliegue. Este es un modelo que se escala sin problemas a medida que la aplicación se expande de forma natural en más despliegues a lo largo de su vida.
|
||||
>
|
||||
> – [La Apliación de los Doce Factores](https://12factor.net/es/)
|
||||
|
||||
### ¿Qué reglas sigue el motor de análisis?
|
||||
|
||||
El motor de análisis actualmente admite las siguientes reglas:
|
||||
|
||||
- `BASICO=basico` se convierte en `{BASICO: 'basico'}`
|
||||
- las líneas vacías se saltan
|
||||
- las líneas que comienzan con `#` se tratan como comentarios
|
||||
- `#` marca el comienzo de un comentario (a menos que el valor esté entre comillas)
|
||||
- valores vacíos se convierten en cadenas vacías (`VACIO=` se convierte en `{VACIO: ''}`)
|
||||
- las comillas internas se mantienen (piensa en JSON) (`JSON={"foo": "bar"}` se convierte en `{JSON:"{\"foo\": \"bar\"}"`)
|
||||
- los espacios en blanco se eliminan de ambos extremos de los valores no citanos (aprende más en [`trim`](https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)) (`FOO= algo ` se convierte en `{FOO: 'algo'}`)
|
||||
- los valores entre comillas simples y dobles se escapan (`CITA_SIMPLE='citado'` se convierte en `{CITA_SIMPLE: "citado"}`)
|
||||
- los valores entre comillas simples y dobles mantienen los espacios en blanco en ambos extremos (`FOO=" algo "` se convierte en `{FOO: ' algo '}`)
|
||||
- los valores entre comillas dobles expanden nuevas líneas (`MULTILINEA="nueva\nlínea"` se convierte en
|
||||
|
||||
```
|
||||
{MULTILINEA: 'nueva
|
||||
línea'}
|
||||
```
|
||||
|
||||
- se admite la comilla simple invertida (`` SIGNO_ACENTO=`Esto tiene comillas 'simples' y "dobles" en su interior.` ``)
|
||||
|
||||
### ¿Qué sucede con las variables de entorno que ya estaban configuradas?
|
||||
|
||||
Por defecto, nunca modificaremos ninguna variable de entorno que ya haya sido establecida. En particular, si hay una variable en su archivo `.env` que colisiona con una que ya existe en su entorno, entonces esa variable se omitirá.
|
||||
|
||||
Si por el contrario, quieres anular `process.env` utiliza la opción `override`.
|
||||
|
||||
```javascript
|
||||
require('dotenv').config({ override: true })
|
||||
```
|
||||
|
||||
### ¿Por qué mis variables de entorno no aparecen para React?
|
||||
|
||||
Su código React se ejecuta en Webpack, donde el módulo `fs` o incluso el propio `process` global no son accesibles fuera-de-la-caja. El módulo `process.env` sólo puede ser inyectado a través de la configuración de Webpack.
|
||||
|
||||
Si estás usando [`react-scripts`](https://www.npmjs.com/package/react-scripts), el cual se distribuye a través de [`create-react-app`](https://create-react-app.dev/), tiene dotenv incorporado pero con una singularidad. Escriba sus variables de entorno con `REACT_APP_`. Vea [este stack overflow](https://stackoverflow.com/questions/42182577/is-it-possible-to-use-dotenv-in-a-react-project) para más detalles.
|
||||
|
||||
Si estás utilizando otros frameworks (por ejemplo, Next.js, Gatsby...), debes consultar su documentación para saber cómo injectar variables de entorno en el cliente.
|
||||
|
||||
### ¿Puedo personalizar/escribir plugins para dotenv?
|
||||
|
||||
Sí! `dotenv.config()` devuelve un objeto que representa el archivo `.env` analizado. Esto te da todo lo que necesitas para poder establecer valores en `process.env`. Por ejemplo:
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const variableExpansion = require('dotenv-expand')
|
||||
const miEnv = dotenv.config()
|
||||
variableExpansion(miEnv)
|
||||
```
|
||||
|
||||
### Cómo uso dotnev con `import`?
|
||||
|
||||
Simplemente..
|
||||
|
||||
```javascript
|
||||
// index.mjs (ESM)
|
||||
import * as dotenv from 'dotenv' // vea https://github.com/motdotla/dotenv#como-uso-dotenv-con-import
|
||||
dotenv.config()
|
||||
import express from 'express'
|
||||
```
|
||||
|
||||
Un poco de historia...
|
||||
|
||||
> Cuando se ejecuta un módulo que contiene una sentencia `import`, los módulos que importa serán cargados primero, y luego se ejecuta cada bloque del módulo en un recorrido en profundidad del gráfico de dependencias, evitando los ciclos al saltarse todo lo que ya se ha ejecutado.
|
||||
>
|
||||
> – [ES6 en Profundidad: Módulos](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/)
|
||||
|
||||
¿Qué significa esto en lenguaje sencillo? Significa que se podrías pensar que lo siguiente funcionaría pero no lo hará.
|
||||
|
||||
```js
|
||||
// notificarError.mjs
|
||||
import { Cliente } from 'mejor-servicio-para-notificar-error'
|
||||
|
||||
export default new Client(process.env.CLAVE_API)
|
||||
|
||||
// index.mjs
|
||||
import dotenv from 'dotenv'
|
||||
dotenv.config()
|
||||
|
||||
import notificarError from './notificarError.mjs'
|
||||
notificarError.report(new Error('ejemplo documentado'))
|
||||
```
|
||||
|
||||
`process.env.CLAVE_API` será vacio.
|
||||
|
||||
En su lugar, el código anterior debe ser escrito como...
|
||||
|
||||
```js
|
||||
// notificarError.mjs
|
||||
import { Cliente } from 'mejor-servicio-para-notificar-errores'
|
||||
|
||||
export default new Client(process.env.CLAVE_API)
|
||||
|
||||
// index.mjs
|
||||
import * as dotenv from 'dotenv'
|
||||
dotenv.config()
|
||||
|
||||
import notificarError from './notificarError.mjs'
|
||||
notificarError.report(new Error('ejemplo documentado'))
|
||||
```
|
||||
|
||||
¿Esto tiene algo de sentido? Esto es poco poco intuitivo, pero es como funciona la importación de módulos en ES6. Aquí hay un ejemplo [ejemplo práctico de esta trampa](https://github.com/dotenv-org/examples/tree/master/dotenv-es6-import-pitfall).
|
||||
|
||||
Existen dos arternativas a este planteamiento:
|
||||
|
||||
1. Precarga dotenv: `node --require dotenv/config index.js` (_Nota: no es necesario usar `import` dotenv con este método_)
|
||||
2. Cree un archivo separado que ejecutará `config` primero como se describe en [este comentario #133](https://github.com/motdotla/dotenv/issues/133#issuecomment-255298822)
|
||||
|
||||
### ¿Qué pasa con la expansión de variable?
|
||||
|
||||
Prueba [dotenv-expand](https://github.com/motdotla/dotenv-expand)
|
||||
|
||||
## Guía de contribución
|
||||
|
||||
Vea [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## REGISTRO DE CAMBIOS
|
||||
|
||||
Vea [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## ¿Quiénes utilizan dotenv?
|
||||
|
||||
[Estos módulos npm dependen de él.](https://www.npmjs.com/browse/depended/dotenv)
|
||||
|
||||
Los proyectos que lo amplían suelen utilizar la [palabra clave "dotenv" en npm](https://www.npmjs.com/search?q=keywords:dotenv).
|
||||
692
node_modules/dotenv/README.md
generated
vendored
Normal file
692
node_modules/dotenv/README.md
generated
vendored
Normal file
@@ -0,0 +1,692 @@
|
||||
<div align="center">
|
||||
🎉 announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Special thanks to [our sponsors](https://github.com/sponsors/motdotla)**
|
||||
|
||||
<a href="https://tuple.app/dotenv">
|
||||
<div>
|
||||
<img src="https://res.cloudinary.com/dotenv-org/image/upload/w_1000,ar_16:9,c_fill,g_auto,e_sharpen/v1756831704/github_repo_sponsorship_gq4hvx.png" width="600" alt="Tuple">
|
||||
</div>
|
||||
<b>Tuple, the premier screen sharing app for developers on macOS and Windows.</b>
|
||||
</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
# dotenv [](https://www.npmjs.com/package/dotenv)
|
||||
|
||||
<img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv" align="right" width="200" />
|
||||
|
||||
Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](https://12factor.net/config) methodology.
|
||||
|
||||
[](https://github.com/feross/standard)
|
||||
[](LICENSE)
|
||||
[](https://codecov.io/gh/motdotla/dotenv-expand)
|
||||
|
||||
* [🌱 Install](#-install)
|
||||
* [🏗️ Usage (.env)](#%EF%B8%8F-usage)
|
||||
* [🌴 Multiple Environments 🆕](#-manage-multiple-environments)
|
||||
* [🚀 Deploying (encryption) 🆕](#-deploying)
|
||||
* [📚 Examples](#-examples)
|
||||
* [📖 Docs](#-documentation)
|
||||
* [❓ FAQ](#-faq)
|
||||
* [⏱️ Changelog](./CHANGELOG.md)
|
||||
|
||||
## 🌱 Install
|
||||
|
||||
```bash
|
||||
npm install dotenv --save
|
||||
```
|
||||
|
||||
You can also use an npm-compatible package manager like yarn, bun or pnpm:
|
||||
|
||||
```bash
|
||||
yarn add dotenv
|
||||
```
|
||||
```bash
|
||||
bun add dotenv
|
||||
```
|
||||
```bash
|
||||
pnpm add dotenv
|
||||
```
|
||||
|
||||
## 🏗️ Usage
|
||||
|
||||
<a href="https://www.youtube.com/watch?v=YtkZR0NFd1g">
|
||||
<div align="right">
|
||||
<img src="https://img.youtube.com/vi/YtkZR0NFd1g/hqdefault.jpg" alt="how to use dotenv video tutorial" align="right" width="330" />
|
||||
<img src="https://simpleicons.vercel.app/youtube/ff0000" alt="youtube/@dotenvorg" align="right" width="24" />
|
||||
</div>
|
||||
</a>
|
||||
|
||||
Create a `.env` file in the root of your project (if using a monorepo structure like `apps/backend/app.js`, put it in the root of the folder where your `app.js` process runs):
|
||||
|
||||
```dosini
|
||||
S3_BUCKET="YOURS3BUCKET"
|
||||
SECRET_KEY="YOURSECRETKEYGOESHERE"
|
||||
```
|
||||
|
||||
As early as possible in your application, import and configure dotenv:
|
||||
|
||||
```javascript
|
||||
require('dotenv').config()
|
||||
console.log(process.env) // remove this after you've confirmed it is working
|
||||
```
|
||||
|
||||
.. [or using ES6?](#how-do-i-use-dotenv-with-import)
|
||||
|
||||
```javascript
|
||||
import 'dotenv/config'
|
||||
```
|
||||
|
||||
ES6 import if you need to set config options:
|
||||
|
||||
```javascript
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
dotenv.config({ path: '/custom/path/to/.env' })
|
||||
```
|
||||
|
||||
That's it. `process.env` now has the keys and values you defined in your `.env` file:
|
||||
|
||||
```javascript
|
||||
require('dotenv').config()
|
||||
// or import 'dotenv/config' if you're using ES6
|
||||
|
||||
...
|
||||
|
||||
s3.getBucketCors({Bucket: process.env.S3_BUCKET}, function(err, data) {})
|
||||
```
|
||||
|
||||
### Multiline values
|
||||
|
||||
If you need multiline variables, for example private keys, those are now supported (`>= v15.0.0`) with line breaks:
|
||||
|
||||
```dosini
|
||||
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
Kh9NV...
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----"
|
||||
```
|
||||
|
||||
Alternatively, you can double quote strings and use the `\n` character:
|
||||
|
||||
```dosini
|
||||
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nKh9NV...\n-----END RSA PRIVATE KEY-----\n"
|
||||
```
|
||||
|
||||
### Comments
|
||||
|
||||
Comments may be added to your file on their own line or inline:
|
||||
|
||||
```dosini
|
||||
# This is a comment
|
||||
SECRET_KEY=YOURSECRETKEYGOESHERE # comment
|
||||
SECRET_HASH="something-with-a-#-hash"
|
||||
```
|
||||
|
||||
Comments begin where a `#` exists, so if your value contains a `#` please wrap it in quotes. This is a breaking change from `>= v15.0.0` and on.
|
||||
|
||||
### Parsing
|
||||
|
||||
The engine which parses the contents of your file containing environment variables is available to use. It accepts a String or Buffer and will return an Object with the parsed keys and values.
|
||||
|
||||
```javascript
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('BASIC=basic')
|
||||
const config = dotenv.parse(buf) // will return an object
|
||||
console.log(typeof config, config) // object { BASIC : 'basic' }
|
||||
```
|
||||
|
||||
### Preload
|
||||
|
||||
> Note: Consider using [`dotenvx`](https://github.com/dotenvx/dotenvx) instead of preloading. I am now doing (and recommending) so.
|
||||
>
|
||||
> It serves the same purpose (you do not need to require and load dotenv), adds better debugging, and works with ANY language, framework, or platform. – [motdotla](https://github.com/motdotla)
|
||||
|
||||
You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#-r---require-module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code.
|
||||
|
||||
```bash
|
||||
$ node -r dotenv/config your_script.js
|
||||
```
|
||||
|
||||
The configuration options below are supported as command line arguments in the format `dotenv_config_<option>=value`
|
||||
|
||||
```bash
|
||||
$ node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env dotenv_config_debug=true
|
||||
```
|
||||
|
||||
Additionally, you can use environment variables to set configuration options. Command line arguments will precede these.
|
||||
|
||||
```bash
|
||||
$ DOTENV_CONFIG_<OPTION>=value node -r dotenv/config your_script.js
|
||||
```
|
||||
|
||||
```bash
|
||||
$ DOTENV_CONFIG_ENCODING=latin1 DOTENV_CONFIG_DEBUG=true node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env
|
||||
```
|
||||
|
||||
### Variable Expansion
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx) to use variable expansion.
|
||||
|
||||
Reference and expand variables already on your machine for use in your .env file.
|
||||
|
||||
```ini
|
||||
# .env
|
||||
USERNAME="username"
|
||||
DATABASE_URL="postgres://${USERNAME}@localhost/my_database"
|
||||
```
|
||||
```js
|
||||
// index.js
|
||||
console.log('DATABASE_URL', process.env.DATABASE_URL)
|
||||
```
|
||||
```sh
|
||||
$ dotenvx run --debug -- node index.js
|
||||
[dotenvx@0.14.1] injecting env (2) from .env
|
||||
DATABASE_URL postgres://username@localhost/my_database
|
||||
```
|
||||
|
||||
### Command Substitution
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx) to use command substitution.
|
||||
|
||||
Add the output of a command to one of your variables in your .env file.
|
||||
|
||||
```ini
|
||||
# .env
|
||||
DATABASE_URL="postgres://$(whoami)@localhost/my_database"
|
||||
```
|
||||
```js
|
||||
// index.js
|
||||
console.log('DATABASE_URL', process.env.DATABASE_URL)
|
||||
```
|
||||
```sh
|
||||
$ dotenvx run --debug -- node index.js
|
||||
[dotenvx@0.14.1] injecting env (1) from .env
|
||||
DATABASE_URL postgres://yourusername@localhost/my_database
|
||||
```
|
||||
|
||||
### Syncing
|
||||
|
||||
You need to keep `.env` files in sync between machines, environments, or team members? Use [dotenvx](https://github.com/dotenvx/dotenvx) to encrypt your `.env` files and safely include them in source control. This still subscribes to the twelve-factor app rules by generating a decryption key separate from code.
|
||||
|
||||
### Multiple Environments
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx) to generate `.env.ci`, `.env.production` files, and more.
|
||||
|
||||
### Deploying
|
||||
|
||||
You need to deploy your secrets in a cloud-agnostic manner? Use [dotenvx](https://github.com/dotenvx/dotenvx) to generate a private decryption key that is set on your production server.
|
||||
|
||||
## 🌴 Manage Multiple Environments
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx)
|
||||
|
||||
Run any environment locally. Create a `.env.ENVIRONMENT` file and use `--env-file` to load it. It's straightforward, yet flexible.
|
||||
|
||||
```bash
|
||||
$ echo "HELLO=production" > .env.production
|
||||
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
||||
|
||||
$ dotenvx run --env-file=.env.production -- node index.js
|
||||
Hello production
|
||||
> ^^
|
||||
```
|
||||
|
||||
or with multiple .env files
|
||||
|
||||
```bash
|
||||
$ echo "HELLO=local" > .env.local
|
||||
$ echo "HELLO=World" > .env
|
||||
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
||||
|
||||
$ dotenvx run --env-file=.env.local --env-file=.env -- node index.js
|
||||
Hello local
|
||||
```
|
||||
|
||||
[more environment examples](https://dotenvx.com/docs/quickstart/environments)
|
||||
|
||||
## 🚀 Deploying
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx).
|
||||
|
||||
Add encryption to your `.env` files with a single command. Pass the `--encrypt` flag.
|
||||
|
||||
```
|
||||
$ dotenvx set HELLO Production --encrypt -f .env.production
|
||||
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
||||
|
||||
$ DOTENV_PRIVATE_KEY_PRODUCTION="<.env.production private key>" dotenvx run -- node index.js
|
||||
[dotenvx] injecting env (2) from .env.production
|
||||
Hello Production
|
||||
```
|
||||
|
||||
[learn more](https://github.com/dotenvx/dotenvx?tab=readme-ov-file#encryption)
|
||||
|
||||
## 📚 Examples
|
||||
|
||||
See [examples](https://github.com/dotenv-org/examples) of using dotenv with various frameworks, languages, and configurations.
|
||||
|
||||
* [nodejs](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs)
|
||||
* [nodejs (debug on)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs-debug)
|
||||
* [nodejs (override on)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nodejs-override)
|
||||
* [nodejs (processEnv override)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-custom-target)
|
||||
* [esm](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-esm)
|
||||
* [esm (preload)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-esm-preload)
|
||||
* [typescript](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript)
|
||||
* [typescript parse](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript-parse)
|
||||
* [typescript config](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-typescript-config)
|
||||
* [webpack](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-webpack)
|
||||
* [webpack (plugin)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-webpack2)
|
||||
* [react](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-react)
|
||||
* [react (typescript)](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-react-typescript)
|
||||
* [express](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-express)
|
||||
* [nestjs](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-nestjs)
|
||||
* [fastify](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-fastify)
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
Dotenv exposes four functions:
|
||||
|
||||
* `config`
|
||||
* `parse`
|
||||
* `populate`
|
||||
|
||||
### Config
|
||||
|
||||
`config` will read your `.env` file, parse the contents, assign it to
|
||||
[`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env),
|
||||
and return an Object with a `parsed` key containing the loaded content or an `error` key if it failed.
|
||||
|
||||
```js
|
||||
const result = dotenv.config()
|
||||
|
||||
if (result.error) {
|
||||
throw result.error
|
||||
}
|
||||
|
||||
console.log(result.parsed)
|
||||
```
|
||||
|
||||
You can additionally, pass options to `config`.
|
||||
|
||||
#### Options
|
||||
|
||||
##### path
|
||||
|
||||
Default: `path.resolve(process.cwd(), '.env')`
|
||||
|
||||
Specify a custom path if your file containing environment variables is located elsewhere.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ path: '/custom/path/to/.env' })
|
||||
```
|
||||
|
||||
By default, `config` will look for a file called .env in the current working directory.
|
||||
|
||||
Pass in multiple files as an array, and they will be parsed in order and combined with `process.env` (or `option.processEnv`, if set). The first value set for a variable will win, unless the `options.override` flag is set, in which case the last value set will win. If a value already exists in `process.env` and the `options.override` flag is NOT set, no changes will be made to that value.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ path: ['.env.local', '.env'] })
|
||||
```
|
||||
|
||||
##### quiet
|
||||
|
||||
Default: `false`
|
||||
|
||||
Suppress runtime logging message.
|
||||
|
||||
```js
|
||||
// index.js
|
||||
require('dotenv').config({ quiet: false }) // change to true to suppress
|
||||
console.log(`Hello ${process.env.HELLO}`)
|
||||
```
|
||||
|
||||
```ini
|
||||
# .env
|
||||
.env
|
||||
```
|
||||
|
||||
```sh
|
||||
$ node index.js
|
||||
[dotenv@17.0.0] injecting env (1) from .env
|
||||
Hello World
|
||||
```
|
||||
|
||||
##### encoding
|
||||
|
||||
Default: `utf8`
|
||||
|
||||
Specify the encoding of your file containing environment variables.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ encoding: 'latin1' })
|
||||
```
|
||||
|
||||
##### debug
|
||||
|
||||
Default: `false`
|
||||
|
||||
Turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ debug: process.env.DEBUG })
|
||||
```
|
||||
|
||||
##### override
|
||||
|
||||
Default: `false`
|
||||
|
||||
Override any environment variables that have already been set on your machine with values from your .env file(s). If multiple files have been provided in `option.path` the override will also be used as each file is combined with the next. Without `override` being set, the first value wins. With `override` set the last value wins.
|
||||
|
||||
```js
|
||||
require('dotenv').config({ override: true })
|
||||
```
|
||||
|
||||
##### processEnv
|
||||
|
||||
Default: `process.env`
|
||||
|
||||
Specify an object to write your environment variables to. Defaults to `process.env` environment variables.
|
||||
|
||||
```js
|
||||
const myObject = {}
|
||||
require('dotenv').config({ processEnv: myObject })
|
||||
|
||||
console.log(myObject) // values from .env
|
||||
console.log(process.env) // this was not changed or written to
|
||||
```
|
||||
|
||||
### Parse
|
||||
|
||||
The engine which parses the contents of your file containing environment
|
||||
variables is available to use. It accepts a String or Buffer and will return
|
||||
an Object with the parsed keys and values.
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('BASIC=basic')
|
||||
const config = dotenv.parse(buf) // will return an object
|
||||
console.log(typeof config, config) // object { BASIC : 'basic' }
|
||||
```
|
||||
|
||||
#### Options
|
||||
|
||||
##### debug
|
||||
|
||||
Default: `false`
|
||||
|
||||
Turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const buf = Buffer.from('hello world')
|
||||
const opt = { debug: true }
|
||||
const config = dotenv.parse(buf, opt)
|
||||
// expect a debug message because the buffer is not in KEY=VAL form
|
||||
```
|
||||
|
||||
### Populate
|
||||
|
||||
The engine which populates the contents of your .env file to `process.env` is available for use. It accepts a target, a source, and options. This is useful for power users who want to supply their own objects.
|
||||
|
||||
For example, customizing the source:
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const parsed = { HELLO: 'world' }
|
||||
|
||||
dotenv.populate(process.env, parsed)
|
||||
|
||||
console.log(process.env.HELLO) // world
|
||||
```
|
||||
|
||||
For example, customizing the source AND target:
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const parsed = { HELLO: 'universe' }
|
||||
const target = { HELLO: 'world' } // empty object
|
||||
|
||||
dotenv.populate(target, parsed, { override: true, debug: true })
|
||||
|
||||
console.log(target) // { HELLO: 'universe' }
|
||||
```
|
||||
|
||||
#### options
|
||||
|
||||
##### Debug
|
||||
|
||||
Default: `false`
|
||||
|
||||
Turn on logging to help debug why certain keys or values are not being populated as you expect.
|
||||
|
||||
##### override
|
||||
|
||||
Default: `false`
|
||||
|
||||
Override any environment variables that have already been set.
|
||||
|
||||
## ❓ FAQ
|
||||
|
||||
### Why is the `.env` file not loading my environment variables successfully?
|
||||
|
||||
Most likely your `.env` file is not in the correct place. [See this stack overflow](https://stackoverflow.com/questions/42335016/dotenv-file-is-not-loading-environment-variables).
|
||||
|
||||
Turn on debug mode and try again..
|
||||
|
||||
```js
|
||||
require('dotenv').config({ debug: true })
|
||||
```
|
||||
|
||||
You will receive a helpful error outputted to your console.
|
||||
|
||||
### Should I commit my `.env` file?
|
||||
|
||||
No. We **strongly** recommend against committing your `.env` file to version
|
||||
control. It should only include environment-specific values such as database
|
||||
passwords or API keys. Your production database should have a different
|
||||
password than your development database.
|
||||
|
||||
### Should I have multiple `.env` files?
|
||||
|
||||
We recommend creating one `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file.
|
||||
|
||||
> In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.
|
||||
>
|
||||
> – [The Twelve-Factor App](http://12factor.net/config)
|
||||
|
||||
### What rules does the parsing engine follow?
|
||||
|
||||
The parsing engine currently supports the following rules:
|
||||
|
||||
- `BASIC=basic` becomes `{BASIC: 'basic'}`
|
||||
- empty lines are skipped
|
||||
- lines beginning with `#` are treated as comments
|
||||
- `#` marks the beginning of a comment (unless when the value is wrapped in quotes)
|
||||
- empty values become empty strings (`EMPTY=` becomes `{EMPTY: ''}`)
|
||||
- inner quotes are maintained (think JSON) (`JSON={"foo": "bar"}` becomes `{JSON:"{\"foo\": \"bar\"}"`)
|
||||
- whitespace is removed from both ends of unquoted values (see more on [`trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)) (`FOO= some value ` becomes `{FOO: 'some value'}`)
|
||||
- single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: "quoted"}`)
|
||||
- single and double quoted values maintain whitespace from both ends (`FOO=" some value "` becomes `{FOO: ' some value '}`)
|
||||
- double quoted values expand new lines (`MULTILINE="new\nline"` becomes
|
||||
|
||||
```
|
||||
{MULTILINE: 'new
|
||||
line'}
|
||||
```
|
||||
|
||||
- backticks are supported (`` BACKTICK_KEY=`This has 'single' and "double" quotes inside of it.` ``)
|
||||
|
||||
### What happens to environment variables that were already set?
|
||||
|
||||
By default, we will never modify any environment variables that have already been set. In particular, if there is a variable in your `.env` file which collides with one that already exists in your environment, then that variable will be skipped.
|
||||
|
||||
If instead, you want to override `process.env` use the `override` option.
|
||||
|
||||
```javascript
|
||||
require('dotenv').config({ override: true })
|
||||
```
|
||||
|
||||
### How come my environment variables are not showing up for React?
|
||||
|
||||
Your React code is run in Webpack, where the `fs` module or even the `process` global itself are not accessible out-of-the-box. `process.env` can only be injected through Webpack configuration.
|
||||
|
||||
If you are using [`react-scripts`](https://www.npmjs.com/package/react-scripts), which is distributed through [`create-react-app`](https://create-react-app.dev/), it has dotenv built in but with a quirk. Preface your environment variables with `REACT_APP_`. See [this stack overflow](https://stackoverflow.com/questions/42182577/is-it-possible-to-use-dotenv-in-a-react-project) for more details.
|
||||
|
||||
If you are using other frameworks (e.g. Next.js, Gatsby...), you need to consult their documentation for how to inject environment variables into the client.
|
||||
|
||||
### Can I customize/write plugins for dotenv?
|
||||
|
||||
Yes! `dotenv.config()` returns an object representing the parsed `.env` file. This gives you everything you need to continue setting values on `process.env`. For example:
|
||||
|
||||
```js
|
||||
const dotenv = require('dotenv')
|
||||
const variableExpansion = require('dotenv-expand')
|
||||
const myEnv = dotenv.config()
|
||||
variableExpansion(myEnv)
|
||||
```
|
||||
|
||||
### How do I use dotenv with `import`?
|
||||
|
||||
Simply..
|
||||
|
||||
```javascript
|
||||
// index.mjs (ESM)
|
||||
import 'dotenv/config' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
|
||||
import express from 'express'
|
||||
```
|
||||
|
||||
A little background..
|
||||
|
||||
> When you run a module containing an `import` declaration, the modules it imports are loaded first, then each module body is executed in a depth-first traversal of the dependency graph, avoiding cycles by skipping anything already executed.
|
||||
>
|
||||
> – [ES6 In Depth: Modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/)
|
||||
|
||||
What does this mean in plain language? It means you would think the following would work but it won't.
|
||||
|
||||
`errorReporter.mjs`:
|
||||
```js
|
||||
class Client {
|
||||
constructor (apiKey) {
|
||||
console.log('apiKey', apiKey)
|
||||
|
||||
this.apiKey = apiKey
|
||||
}
|
||||
}
|
||||
|
||||
export default new Client(process.env.API_KEY)
|
||||
```
|
||||
`index.mjs`:
|
||||
```js
|
||||
// Note: this is INCORRECT and will not work
|
||||
import * as dotenv from 'dotenv'
|
||||
dotenv.config()
|
||||
|
||||
import errorReporter from './errorReporter.mjs' // process.env.API_KEY will be blank!
|
||||
```
|
||||
|
||||
`process.env.API_KEY` will be blank.
|
||||
|
||||
Instead, `index.mjs` should be written as..
|
||||
|
||||
```js
|
||||
import 'dotenv/config'
|
||||
|
||||
import errorReporter from './errorReporter.mjs'
|
||||
```
|
||||
|
||||
Does that make sense? It's a bit unintuitive, but it is how importing of ES6 modules work. Here is a [working example of this pitfall](https://github.com/dotenv-org/examples/tree/master/usage/dotenv-es6-import-pitfall).
|
||||
|
||||
There are two alternatives to this approach:
|
||||
|
||||
1. Preload with dotenvx: `dotenvx run -- node index.js` (_Note: you do not need to `import` dotenv with this approach_)
|
||||
2. Create a separate file that will execute `config` first as outlined in [this comment on #133](https://github.com/motdotla/dotenv/issues/133#issuecomment-255298822)
|
||||
|
||||
### Why am I getting the error `Module not found: Error: Can't resolve 'crypto|os|path'`?
|
||||
|
||||
You are using dotenv on the front-end and have not included a polyfill. Webpack < 5 used to include these for you. Do the following:
|
||||
|
||||
```bash
|
||||
npm install node-polyfill-webpack-plugin
|
||||
```
|
||||
|
||||
Configure your `webpack.config.js` to something like the following.
|
||||
|
||||
```js
|
||||
require('dotenv').config()
|
||||
|
||||
const path = require('path');
|
||||
const webpack = require('webpack')
|
||||
|
||||
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: './src/index.ts',
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
plugins: [
|
||||
new NodePolyfillPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
HELLO: JSON.stringify(process.env.HELLO)
|
||||
}
|
||||
}),
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
Alternatively, just use [dotenv-webpack](https://github.com/mrsteele/dotenv-webpack) which does this and more behind the scenes for you.
|
||||
|
||||
### What about variable expansion?
|
||||
|
||||
Try [dotenv-expand](https://github.com/motdotla/dotenv-expand)
|
||||
|
||||
### What about syncing and securing .env files?
|
||||
|
||||
Use [dotenvx](https://github.com/dotenvx/dotenvx) to unlock syncing encrypted .env files over git.
|
||||
|
||||
### What if I accidentally commit my `.env` file to code?
|
||||
|
||||
Remove it, [remove git history](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository) and then install the [git pre-commit hook](https://github.com/dotenvx/dotenvx#pre-commit) to prevent this from ever happening again.
|
||||
|
||||
```
|
||||
brew install dotenvx/brew/dotenvx
|
||||
dotenvx precommit --install
|
||||
```
|
||||
|
||||
### How can I prevent committing my `.env` file to a Docker build?
|
||||
|
||||
Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild).
|
||||
|
||||
```bash
|
||||
# Dockerfile
|
||||
...
|
||||
RUN curl -fsS https://dotenvx.sh/ | sh
|
||||
...
|
||||
RUN dotenvx prebuild
|
||||
CMD ["dotenvx", "run", "--", "node", "index.js"]
|
||||
```
|
||||
|
||||
## Contributing Guide
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## CHANGELOG
|
||||
|
||||
See [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## Who's using dotenv?
|
||||
|
||||
[These npm modules depend on it.](https://www.npmjs.com/browse/depended/dotenv)
|
||||
|
||||
Projects that expand it often use the [keyword "dotenv" on npm](https://www.npmjs.com/search?q=keywords:dotenv).
|
||||
1
node_modules/dotenv/SECURITY.md
generated
vendored
Normal file
1
node_modules/dotenv/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Please report any security vulnerabilities to security@dotenvx.com.
|
||||
1
node_modules/dotenv/config.d.ts
generated
vendored
Normal file
1
node_modules/dotenv/config.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
9
node_modules/dotenv/config.js
generated
vendored
Normal file
9
node_modules/dotenv/config.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
(function () {
|
||||
require('./lib/main').config(
|
||||
Object.assign(
|
||||
{},
|
||||
require('./lib/env-options'),
|
||||
require('./lib/cli-options')(process.argv)
|
||||
)
|
||||
)
|
||||
})()
|
||||
17
node_modules/dotenv/lib/cli-options.js
generated
vendored
Normal file
17
node_modules/dotenv/lib/cli-options.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/
|
||||
|
||||
module.exports = function optionMatcher (args) {
|
||||
const options = args.reduce(function (acc, cur) {
|
||||
const matches = cur.match(re)
|
||||
if (matches) {
|
||||
acc[matches[1]] = matches[2]
|
||||
}
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
if (!('quiet' in options)) {
|
||||
options.quiet = 'true'
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
28
node_modules/dotenv/lib/env-options.js
generated
vendored
Normal file
28
node_modules/dotenv/lib/env-options.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// ../config.js accepts options via environment variables
|
||||
const options = {}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_ENCODING != null) {
|
||||
options.encoding = process.env.DOTENV_CONFIG_ENCODING
|
||||
}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_PATH != null) {
|
||||
options.path = process.env.DOTENV_CONFIG_PATH
|
||||
}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_QUIET != null) {
|
||||
options.quiet = process.env.DOTENV_CONFIG_QUIET
|
||||
}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_DEBUG != null) {
|
||||
options.debug = process.env.DOTENV_CONFIG_DEBUG
|
||||
}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
|
||||
options.override = process.env.DOTENV_CONFIG_OVERRIDE
|
||||
}
|
||||
|
||||
if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
|
||||
options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY
|
||||
}
|
||||
|
||||
module.exports = options
|
||||
179
node_modules/dotenv/lib/main.d.ts
generated
vendored
Normal file
179
node_modules/dotenv/lib/main.d.ts
generated
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
// TypeScript Version: 3.0
|
||||
/// <reference types="node" />
|
||||
import type { URL } from 'url';
|
||||
|
||||
export interface DotenvParseOutput {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
export interface DotenvPopulateOutput {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string or buffer in the .env file format into an object.
|
||||
*
|
||||
* See https://dotenvx.com/docs
|
||||
*
|
||||
* @param src - contents to be parsed. example: `'DB_HOST=localhost'`
|
||||
* @returns an object with keys and values based on `src`. example: `{ DB_HOST : 'localhost' }`
|
||||
*/
|
||||
export function parse<T extends DotenvParseOutput = DotenvParseOutput>(
|
||||
src: string | Buffer
|
||||
): T;
|
||||
|
||||
export interface DotenvConfigOptions {
|
||||
/**
|
||||
* Default: `path.resolve(process.cwd(), '.env')`
|
||||
*
|
||||
* Specify a custom path if your file containing environment variables is located elsewhere.
|
||||
* Can also be an array of strings, specifying multiple paths.
|
||||
*
|
||||
* example: `require('dotenv').config({ path: '/custom/path/to/.env' })`
|
||||
* example: `require('dotenv').config({ path: ['/path/to/first.env', '/path/to/second.env'] })`
|
||||
*/
|
||||
path?: string | string[] | URL;
|
||||
|
||||
/**
|
||||
* Default: `utf8`
|
||||
*
|
||||
* Specify the encoding of your file containing environment variables.
|
||||
*
|
||||
* example: `require('dotenv').config({ encoding: 'latin1' })`
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* Default: `false`
|
||||
*
|
||||
* Suppress all output (except errors).
|
||||
*
|
||||
* example: `require('dotenv').config({ quiet: true })`
|
||||
*/
|
||||
quiet?: boolean;
|
||||
|
||||
/**
|
||||
* Default: `false`
|
||||
*
|
||||
* Turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
*
|
||||
* example: `require('dotenv').config({ debug: process.env.DEBUG })`
|
||||
*/
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* Default: `false`
|
||||
*
|
||||
* Override any environment variables that have already been set on your machine with values from your .env file.
|
||||
*
|
||||
* example: `require('dotenv').config({ override: true })`
|
||||
*/
|
||||
override?: boolean;
|
||||
|
||||
/**
|
||||
* Default: `process.env`
|
||||
*
|
||||
* Specify an object to write your secrets to. Defaults to process.env environment variables.
|
||||
*
|
||||
* example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })`
|
||||
*/
|
||||
processEnv?: DotenvPopulateInput;
|
||||
|
||||
/**
|
||||
* Default: `undefined`
|
||||
*
|
||||
* Pass the DOTENV_KEY directly to config options. Defaults to looking for process.env.DOTENV_KEY environment variable. Note this only applies to decrypting .env.vault files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a .env file.
|
||||
*
|
||||
* example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenvx.com/vault/.env.vault?environment=production' })`
|
||||
*/
|
||||
DOTENV_KEY?: string;
|
||||
}
|
||||
|
||||
export interface DotenvConfigOutput {
|
||||
error?: DotenvError;
|
||||
parsed?: DotenvParseOutput;
|
||||
}
|
||||
|
||||
type DotenvError = Error & {
|
||||
code:
|
||||
| 'MISSING_DATA'
|
||||
| 'INVALID_DOTENV_KEY'
|
||||
| 'NOT_FOUND_DOTENV_ENVIRONMENT'
|
||||
| 'DECRYPTION_FAILED'
|
||||
| 'OBJECT_REQUIRED';
|
||||
}
|
||||
|
||||
export interface DotenvPopulateOptions {
|
||||
/**
|
||||
* Default: `false`
|
||||
*
|
||||
* Turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
*
|
||||
* example: `require('dotenv').config({ debug: process.env.DEBUG })`
|
||||
*/
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* Default: `false`
|
||||
*
|
||||
* Override any environment variables that have already been set on your machine with values from your .env file.
|
||||
*
|
||||
* example: `require('dotenv').config({ override: true })`
|
||||
*/
|
||||
override?: boolean;
|
||||
}
|
||||
|
||||
export interface DotenvPopulateInput {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads `.env` file contents into process.env by default. If `DOTENV_KEY` is present, it smartly attempts to load encrypted `.env.vault` file contents into process.env.
|
||||
*
|
||||
* See https://dotenvx.com/docs
|
||||
*
|
||||
* @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', quiet: false, debug: true, override: false }`
|
||||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
|
||||
*
|
||||
*/
|
||||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
|
||||
|
||||
/**
|
||||
* Loads `.env` file contents into process.env.
|
||||
*
|
||||
* See https://dotenvx.com/docs
|
||||
*
|
||||
* @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', quiet: false, debug: true, override: false }`
|
||||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
|
||||
*
|
||||
*/
|
||||
export function configDotenv(options?: DotenvConfigOptions): DotenvConfigOutput;
|
||||
|
||||
/**
|
||||
* Loads `source` json contents into `target` like process.env.
|
||||
*
|
||||
* See https://dotenvx.com/docs
|
||||
*
|
||||
* @param processEnv - the target JSON object. in most cases use process.env but you can also pass your own JSON object
|
||||
* @param parsed - the source JSON object
|
||||
* @param options - additional options. example: `{ quiet: false, debug: true, override: false }`
|
||||
* @returns an object with the keys and values that were actually set
|
||||
*
|
||||
*/
|
||||
export function populate(
|
||||
processEnv: DotenvPopulateInput,
|
||||
parsed: DotenvPopulateInput,
|
||||
options?: DotenvConfigOptions
|
||||
): DotenvPopulateOutput;
|
||||
|
||||
/**
|
||||
* Decrypt ciphertext
|
||||
*
|
||||
* See https://dotenvx.com/docs
|
||||
*
|
||||
* @param encrypted - the encrypted ciphertext string
|
||||
* @param keyStr - the decryption key string
|
||||
* @returns {string}
|
||||
*
|
||||
*/
|
||||
export function decrypt(encrypted: string, keyStr: string): string;
|
||||
434
node_modules/dotenv/lib/main.js
generated
vendored
Normal file
434
node_modules/dotenv/lib/main.js
generated
vendored
Normal file
@@ -0,0 +1,434 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
const crypto = require('crypto')
|
||||
const packageJson = require('../package.json')
|
||||
|
||||
const version = packageJson.version
|
||||
|
||||
// Array of tips to display randomly
|
||||
const TIPS = [
|
||||
'🔐 encrypt with Dotenvx: https://dotenvx.com',
|
||||
'🔐 prevent committing .env to code: https://dotenvx.com/precommit',
|
||||
'🔐 prevent building .env in docker: https://dotenvx.com/prebuild',
|
||||
'📡 add observability to secrets: https://dotenvx.com/ops',
|
||||
'👥 sync secrets across teammates & machines: https://dotenvx.com/ops',
|
||||
'🗂️ backup and recover secrets: https://dotenvx.com/ops',
|
||||
'✅ audit secrets and track compliance: https://dotenvx.com/ops',
|
||||
'🔄 add secrets lifecycle management: https://dotenvx.com/ops',
|
||||
'🔑 add access controls to secrets: https://dotenvx.com/ops',
|
||||
'🛠️ run anywhere with `dotenvx run -- yourcommand`',
|
||||
'⚙️ specify custom .env file path with { path: \'/custom/path/.env\' }',
|
||||
'⚙️ enable debug logging with { debug: true }',
|
||||
'⚙️ override existing env vars with { override: true }',
|
||||
'⚙️ suppress all logs with { quiet: true }',
|
||||
'⚙️ write to custom object with { processEnv: myObject }',
|
||||
'⚙️ load multiple .env files with { path: [\'.env.local\', \'.env\'] }'
|
||||
]
|
||||
|
||||
// Get a random tip from the tips array
|
||||
function _getRandomTip () {
|
||||
return TIPS[Math.floor(Math.random() * TIPS.length)]
|
||||
}
|
||||
|
||||
function parseBoolean (value) {
|
||||
if (typeof value === 'string') {
|
||||
return !['false', '0', 'no', 'off', ''].includes(value.toLowerCase())
|
||||
}
|
||||
return Boolean(value)
|
||||
}
|
||||
|
||||
function supportsAnsi () {
|
||||
return process.stdout.isTTY // && process.env.TERM !== 'dumb'
|
||||
}
|
||||
|
||||
function dim (text) {
|
||||
return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text
|
||||
}
|
||||
|
||||
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg
|
||||
|
||||
// Parse src into an Object
|
||||
function parse (src) {
|
||||
const obj = {}
|
||||
|
||||
// Convert buffer to string
|
||||
let lines = src.toString()
|
||||
|
||||
// Convert line breaks to same format
|
||||
lines = lines.replace(/\r\n?/mg, '\n')
|
||||
|
||||
let match
|
||||
while ((match = LINE.exec(lines)) != null) {
|
||||
const key = match[1]
|
||||
|
||||
// Default undefined or null to empty string
|
||||
let value = (match[2] || '')
|
||||
|
||||
// Remove whitespace
|
||||
value = value.trim()
|
||||
|
||||
// Check if double quoted
|
||||
const maybeQuote = value[0]
|
||||
|
||||
// Remove surrounding quotes
|
||||
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2')
|
||||
|
||||
// Expand newlines if double quoted
|
||||
if (maybeQuote === '"') {
|
||||
value = value.replace(/\\n/g, '\n')
|
||||
value = value.replace(/\\r/g, '\r')
|
||||
}
|
||||
|
||||
// Add to object
|
||||
obj[key] = value
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
function _parseVault (options) {
|
||||
options = options || {}
|
||||
|
||||
const vaultPath = _vaultPath(options)
|
||||
options.path = vaultPath // parse .env.vault
|
||||
const result = DotenvModule.configDotenv(options)
|
||||
if (!result.parsed) {
|
||||
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
|
||||
err.code = 'MISSING_DATA'
|
||||
throw err
|
||||
}
|
||||
|
||||
// handle scenario for comma separated keys - for use with key rotation
|
||||
// example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
|
||||
const keys = _dotenvKey(options).split(',')
|
||||
const length = keys.length
|
||||
|
||||
let decrypted
|
||||
for (let i = 0; i < length; i++) {
|
||||
try {
|
||||
// Get full key
|
||||
const key = keys[i].trim()
|
||||
|
||||
// Get instructions for decrypt
|
||||
const attrs = _instructions(result, key)
|
||||
|
||||
// Decrypt
|
||||
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)
|
||||
|
||||
break
|
||||
} catch (error) {
|
||||
// last key
|
||||
if (i + 1 >= length) {
|
||||
throw error
|
||||
}
|
||||
// try next key
|
||||
}
|
||||
}
|
||||
|
||||
// Parse decrypted .env string
|
||||
return DotenvModule.parse(decrypted)
|
||||
}
|
||||
|
||||
function _warn (message) {
|
||||
console.error(`[dotenv@${version}][WARN] ${message}`)
|
||||
}
|
||||
|
||||
function _debug (message) {
|
||||
console.log(`[dotenv@${version}][DEBUG] ${message}`)
|
||||
}
|
||||
|
||||
function _log (message) {
|
||||
console.log(`[dotenv@${version}] ${message}`)
|
||||
}
|
||||
|
||||
function _dotenvKey (options) {
|
||||
// prioritize developer directly setting options.DOTENV_KEY
|
||||
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
||||
return options.DOTENV_KEY
|
||||
}
|
||||
|
||||
// secondary infra already contains a DOTENV_KEY environment variable
|
||||
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
||||
return process.env.DOTENV_KEY
|
||||
}
|
||||
|
||||
// fallback to empty string
|
||||
return ''
|
||||
}
|
||||
|
||||
function _instructions (result, dotenvKey) {
|
||||
// Parse DOTENV_KEY. Format is a URI
|
||||
let uri
|
||||
try {
|
||||
uri = new URL(dotenvKey)
|
||||
} catch (error) {
|
||||
if (error.code === 'ERR_INVALID_URL') {
|
||||
const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')
|
||||
err.code = 'INVALID_DOTENV_KEY'
|
||||
throw err
|
||||
}
|
||||
|
||||
throw error
|
||||
}
|
||||
|
||||
// Get decrypt key
|
||||
const key = uri.password
|
||||
if (!key) {
|
||||
const err = new Error('INVALID_DOTENV_KEY: Missing key part')
|
||||
err.code = 'INVALID_DOTENV_KEY'
|
||||
throw err
|
||||
}
|
||||
|
||||
// Get environment
|
||||
const environment = uri.searchParams.get('environment')
|
||||
if (!environment) {
|
||||
const err = new Error('INVALID_DOTENV_KEY: Missing environment part')
|
||||
err.code = 'INVALID_DOTENV_KEY'
|
||||
throw err
|
||||
}
|
||||
|
||||
// Get ciphertext payload
|
||||
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`
|
||||
const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION
|
||||
if (!ciphertext) {
|
||||
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
|
||||
err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'
|
||||
throw err
|
||||
}
|
||||
|
||||
return { ciphertext, key }
|
||||
}
|
||||
|
||||
function _vaultPath (options) {
|
||||
let possibleVaultPath = null
|
||||
|
||||
if (options && options.path && options.path.length > 0) {
|
||||
if (Array.isArray(options.path)) {
|
||||
for (const filepath of options.path) {
|
||||
if (fs.existsSync(filepath)) {
|
||||
possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`
|
||||
}
|
||||
}
|
||||
} else {
|
||||
possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`
|
||||
}
|
||||
} else {
|
||||
possibleVaultPath = path.resolve(process.cwd(), '.env.vault')
|
||||
}
|
||||
|
||||
if (fs.existsSync(possibleVaultPath)) {
|
||||
return possibleVaultPath
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function _resolveHome (envPath) {
|
||||
return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
|
||||
}
|
||||
|
||||
function _configVault (options) {
|
||||
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || (options && options.debug))
|
||||
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || (options && options.quiet))
|
||||
|
||||
if (debug || !quiet) {
|
||||
_log('Loading env from encrypted .env.vault')
|
||||
}
|
||||
|
||||
const parsed = DotenvModule._parseVault(options)
|
||||
|
||||
let processEnv = process.env
|
||||
if (options && options.processEnv != null) {
|
||||
processEnv = options.processEnv
|
||||
}
|
||||
|
||||
DotenvModule.populate(processEnv, parsed, options)
|
||||
|
||||
return { parsed }
|
||||
}
|
||||
|
||||
function configDotenv (options) {
|
||||
const dotenvPath = path.resolve(process.cwd(), '.env')
|
||||
let encoding = 'utf8'
|
||||
let processEnv = process.env
|
||||
if (options && options.processEnv != null) {
|
||||
processEnv = options.processEnv
|
||||
}
|
||||
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || (options && options.debug))
|
||||
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || (options && options.quiet))
|
||||
|
||||
if (options && options.encoding) {
|
||||
encoding = options.encoding
|
||||
} else {
|
||||
if (debug) {
|
||||
_debug('No encoding is specified. UTF-8 is used by default')
|
||||
}
|
||||
}
|
||||
|
||||
let optionPaths = [dotenvPath] // default, look for .env
|
||||
if (options && options.path) {
|
||||
if (!Array.isArray(options.path)) {
|
||||
optionPaths = [_resolveHome(options.path)]
|
||||
} else {
|
||||
optionPaths = [] // reset default
|
||||
for (const filepath of options.path) {
|
||||
optionPaths.push(_resolveHome(filepath))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build the parsed data in a temporary object (because we need to return it). Once we have the final
|
||||
// parsed data, we will combine it with process.env (or options.processEnv if provided).
|
||||
let lastError
|
||||
const parsedAll = {}
|
||||
for (const path of optionPaths) {
|
||||
try {
|
||||
// Specifying an encoding returns a string instead of a buffer
|
||||
const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))
|
||||
|
||||
DotenvModule.populate(parsedAll, parsed, options)
|
||||
} catch (e) {
|
||||
if (debug) {
|
||||
_debug(`Failed to load ${path} ${e.message}`)
|
||||
}
|
||||
lastError = e
|
||||
}
|
||||
}
|
||||
|
||||
const populated = DotenvModule.populate(processEnv, parsedAll, options)
|
||||
|
||||
// handle user settings DOTENV_CONFIG_ options inside .env file(s)
|
||||
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug)
|
||||
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet)
|
||||
|
||||
if (debug || !quiet) {
|
||||
const keysCount = Object.keys(populated).length
|
||||
const shortPaths = []
|
||||
for (const filePath of optionPaths) {
|
||||
try {
|
||||
const relative = path.relative(process.cwd(), filePath)
|
||||
shortPaths.push(relative)
|
||||
} catch (e) {
|
||||
if (debug) {
|
||||
_debug(`Failed to load ${filePath} ${e.message}`)
|
||||
}
|
||||
lastError = e
|
||||
}
|
||||
}
|
||||
|
||||
_log(`injecting env (${keysCount}) from ${shortPaths.join(',')} ${dim(`-- tip: ${_getRandomTip()}`)}`)
|
||||
}
|
||||
|
||||
if (lastError) {
|
||||
return { parsed: parsedAll, error: lastError }
|
||||
} else {
|
||||
return { parsed: parsedAll }
|
||||
}
|
||||
}
|
||||
|
||||
// Populates process.env from .env file
|
||||
function config (options) {
|
||||
// fallback to original dotenv if DOTENV_KEY is not set
|
||||
if (_dotenvKey(options).length === 0) {
|
||||
return DotenvModule.configDotenv(options)
|
||||
}
|
||||
|
||||
const vaultPath = _vaultPath(options)
|
||||
|
||||
// dotenvKey exists but .env.vault file does not exist
|
||||
if (!vaultPath) {
|
||||
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)
|
||||
|
||||
return DotenvModule.configDotenv(options)
|
||||
}
|
||||
|
||||
return DotenvModule._configVault(options)
|
||||
}
|
||||
|
||||
function decrypt (encrypted, keyStr) {
|
||||
const key = Buffer.from(keyStr.slice(-64), 'hex')
|
||||
let ciphertext = Buffer.from(encrypted, 'base64')
|
||||
|
||||
const nonce = ciphertext.subarray(0, 12)
|
||||
const authTag = ciphertext.subarray(-16)
|
||||
ciphertext = ciphertext.subarray(12, -16)
|
||||
|
||||
try {
|
||||
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
|
||||
aesgcm.setAuthTag(authTag)
|
||||
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
|
||||
} catch (error) {
|
||||
const isRange = error instanceof RangeError
|
||||
const invalidKeyLength = error.message === 'Invalid key length'
|
||||
const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'
|
||||
|
||||
if (isRange || invalidKeyLength) {
|
||||
const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')
|
||||
err.code = 'INVALID_DOTENV_KEY'
|
||||
throw err
|
||||
} else if (decryptionFailed) {
|
||||
const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')
|
||||
err.code = 'DECRYPTION_FAILED'
|
||||
throw err
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Populate process.env with parsed values
|
||||
function populate (processEnv, parsed, options = {}) {
|
||||
const debug = Boolean(options && options.debug)
|
||||
const override = Boolean(options && options.override)
|
||||
const populated = {}
|
||||
|
||||
if (typeof parsed !== 'object') {
|
||||
const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
|
||||
err.code = 'OBJECT_REQUIRED'
|
||||
throw err
|
||||
}
|
||||
|
||||
// Set process.env
|
||||
for (const key of Object.keys(parsed)) {
|
||||
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
||||
if (override === true) {
|
||||
processEnv[key] = parsed[key]
|
||||
populated[key] = parsed[key]
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
if (override === true) {
|
||||
_debug(`"${key}" is already defined and WAS overwritten`)
|
||||
} else {
|
||||
_debug(`"${key}" is already defined and was NOT overwritten`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
processEnv[key] = parsed[key]
|
||||
populated[key] = parsed[key]
|
||||
}
|
||||
}
|
||||
|
||||
return populated
|
||||
}
|
||||
|
||||
const DotenvModule = {
|
||||
configDotenv,
|
||||
_configVault,
|
||||
_parseVault,
|
||||
config,
|
||||
decrypt,
|
||||
parse,
|
||||
populate
|
||||
}
|
||||
|
||||
module.exports.configDotenv = DotenvModule.configDotenv
|
||||
module.exports._configVault = DotenvModule._configVault
|
||||
module.exports._parseVault = DotenvModule._parseVault
|
||||
module.exports.config = DotenvModule.config
|
||||
module.exports.decrypt = DotenvModule.decrypt
|
||||
module.exports.parse = DotenvModule.parse
|
||||
module.exports.populate = DotenvModule.populate
|
||||
|
||||
module.exports = DotenvModule
|
||||
62
node_modules/dotenv/package.json
generated
vendored
Normal file
62
node_modules/dotenv/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "dotenv",
|
||||
"version": "17.2.3",
|
||||
"description": "Loads environment variables from .env file",
|
||||
"main": "lib/main.js",
|
||||
"types": "lib/main.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/main.d.ts",
|
||||
"require": "./lib/main.js",
|
||||
"default": "./lib/main.js"
|
||||
},
|
||||
"./config": "./config.js",
|
||||
"./config.js": "./config.js",
|
||||
"./lib/env-options": "./lib/env-options.js",
|
||||
"./lib/env-options.js": "./lib/env-options.js",
|
||||
"./lib/cli-options": "./lib/cli-options.js",
|
||||
"./lib/cli-options.js": "./lib/cli-options.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"dts-check": "tsc --project tests/types/tsconfig.json",
|
||||
"lint": "standard",
|
||||
"pretest": "npm run lint && npm run dts-check",
|
||||
"test": "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
||||
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
||||
"prerelease": "npm test",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/motdotla/dotenv.git"
|
||||
},
|
||||
"homepage": "https://github.com/motdotla/dotenv#readme",
|
||||
"funding": "https://dotenvx.com",
|
||||
"keywords": [
|
||||
"dotenv",
|
||||
"env",
|
||||
".env",
|
||||
"environment",
|
||||
"variables",
|
||||
"config",
|
||||
"settings"
|
||||
],
|
||||
"readmeFilename": "README.md",
|
||||
"license": "BSD-2-Clause",
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.3",
|
||||
"decache": "^4.6.2",
|
||||
"sinon": "^14.0.1",
|
||||
"standard": "^17.0.0",
|
||||
"standard-version": "^9.5.0",
|
||||
"tap": "^19.2.0",
|
||||
"typescript": "^4.8.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"browser": {
|
||||
"fs": false
|
||||
}
|
||||
}
|
||||
22
node_modules/ee-first/LICENSE
generated
vendored
Normal file
22
node_modules/ee-first/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
80
node_modules/ee-first/README.md
generated
vendored
Normal file
80
node_modules/ee-first/README.md
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# EE First
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
[![Gittip][gittip-image]][gittip-url]
|
||||
|
||||
Get the first event in a set of event emitters and event pairs,
|
||||
then clean up after itself.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install ee-first
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var first = require('ee-first')
|
||||
```
|
||||
|
||||
### first(arr, listener)
|
||||
|
||||
Invoke `listener` on the first event from the list specified in `arr`. `arr` is
|
||||
an array of arrays, with each array in the format `[ee, ...event]`. `listener`
|
||||
will be called only once, the first time any of the given events are emitted. If
|
||||
`error` is one of the listened events, then if that fires first, the `listener`
|
||||
will be given the `err` argument.
|
||||
|
||||
The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the
|
||||
first argument emitted from an `error` event, if applicable; `ee` is the event
|
||||
emitter that fired; `event` is the string event name that fired; and `args` is an
|
||||
array of the arguments that were emitted on the event.
|
||||
|
||||
```js
|
||||
var ee1 = new EventEmitter()
|
||||
var ee2 = new EventEmitter()
|
||||
|
||||
first([
|
||||
[ee1, 'close', 'end', 'error'],
|
||||
[ee2, 'error']
|
||||
], function (err, ee, event, args) {
|
||||
// listener invoked
|
||||
})
|
||||
```
|
||||
|
||||
#### .cancel()
|
||||
|
||||
The group of listeners can be cancelled before being invoked and have all the event
|
||||
listeners removed from the underlying event emitters.
|
||||
|
||||
```js
|
||||
var thunk = first([
|
||||
[ee1, 'close', 'end', 'error'],
|
||||
[ee2, 'error']
|
||||
], function (err, ee, event, args) {
|
||||
// listener invoked
|
||||
})
|
||||
|
||||
// cancel and clean up
|
||||
thunk.cancel()
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square
|
||||
[npm-url]: https://npmjs.org/package/ee-first
|
||||
[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square
|
||||
[github-url]: https://github.com/jonathanong/ee-first/tags
|
||||
[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/jonathanong/ee-first
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master
|
||||
[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square
|
||||
[license-url]: LICENSE.md
|
||||
[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square
|
||||
[downloads-url]: https://npmjs.org/package/ee-first
|
||||
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
|
||||
[gittip-url]: https://www.gittip.com/jonathanong/
|
||||
95
node_modules/ee-first/index.js
generated
vendored
Normal file
95
node_modules/ee-first/index.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
/*!
|
||||
* ee-first
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = first
|
||||
|
||||
/**
|
||||
* Get the first event in a set of event emitters and event pairs.
|
||||
*
|
||||
* @param {array} stuff
|
||||
* @param {function} done
|
||||
* @public
|
||||
*/
|
||||
|
||||
function first(stuff, done) {
|
||||
if (!Array.isArray(stuff))
|
||||
throw new TypeError('arg must be an array of [ee, events...] arrays')
|
||||
|
||||
var cleanups = []
|
||||
|
||||
for (var i = 0; i < stuff.length; i++) {
|
||||
var arr = stuff[i]
|
||||
|
||||
if (!Array.isArray(arr) || arr.length < 2)
|
||||
throw new TypeError('each array member must be [ee, events...]')
|
||||
|
||||
var ee = arr[0]
|
||||
|
||||
for (var j = 1; j < arr.length; j++) {
|
||||
var event = arr[j]
|
||||
var fn = listener(event, callback)
|
||||
|
||||
// listen to the event
|
||||
ee.on(event, fn)
|
||||
// push this listener to the list of cleanups
|
||||
cleanups.push({
|
||||
ee: ee,
|
||||
event: event,
|
||||
fn: fn,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function callback() {
|
||||
cleanup()
|
||||
done.apply(null, arguments)
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
var x
|
||||
for (var i = 0; i < cleanups.length; i++) {
|
||||
x = cleanups[i]
|
||||
x.ee.removeListener(x.event, x.fn)
|
||||
}
|
||||
}
|
||||
|
||||
function thunk(fn) {
|
||||
done = fn
|
||||
}
|
||||
|
||||
thunk.cancel = cleanup
|
||||
|
||||
return thunk
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the event listener.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function listener(event, done) {
|
||||
return function onevent(arg1) {
|
||||
var args = new Array(arguments.length)
|
||||
var ee = this
|
||||
var err = event === 'error'
|
||||
? arg1
|
||||
: null
|
||||
|
||||
// copy args to prevent arguments escaping scope
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
args[i] = arguments[i]
|
||||
}
|
||||
|
||||
done(err, ee, event, args)
|
||||
}
|
||||
}
|
||||
29
node_modules/ee-first/package.json
generated
vendored
Normal file
29
node_modules/ee-first/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "ee-first",
|
||||
"description": "return the first event in a set of ee/event pairs",
|
||||
"version": "1.1.1",
|
||||
"author": {
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com",
|
||||
"twitter": "https://twitter.com/jongleberry"
|
||||
},
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "jonathanong/ee-first",
|
||||
"devDependencies": {
|
||||
"istanbul": "0.3.9",
|
||||
"mocha": "2.2.5"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||||
}
|
||||
}
|
||||
22
node_modules/encodeurl/LICENSE
generated
vendored
Normal file
22
node_modules/encodeurl/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2016 Douglas Christopher Wilson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user