diff --git a/package.json b/package.json index 53fc21d..1253c50 100644 --- a/package.json +++ b/package.json @@ -13,12 +13,12 @@ "license": "MIT", "devDependencies": { "@tsconfig/svelte": "^3.0.0", - "@types/node": "^16.11.6", - "@typescript-eslint/eslint-plugin": "^5.18.0", - "@typescript-eslint/parser": "^5.18.0", + "@types/node": "^16.11.27", + "@typescript-eslint/eslint-plugin": "^5.20.0", + "@typescript-eslint/parser": "^5.20.0", "builtin-modules": "^3.2.0", "esbuild": "0.13.12", - "esbuild-plugin-copy": "^1.2.1", + "esbuild-plugin-copy": "^1.3.0", "esbuild-svelte": "^0.7.0", "eslint": "7.12.1", "eslint-config-standard": "^16.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 275e171..ba553c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,12 +2,12 @@ lockfileVersion: 5.3 specifiers: '@tsconfig/svelte': ^3.0.0 - '@types/node': ^16.11.6 - '@typescript-eslint/eslint-plugin': ^5.18.0 - '@typescript-eslint/parser': ^5.18.0 + '@types/node': ^16.11.27 + '@typescript-eslint/eslint-plugin': ^5.20.0 + '@typescript-eslint/parser': ^5.20.0 builtin-modules: ^3.2.0 esbuild: 0.13.12 - esbuild-plugin-copy: ^1.2.1 + esbuild-plugin-copy: ^1.3.0 esbuild-svelte: ^0.7.0 eslint: 7.12.1 eslint-config-standard: ^16.0.3 @@ -29,12 +29,12 @@ dependencies: devDependencies: '@tsconfig/svelte': 3.0.0 - '@types/node': 16.11.26 - '@typescript-eslint/eslint-plugin': 5.18.0_2e93aa916703472007e9b5dfec98785b - '@typescript-eslint/parser': 5.18.0_eslint@7.12.1+typescript@4.6.3 + '@types/node': 16.11.27 + '@typescript-eslint/eslint-plugin': 5.20.0_4fbab8ed861393b891eae3bdfcc6594e + '@typescript-eslint/parser': 5.20.0_eslint@7.12.1+typescript@4.6.3 builtin-modules: 3.2.0 esbuild: 0.13.12 - esbuild-plugin-copy: 1.2.1_esbuild@0.13.12 + esbuild-plugin-copy: 1.3.0_esbuild@0.13.12 esbuild-svelte: 0.7.0_esbuild@0.13.12+svelte@3.47.0 eslint: 7.12.1 eslint-config-standard: 16.0.3_0fed5a0754053d34bf68c4e5b9539157 @@ -164,8 +164,8 @@ packages: resolution: {integrity: sha1-7ihweulOEdK4J7y+UnC86n8+ce4=} dev: true - /@types/node/16.11.26: - resolution: {integrity: sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==} + /@types/node/16.11.27: + resolution: {integrity: sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==} dev: true /@types/pug/2.0.6: @@ -175,7 +175,7 @@ packages: /@types/sass/1.43.1: resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==} dependencies: - '@types/node': 16.11.26 + '@types/node': 16.11.27 dev: true /@types/tern/0.23.4: @@ -184,8 +184,8 @@ packages: '@types/estree': 0.0.51 dev: true - /@typescript-eslint/eslint-plugin/5.18.0_2e93aa916703472007e9b5dfec98785b: - resolution: {integrity: sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A==} + /@typescript-eslint/eslint-plugin/5.20.0_4fbab8ed861393b891eae3bdfcc6594e: + resolution: {integrity: sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -195,16 +195,16 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.18.0_eslint@7.12.1+typescript@4.6.3 - '@typescript-eslint/scope-manager': 5.18.0 - '@typescript-eslint/type-utils': 5.18.0_eslint@7.12.1+typescript@4.6.3 - '@typescript-eslint/utils': 5.18.0_eslint@7.12.1+typescript@4.6.3 + '@typescript-eslint/parser': 5.20.0_eslint@7.12.1+typescript@4.6.3 + '@typescript-eslint/scope-manager': 5.20.0 + '@typescript-eslint/type-utils': 5.20.0_eslint@7.12.1+typescript@4.6.3 + '@typescript-eslint/utils': 5.20.0_eslint@7.12.1+typescript@4.6.3 debug: 4.3.4 eslint: 7.12.1 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 - semver: 7.3.5 + semver: 7.3.7 tsutils: 3.21.0_typescript@4.6.3 typescript: 4.6.3 transitivePeerDependencies: @@ -249,8 +249,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.18.0_eslint@7.12.1+typescript@4.6.3: - resolution: {integrity: sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ==} + /@typescript-eslint/parser/5.20.0_eslint@7.12.1+typescript@4.6.3: + resolution: {integrity: sha512-UWKibrCZQCYvobmu3/N8TWbEeo/EPQbS41Ux1F9XqPzGuV7pfg6n50ZrFo6hryynD8qOTTfLHtHjjdQtxJ0h/w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -259,9 +259,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.18.0 - '@typescript-eslint/types': 5.18.0 - '@typescript-eslint/typescript-estree': 5.18.0_typescript@4.6.3 + '@typescript-eslint/scope-manager': 5.20.0 + '@typescript-eslint/types': 5.20.0 + '@typescript-eslint/typescript-estree': 5.20.0_typescript@4.6.3 debug: 4.3.4 eslint: 7.12.1 typescript: 4.6.3 @@ -269,16 +269,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.18.0: - resolution: {integrity: sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ==} + /@typescript-eslint/scope-manager/5.20.0: + resolution: {integrity: sha512-h9KtuPZ4D/JuX7rpp1iKg3zOH0WNEa+ZIXwpW/KWmEFDxlA/HSfCMhiyF1HS/drTICjIbpA6OqkAhrP/zkCStg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.18.0 - '@typescript-eslint/visitor-keys': 5.18.0 + '@typescript-eslint/types': 5.20.0 + '@typescript-eslint/visitor-keys': 5.20.0 dev: true - /@typescript-eslint/type-utils/5.18.0_eslint@7.12.1+typescript@4.6.3: - resolution: {integrity: sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA==} + /@typescript-eslint/type-utils/5.20.0_eslint@7.12.1+typescript@4.6.3: + resolution: {integrity: sha512-WxNrCwYB3N/m8ceyoGCgbLmuZwupvzN0rE8NBuwnl7APgjv24ZJIjkNzoFBXPRCGzLNkoU/WfanW0exvp/+3Iw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -287,7 +287,7 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.18.0_eslint@7.12.1+typescript@4.6.3 + '@typescript-eslint/utils': 5.20.0_eslint@7.12.1+typescript@4.6.3 debug: 4.3.4 eslint: 7.12.1 tsutils: 3.21.0_typescript@4.6.3 @@ -301,8 +301,8 @@ packages: engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dev: true - /@typescript-eslint/types/5.18.0: - resolution: {integrity: sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw==} + /@typescript-eslint/types/5.20.0: + resolution: {integrity: sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -321,15 +321,15 @@ packages: glob: 7.2.0 is-glob: 4.0.3 lodash: 4.17.21 - semver: 7.3.5 + semver: 7.3.7 tsutils: 3.21.0_typescript@3.9.10 typescript: 3.9.10 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree/5.18.0_typescript@4.6.3: - resolution: {integrity: sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ==} + /@typescript-eslint/typescript-estree/5.20.0_typescript@4.6.3: + resolution: {integrity: sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -337,28 +337,28 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.18.0 - '@typescript-eslint/visitor-keys': 5.18.0 + '@typescript-eslint/types': 5.20.0 + '@typescript-eslint/visitor-keys': 5.20.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.3.5 + semver: 7.3.7 tsutils: 3.21.0_typescript@4.6.3 typescript: 4.6.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.18.0_eslint@7.12.1+typescript@4.6.3: - resolution: {integrity: sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA==} + /@typescript-eslint/utils/5.20.0_eslint@7.12.1+typescript@4.6.3: + resolution: {integrity: sha512-lHONGJL1LIO12Ujyx8L8xKbwWSkoUKFSO+0wDAqGXiudWB2EO7WEUT+YZLtVbmOmSllAjLb9tpoIPwpRe5Tn6w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 - '@typescript-eslint/scope-manager': 5.18.0 - '@typescript-eslint/types': 5.18.0 - '@typescript-eslint/typescript-estree': 5.18.0_typescript@4.6.3 + '@typescript-eslint/scope-manager': 5.20.0 + '@typescript-eslint/types': 5.20.0 + '@typescript-eslint/typescript-estree': 5.20.0_typescript@4.6.3 eslint: 7.12.1 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@7.12.1 @@ -374,11 +374,11 @@ packages: eslint-visitor-keys: 1.3.0 dev: true - /@typescript-eslint/visitor-keys/5.18.0: - resolution: {integrity: sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg==} + /@typescript-eslint/visitor-keys/5.20.0: + resolution: {integrity: sha512-1flRpNF+0CAQkMNlTJ6L/Z5jiODG/e5+7mk6XwtPOUS3UrTz3UOiAg9jG2VtKsWI6rZQfy4C6a232QNRZTRGlg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.18.0 + '@typescript-eslint/types': 5.20.0 eslint-visitor-keys: 3.3.0 dev: true @@ -460,8 +460,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 - es-abstract: 1.19.2 + define-properties: 1.1.4 + es-abstract: 1.19.5 get-intrinsic: 1.1.1 is-string: 1.0.7 dev: true @@ -471,13 +471,14 @@ packages: engines: {node: '>=8'} dev: true - /array.prototype.flat/1.2.5: - resolution: {integrity: sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==} + /array.prototype.flat/1.3.0: + resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 - es-abstract: 1.19.2 + define-properties: 1.1.4 + es-abstract: 1.19.5 + es-shim-unscopables: 1.0.0 dev: true /astral-regex/1.0.0: @@ -605,7 +606,7 @@ packages: /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} dependencies: - ms: 2.1.2 + ms: 2.1.3 dev: true /debug/4.3.4: @@ -624,10 +625,11 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /define-properties/1.1.3: - resolution: {integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==} + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} engines: {node: '>= 0.4'} dependencies: + has-property-descriptors: 1.0.0 object-keys: 1.1.1 dev: true @@ -679,8 +681,8 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract/1.19.2: - resolution: {integrity: sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==} + /es-abstract/1.19.5: + resolution: {integrity: sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 @@ -705,6 +707,12 @@ packages: unbox-primitive: 1.0.1 dev: true + /es-shim-unscopables/1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: true + /es-to-primitive/1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} @@ -822,14 +830,14 @@ packages: dev: true optional: true - /esbuild-plugin-copy/1.2.1_esbuild@0.13.12: - resolution: {integrity: sha512-DIdiDOZHGw7sA7AF41T4iiWsQGmcNkDke3wGuMJQv3PYN2m7XGJF4BuTSfu1d+Br1iGiUT9ZRwW+7VIG9+VxSg==} + /esbuild-plugin-copy/1.3.0_esbuild@0.13.12: + resolution: {integrity: sha512-LOx1xJOlAaCFMRtokHjsJfEkrosy3RDRa8SUHmn7loo0gwrouBQQwLAmOyMECshf7gSR1cPSRtAHu3KF/kQsyw==} peerDependencies: esbuild: ^0.14.0 dependencies: chalk: 4.1.2 esbuild: 0.13.12 - fs-extra: 10.0.1 + fs-extra: 10.1.0 globby: 11.1.0 dev: true @@ -952,7 +960,7 @@ packages: eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 dependencies: array-includes: 3.1.4 - array.prototype.flat: 1.2.5 + array.prototype.flat: 1.3.0 contains-path: 0.1.0 debug: 2.6.9 doctrine: 1.5.0 @@ -1078,7 +1086,7 @@ packages: optionator: 0.9.1 progress: 2.0.3 regexpp: 3.2.0 - semver: 7.3.5 + semver: 7.3.7 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 table: 5.4.6 @@ -1204,11 +1212,11 @@ packages: resolution: {integrity: sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==} dev: true - /fs-extra/10.0.1: - resolution: {integrity: sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==} + /fs-extra/10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jsonfile: 6.1.0 universalify: 2.0.0 dev: true @@ -1278,8 +1286,8 @@ packages: slash: 3.0.0 dev: true - /graceful-fs/4.2.9: - resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true /has-ansi/2.0.0: @@ -1289,8 +1297,8 @@ packages: ansi-regex: 2.1.1 dev: true - /has-bigints/1.0.1: - resolution: {integrity: sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==} + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true /has-flag/3.0.0: @@ -1303,6 +1311,12 @@ packages: engines: {node: '>=8'} dev: true + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.1.1 + dev: true + /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} @@ -1381,7 +1395,7 @@ packages: /is-bigint/1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: - has-bigints: 1.0.1 + has-bigints: 1.0.2 dev: true /is-boolean-object/1.1.2: @@ -1397,8 +1411,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-core-module/2.8.1: - resolution: {integrity: sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==} + /is-core-module/2.9.0: + resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} dependencies: has: 1.0.3 dev: true @@ -1518,7 +1532,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 dev: true /levn/0.4.1: @@ -1533,7 +1547,7 @@ packages: resolution: {integrity: sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=} engines: {node: '>=4'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 parse-json: 2.2.0 pify: 2.3.0 strip-bom: 3.0.0 @@ -1631,6 +1645,10 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + /natural-compare/1.4.0: resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=} dev: true @@ -1658,7 +1676,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 + define-properties: 1.1.4 has-symbols: 1.0.3 object-keys: 1.1.1 dev: true @@ -1668,8 +1686,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 - es-abstract: 1.19.2 + define-properties: 1.1.4 + es-abstract: 1.19.5 dev: true /obsidian/0.14.6: @@ -1860,7 +1878,7 @@ packages: resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==} hasBin: true dependencies: - is-core-module: 2.8.1 + is-core-module: 2.9.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -1877,6 +1895,13 @@ packages: glob: 7.2.0 dev: true + /rimraf/2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + hasBin: true + dependencies: + glob: 7.2.0 + dev: true + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -1887,9 +1912,9 @@ packages: resolution: {integrity: sha1-dB4kXiMfB8r7b98PEzrfohalAq0=} dependencies: es6-promise: 3.3.1 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 mkdirp: 0.5.6 - rimraf: 2.6.3 + rimraf: 2.7.1 dev: true /semver/5.7.1: @@ -1902,8 +1927,8 @@ packages: hasBin: true dev: true - /semver/7.3.5: - resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==} + /semver/7.3.7: + resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==} engines: {node: '>=10'} hasBin: true dependencies: @@ -1997,14 +2022,14 @@ packages: resolution: {integrity: sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 + define-properties: 1.1.4 dev: true /string.prototype.trimstart/1.0.4: resolution: {integrity: sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==} dependencies: call-bind: 1.0.2 - define-properties: 1.1.3 + define-properties: 1.1.4 dev: true /strip-ansi/3.0.1: @@ -2215,7 +2240,7 @@ packages: resolution: {integrity: sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==} dependencies: function-bind: 1.1.1 - has-bigints: 1.0.1 + has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 dev: true diff --git a/src/CmpModalInFile.svelte b/src/CmpModalInFile.svelte index c96900c..7b84752 100644 --- a/src/CmpModalInFile.svelte +++ b/src/CmpModalInFile.svelte @@ -6,7 +6,6 @@ let lastSearch = "" import CmpInput from "./CmpInput.svelte" import CmpResultInFile from "./CmpResultInFile.svelte" import { excerptAfter, type ResultNote, type SearchMatch } from "./globals" -import { plugin } from "./stores" import { loopIndex } from "./utils" import { onMount, tick } from "svelte" import { MarkdownView } from "obsidian" @@ -91,8 +90,8 @@ async function openSelection(): Promise { modal.close() if (parent) parent.close() - await $plugin.app.workspace.openLinkText(note.path, "") - const view = $plugin.app.workspace.getActiveViewOfType(MarkdownView) + await app.workspace.openLinkText(note.path, "") + const view = app.workspace.getActiveViewOfType(MarkdownView) if (!view) { throw new Error("OmniSearch - No active MarkdownView") } diff --git a/src/CmpModalVault.svelte b/src/CmpModalVault.svelte index 21d2d0a..6f1a9cc 100644 --- a/src/CmpModalVault.svelte +++ b/src/CmpModalVault.svelte @@ -11,7 +11,6 @@ import type { ResultNote } from "./globals" import { ModalInFile, type ModalVault } from "./modal" import { openNote } from "./notes" import { getSuggestions } from "./search" -import { plugin } from "./stores" import { loopIndex } from "./utils" export let modal: ModalVault @@ -35,11 +34,8 @@ onMount(() => { async function createOrOpenNote(item: ResultNote): Promise { try { - const file = await $plugin.app.vault.create( - searchQuery + ".md", - "# " + searchQuery - ) - await $plugin.app.workspace.openLinkText(file.path, "") + const file = await app.vault.create(searchQuery + ".md", "# " + searchQuery) + await app.workspace.openLinkText(file.path, "") } catch (e) { if (e instanceof Error && e.message === "File already exists.") { // Open the existing file instead of creating it @@ -77,10 +73,10 @@ function onInputShiftEnter(): void { function onInputAltEnter(): void { if (selectedNote) { - const file = $plugin.app.vault.getAbstractFileByPath(selectedNote.path) + const file = app.vault.getAbstractFileByPath(selectedNote.path) if (file && file instanceof TFile) { // modal.close() - new ModalInFile($plugin, file, searchQuery, modal).open() + new ModalInFile(app, file, searchQuery, modal).open() } } } diff --git a/src/main.ts b/src/main.ts index 8e48598..b16b101 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ +/* global app */ // make eslint happy with Obisidian's global app reference import { MarkdownView, Plugin, TFile } from 'obsidian' -import { plugin } from './stores' import { addToIndex, initGlobalSearchIndex, @@ -10,14 +10,12 @@ import { ModalInFile, ModalVault } from './modal' export default class OmnisearchPlugin extends Plugin { async onload(): Promise { - plugin.set(this) - // Commands to display Omnisearch modals this.addCommand({ id: 'show-modal', name: 'Vault search', callback: () => { - new ModalVault(this).open() + new ModalVault(app).open() }, }) @@ -25,10 +23,10 @@ export default class OmnisearchPlugin extends Plugin { id: 'show-modal-infile', name: 'In-file search', checkCallback: (checking: boolean) => { - const view = this.app.workspace.getActiveViewOfType(MarkdownView) + const view = app.workspace.getActiveViewOfType(MarkdownView) if (view) { if (!checking) { - new ModalInFile(this, view.file).open() + new ModalInFile(app, view.file).open() } return true } diff --git a/src/modal.ts b/src/modal.ts index cd892fe..b8d4fd9 100644 --- a/src/modal.ts +++ b/src/modal.ts @@ -1,11 +1,10 @@ -import { Modal, TFile } from 'obsidian' -import type OmnisearchPlugin from './main' +import { App, Modal, TFile } from 'obsidian' import CmpModalVault from './CmpModalVault.svelte' import CmpModalInFile from './CmpModalInFile.svelte' abstract class ModalOmnisearch extends Modal { - constructor(plugin: OmnisearchPlugin) { - super(plugin.app) + constructor(app: App) { + super(app) // Remove all the default modal's children (except the close button) // so that we can more easily customize it @@ -17,8 +16,8 @@ abstract class ModalOmnisearch extends Modal { } export class ModalVault extends ModalOmnisearch { - constructor(plugin: OmnisearchPlugin) { - super(plugin) + constructor(app: App) { + super(app) new CmpModalVault({ target: this.modalEl, @@ -31,12 +30,12 @@ export class ModalVault extends ModalOmnisearch { export class ModalInFile extends ModalOmnisearch { constructor( - plugin: OmnisearchPlugin, + app: App, file: TFile, searchQuery: string = '', parent?: ModalOmnisearch, ) { - super(plugin) + super(app) if (parent) { // Hide the parent modal diff --git a/src/notes.ts b/src/notes.ts index 6b75d9f..e2bda8c 100644 --- a/src/notes.ts +++ b/src/notes.ts @@ -1,14 +1,11 @@ import { MarkdownView } from 'obsidian' -import { get } from 'svelte/store' import type { ResultNote } from './globals' -import { plugin } from './stores' import { stringsToRegex } from './utils' export async function openNote( item: ResultNote, newPane = false, ): Promise { - const app = get(plugin).app const reg = stringsToRegex(item.foundWords) reg.exec(item.content) const offset = reg.lastIndex diff --git a/src/search.ts b/src/search.ts index a8e5aa5..40547df 100644 --- a/src/search.ts +++ b/src/search.ts @@ -6,7 +6,6 @@ import { type ResultNote, type SearchMatch, } from './globals' -import { plugin } from './stores' import { get } from 'svelte/store' import { extractHeadingsFromCache, stringsToRegex, wait } from './utils' @@ -28,7 +27,7 @@ export async function initGlobalSearchIndex(): Promise { // Index files that are already present const start = new Date().getTime() - const files = get(plugin).app.vault.getMarkdownFiles() + const files = app.vault.getMarkdownFiles() // This is basically the same behavior as MiniSearch's `addAllAsync()`. // We index files by batches of 10 @@ -147,7 +146,6 @@ export async function addToIndex(file: TAbstractFile): Promise { return } try { - const app = get(plugin).app // console.log(`Omnisearch - adding ${file.path} to index`) const fileCache = app.metadataCache.getFileCache(file) // console.log(fileCache) diff --git a/src/stores.ts b/src/stores.ts index 2d2e4e4..55b9209 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -1,7 +1,2 @@ import { writable } from 'svelte/store' import type OmnisearchPlugin from './main' - -/** - * A reference to the plugin instance - */ -export const plugin = writable()