Initial React project

This commit is contained in:
Johan
2026-03-17 00:42:10 +01:00
parent c9031f2275
commit 8bca9680e4
1317 changed files with 48700 additions and 23334 deletions

21
node_modules/vite-plugin-sitemap/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 jbaubree
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.

202
node_modules/vite-plugin-sitemap/README.md generated vendored Normal file
View File

@@ -0,0 +1,202 @@
# vite-plugin-sitemap
[![npm version](https://badgen.net/npm/v/vite-plugin-sitemap)](https://www.npmjs.com/package/vite-plugin-sitemap)
[![monthly downloads](https://badgen.net/npm/dm/vite-plugin-sitemap)](https://www.npmjs.com/package/vite-plugin-sitemap)
[![types](https://badgen.net/npm/types/vite-plugin-sitemap)](https://github.com/jbaubree/vite-plugin-sitemap/blob/main/src/types.ts)
[![license](https://badgen.net/npm/license/vite-plugin-sitemap)](https://github.com/jbaubree/vite-plugin-sitemap/blob/main/LICENSE)
[![CI](https://github.com/jbaubree/vite-plugin-sitemap/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jbaubree/vite-plugin-sitemap/actions/workflows/ci.yml)
> Sitemap generator plugin for Vite using [sitemap-ts](https://github.com/jbaubree/sitemap-ts).
> This plugin scans your dist folder next build to generate sitemap.xml and robots.txt files.
## Getting Started
### Vue
Install:
```bash
npm install -D vite-plugin-sitemap
```
### Vite config
Add to your `vite.config.js`:
```js
import Sitemap from 'vite-plugin-sitemap'
export default {
plugins: [
Vue(),
Sitemap({ hostname: 'https://example.com' }),
],
}
```
Now, run `npm build` and this will generate sitemap.xml and robots.txt files on your dist folder.
### To generate all pages of your app, you can:
- Use dynamicRoutes to send routes paths.
- Read [`MPA docs`](https://vitejs.dev/guide/build.html#multi-page-app) from Vite documentation.
- Use MPA with [`vite-plugin-mpa`](https://github.com/IndexXuan/vite-plugin-mpa).
## Configuration options
### hostname
- **Type:** `string`
- **Default:** `'http://localhost/'`
Base URI.
### dynamicRoutes
- **Type:** `string[]`
- **Default:** `[]`
Array of strings with manual dynamic routes.
```js
const names = [
'John',
'Bryce',
'Addison',
'Dana',
]
const dynamicRoutes = names.map(name => `/names/${name}`)
export default {
plugins: [
Vue(),
Sitemap({ dynamicRoutes }),
],
}
```
You can find a working example in example folder.
### exclude
- **Type:** `string[]`
- **Default:** `[]`
Array of strings with excluded routes.
```js
export default {
plugins: [
Vue(),
Sitemap({ exclude: ['/admin', '/private'] }),
],
}
```
You can find a working example in example folder.
### externalSitemaps
- **Type:** `string[]`
- **Default:** `[]`
Array of strings with other sitemaps paths or urls.
```js
generateSitemap({
externalSitemaps: ['sitemap_1', 'sitemap_2', 'subpath/sitemap_3', 'https://site.com/sitemap.xml']
})
```
### outDir
- **Type:** `string`
- **Default:** `'dist'`
Output directory.
### extensions
- **Type:** `string | string[]`
- **Default:** `'html'`
File extensions that need to be generated.
Example: ['html', 'md']
### changefreq
- **Type:** `string | RoutesOptionMap<string>`
- **Default:** `'daily'`
Change frequency option for sitemap.
### priority
- **Type:** `number | RoutesOptionMap<number>`
- **Default:** `1`
Priority option for sitemap.
### lastmod
- **Type:** `Date | RoutesOptionMap<Date>`
- **Default:** `new Date()`
Last modification option for sitemap.
### RoutesOptionMap\<Type>
- **Type:** `{ [route: string]: Type }`
Used for changing `changefreq`, `priority`, or `lastmod` on a by-route level.
The (optional) route `'*'` is used as default.
### readable
- **Type:** `boolean`
- **Default:** `false`
Converts XML into a human readable format
### i18n
- **Type:** `{ defaultLanguage?: string, languages: string[], strategy?: 'suffix' | 'prefix' }`
- **Default:** `undefined, strategy: 'suffix'`
Add i18n support defining alternate links.
defaultLanguage will use this language with / and languages with /language.
strategy specifies if the language code is a suffix to the path or a prefix. 'suffix' is default. Example: http://localhost/mypage/en or http://localhost/en/mypage
### generateRobotsTxt
- **Type:** `boolean`
- **Default:** `true`
Enables robots.txt file generation
### xmlns
- **Type:** `NSArgs`
- **Default:** `undefined`
Trim the xml namespace
See https://www.npmjs.com/package/sitemap#options-you-can-pass
Type: https://github.com/ekalinin/sitemap.js/blob/0af656e6a4a7b1403c9b3af23603261bd9cf94d3/lib/sitemap-stream.ts#L20
### robots
- **Type:** `RobotOption[]`
- **Default:** `[{ userAgent: '*', allow: '/' }]`
RobotOption:
- **userAgent**: `string`
- **allow**?: `string | string[]`
- **disallow**?: `string | string[]`
- **crawlDelay**?: `number`
- **cleanParam**?: `string`
## License
MIT License © 2022 [jbaubree](https://github.com/jbaubree)

152
node_modules/vite-plugin-sitemap/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,152 @@
/// <reference types="node" />
interface NSArgs {
news: boolean;
video: boolean;
xhtml: boolean;
image: boolean;
custom?: string[];
}
interface RobotOption {
/**
* User-agent value.
* Example: Googlebot
*/
userAgent: string;
/**
* Allowed routes for corresponding User-agent.
* Example: '/'
*/
allow?: string | string[];
/**
* Disallowed routes for corresponding User-agent.
* Example: ['/admin', '/confidential']
*/
disallow?: string | string[];
/**
* Crawl-delay option for robot.
* Example: 2
*/
crawlDelay?: number;
/**
* Clean-param option for robot.
* Example: 'ref /articles/'
*/
cleanParam?: string;
}
type RoutesOptionMap<T> = T | {
[key: string]: T;
};
/**
* Plugin options.
*/
interface Options {
/**
* Base URI
* @default 'http://localhost/'
*/
hostname: string;
/**
* Array of strings with dynamic routes.
* Example: ['/routes1', '/route2/sub-route']
* @default []
*/
dynamicRoutes: string[];
/**
* Array of strings with excluded routes.
* Example: ['/routes1', '/route2/sub-route']
* @default []
*/
exclude: string[];
/**
* Array of i18n languages.
* Example: {
* defaultLanguage: 'fr'
* languages: ['fr', 'en', 'es']
* strategy: 'suffix' | 'prefix'
* }
* @default undefined, strategy: 'suffix'
*/
i18n?: {
defaultLanguage?: string;
languages: string[];
strategy?: 'suffix' | 'prefix';
};
/**
* Other sitemaps paths
* Example: ['sitemap_1.xml', 'path/sitemap_2.xml', 'https://site.com/sitemap.xml']
* @default []
*/
externalSitemaps: string[];
/**
* String with base path.
* Example: '/mysubpath'
* @default ''
*/
basePath: string;
/**
* Output directory
* @default 'dist'
*/
outDir: string;
/**
* File extensions that need to be generated.
* Example: ['html', 'md']
* @default 'html'
*/
extensions: string | string[];
/**
* Change frequency option for sitemap
* @default 'daily'
*/
changefreq: string | RoutesOptionMap<string>;
/**
* Priority option for sitemap
* @default 1
*/
priority: number | RoutesOptionMap<number>;
/**
* Last modification option for sitemap
* @default new Date()
*/
lastmod: Date | RoutesOptionMap<Date>;
/**
* Converts XML into a human-readable format
* @default false
*/
readable: boolean;
/**
* Enables robots.txt file generation
* @default true
*/
generateRobotsTxt: boolean;
/**
* Robots policy
* @default [{ userAgent: '*', allow: '/' }]
*/
robots: RobotOption[];
/**
* Trim the xml namespace
* See https://www.npmjs.com/package/sitemap#options-you-can-pass
* @default undefined
*/
xmlns?: NSArgs;
}
type UserOptions = Partial<Options>;
declare function sitemapPlugin(options?: UserOptions): {
name: string;
closeBundle(): void;
transformIndexHtml(): {
tag: string;
injectTo: "head" | "body" | "head-prepend" | "body-prepend";
attrs: {
rel: string;
type: string;
title: string;
href: string;
};
}[];
};
export { sitemapPlugin as default };

11240
node_modules/vite-plugin-sitemap/dist/index.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

11240
node_modules/vite-plugin-sitemap/dist/index.mjs generated vendored Executable file

File diff suppressed because it is too large Load Diff

37
node_modules/vite-plugin-sitemap/package.json generated vendored Normal file
View File

@@ -0,0 +1,37 @@
{
"name": "vite-plugin-sitemap",
"type": "module",
"version": "0.8.2",
"packageManager": "pnpm@9.1.2",
"description": "Sitemap generator plugin for Vite",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "pkgroll",
"dev": "npm run build -- --watch",
"example:build": "npm -C example run build",
"release": "npx bumpp --commit --tag --push && npm publish",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"typecheck": "vue-tsc --noEmit",
"up": "taze major -r -I"
},
"devDependencies": {
"@antfu/eslint-config": "^2.18.1",
"@types/node": "^20.12.12",
"eslint": "^9.3.0",
"eslint-plugin-format": "^0.1.1",
"pkgroll": "^2.1.1",
"pnpm": "^9.1.2",
"sitemap-ts": "^1.9.0",
"taze": "^0.13.8",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-pages": "^0.32.1",
"vue-tsc": "^2.0.19"
}
}