{"_id":"@coderspirit/lyra-astro","name":"@coderspirit/lyra-astro","dist-tags":{"latest":"0.0.2-alpha.0"},"versions":{"0.0.2-alpha.0":{"name":"@coderspirit/lyra-astro","description":"An Astro integration for Lyra","version":"0.0.2-alpha.0","keywords":["astro","astro-component","cms","lyra","search"],"repository":{"type":"git","url":"https://github.com/LyraSearch/plugin-astro"},"author":{"name":"Andres Correa Casablanca","email":"andres.casablanca@nearform.com","url":"https://blog.coderspirit.xyz"},"license":"Apache-2.0","private":false,"main":"./dist/cjs/index.cjs","module":"./dist/esm/index.mjs","types":"./dist/esm/index.d.ts","exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs","node":"./dist/cjs/index.cjs"},"./clientside":{"import":"./dist/esm/clientside.mjs","require":"./dist/cjs/clientside.cjs","node":"./dist/cjs/clientside.cjs"}},"scripts":{"build":"rimraf ./dist && yarn build:cjs && yarn build:esm","build:cjs":"./scripts/build_cjs.sh","build:esm":"./scripts/build_esm.sh","changelog":"auto-changelog -p","lint":"yarn lint:tsc && yarn lint:eslint","lint:eslint":"yarn eslint . --ext .js,.ts --max-warnings 0","lint:tsc":"tsc -p ./tsconfig.tests.json","prepare":"if [ -d .git ]; then git config core.hooksPath .hooks; fi","prepublishOnly":"yarn lint && yarn test","test":"yarn test:unit && yarn test:integration","test:integration":"./scripts/test_integration.sh","test:unit":"./scripts/test_unit.sh"},"dependencies":{"@lyrasearch/lyra":"^0.2.3","html-to-text":"^8.2.1"},"engines":{"node":">=18.0.0"},"devDependencies":{"@types/html-to-text":"^8.1.1","@types/node":"^18.7.16","@typescript-eslint/eslint-plugin":"^5.36.2","@typescript-eslint/parser":"^5.36.2","astro":"^1.2.1","auto-changelog":"^2.4.0","eslint":"^8.23.0","eslint-config-prettier":"^8.5.0","eslint-plugin-node":"^11.1.0","prettier":"^2.7.1","rimraf":"^3.0.2","ts-node":"^10.9.1","typescript":"^4.8.3","zx":"^7.0.8"},"peerDependencies":{"astro":"^1.2.1"},"licenseText":"Copyright 2022 NearForm\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","_id":"@coderspirit/lyra-astro@0.0.2-alpha.0","dist":{"shasum":"98d3c1afbf3707fec0f990c086d0315f8c3b1aff","integrity":"sha512-MuODn81D5zm/qxQOF4KHf0/hXUrZ1kjWte6r17J971zEiadDNf3XsRg/1qpHUm6Cy49oyO+dBI9Qv13GEJAamQ==","tarball":"https://registry.npmjs.org/@coderspirit/lyra-astro/-/lyra-astro-0.0.2-alpha.0.tgz","fileCount":25,"unpackedSize":24309,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEucbMW9O9+npv2X6sh59wEbkwb6C4401nNF9+FfWyCUAiEAzKvJBlOjgguo2nyQHR9iqdCLvHj0wIURQ76KoSpzZas="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHFhoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB5hAAkgBbJ0uGkc7ksEyK24ShKKdB9r7TNVHjs5TKaSMMStIQSVSD\r\nHiXQe+5egUJWx5c23QXEwMh2xusWBEFY0gn6EkY8tolggiwIQF/ZCAo+dh9V\r\nxaAg7T8FxnVap9aXZ1aZnSPtHj91MBVeRvPWaOCIqmf3VXY3kRRH+wKI5I+K\r\ngm/rD9JXTM4cMfceFTe+9cfnE5UWhmUKXDh7kfzRbST1UV211+YH5ygClJBi\r\nHxpFWi4cWSQ6j3FQeYj3M25Us6gZa7EsdC1xUyPqzIlGJFwWhXSSRkFu2iOf\r\ngNDJl2QtWNZyYUDgDwty4IqdL8PYPp+DWxt81D25V0yiPn79Ao9ZTMyneDjK\r\nbA+lYkZXMxwvA9oltOyzzv46Gu3XGf1VDF/3gG2rrLx3KLaIqIJAuJESaUMb\r\nb10TbzwkCRgGM1fzY+x5xKT8pQhlfruIarQyLjauwHERx9QlQVn1b94U1bfh\r\nDV8LPSIa+60wZMZeyI+45vOsZsS0NtIFesPmju4BVP8DBl90u93ekI2OjCDp\r\nU69OZ6tvia7heGg5gWufxpLWxIHjvdZDKXYabXGxGkUIKFdQuzJlk4eqw3Dr\r\ns/O1lTrkvbh87eWUBuIrmpdANiwBZLdDe9Tz27yT1zVYfa0dpVR7FoDsXLIX\r\nCBzDYMOBO6QZatXrSoFlsrdTBU41fhcff2I=\r\n=QD/2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"castarco","email":"castarco@gmail.com"},"directories":{},"maintainers":[{"name":"castarco","email":"castarco@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lyra-astro_0.0.2-alpha.0_1662802024630_0.7021580578331361"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-10T09:27:04.588Z","0.0.2-alpha.0":"2022-09-10T09:27:04.773Z","modified":"2022-09-10T09:27:04.896Z"},"maintainers":[{"name":"castarco","email":"castarco@gmail.com"}],"description":"An Astro integration for Lyra","keywords":["astro","astro-component","cms","lyra","search"],"repository":{"type":"git","url":"https://github.com/LyraSearch/plugin-astro"},"author":{"name":"Andres Correa Casablanca","email":"andres.casablanca@nearform.com","url":"https://blog.coderspirit.xyz"},"license":"Apache-2.0","readme":"# Lyra's Astro Plugin\n\nThis package is a (still experimental) [Lyra](https://lyrajs.io) integration for\n[Astro](https://astro.build).\n\n## Usage\n\n### Configuring the Astro integration\n\n```typescript\n// In `astro.config.mjs`\nimport lyra from '@lyrasearch/plugin-astro'\n\n// https://astro.build/config\nexport default defineConfig({\n  integrations: [\n    lyra({\n      // We can generate more than one DB, with different configurations\n      mydb: {\n        // Required. Only pages matching this path regex will be indexed\n        pathMatcher: /blog\\/[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}\\/.+$/,\n\n        // Optional. 'english' by default\n        language: 'spanish',\n\n        // Optional. ['body'] by default. Use it to constraint what is used to\n        // index a page.\n        contentSelectors: ['h1', 'main'],\n      },\n    }),\n  ],\n});\n```\n\nWhen running the `astro build` command, a new DB file will be persisted in the\n`dist/assets` directory. For the particular case of this example, it will be\nsaved in the file `dist/assets/lyraDB_mydb.json`.\n\n### Using generated DBs in your pages\n\nTo use the generated DBs in your pages, you can include a script in your\n`<head>` section, as the following one:\n\n```html\n<head>\n  <!-- Other stuff -->\n  <script>\n    // Astro will do the job of bundling everything for you\n    import { getLyraDB, search } from \"@lyrasearch/plugin-astro/clientside\"\n\n    // We load the DB that we generated at build time, this is an asynchronous\n    // operation, so we must either await, or rely on `.then` calls.\n    const db = await getLyraDB('mydb')\n\n    // Now we can search inside our DB. Of course, feel free to use it in more\n    // interesting ways.\n    console.log('Search Results')\n    console.log(search(db, { term: 'mySearchTerm' }))\n  </script>\n</head>\n```\n\n**NOTE:** For now, this plugin only supports readonly DBs. This might change in\n          the future if there's demand for it.\n","readmeFilename":"README.md"}