Use Vite fork
This commit is contained in:
parent
8145dc042c
commit
a0639b34f0
55 changed files with 179284 additions and 123 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,3 +12,5 @@ package-lock.json
|
|||
|
||||
# do not commit .env files or any files that end with `.env`
|
||||
*.env
|
||||
|
||||
!packages/astro/vite/dist
|
|
@ -36,7 +36,7 @@
|
|||
"packages/astro/test/fixtures/custom-elements/my-component-lib"
|
||||
],
|
||||
"volta": {
|
||||
"node": "14.16.1",
|
||||
"node": "14.17.0",
|
||||
"npm": "7.11.2",
|
||||
"yarn": "1.22.10"
|
||||
},
|
||||
|
|
|
@ -42,7 +42,8 @@
|
|||
"components",
|
||||
"dist",
|
||||
"astro.js",
|
||||
"README.md"
|
||||
"README.md",
|
||||
"vite"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||
|
|
|
@ -5,7 +5,7 @@ import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
|||
import fs from 'fs';
|
||||
import { bold, cyan, green, dim } from 'kleur/colors';
|
||||
import { performance } from 'perf_hooks';
|
||||
import vite, { ViteDevServer } from 'vite';
|
||||
import vite, { ViteDevServer } from '../vite.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { createVite } from '../create-vite.js';
|
||||
import { pad } from '../dev/util.js';
|
||||
|
|
|
@ -6,7 +6,7 @@ import fs from 'fs';
|
|||
import slash from 'slash';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { createRequire } from 'module';
|
||||
import vite from 'vite';
|
||||
import vite from './vite.js';
|
||||
import astroVitePlugin from '../vite-plugin-astro/index.js';
|
||||
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
||||
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
||||
|
|
|
@ -2,14 +2,14 @@ import type { NextFunction } from 'connect';
|
|||
import type http from 'http';
|
||||
import type { AstroConfig, ManifestData, RouteCache, RouteData } from '../../@types/astro-core';
|
||||
import type { LogOptions } from '../logger';
|
||||
import type { HmrContext, ModuleNode } from 'vite';
|
||||
import type { HmrContext, ModuleNode } from '../vite';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
import connect from 'connect';
|
||||
import mime from 'mime';
|
||||
import { performance } from 'perf_hooks';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import vite from 'vite';
|
||||
import vite from '../vite.js';
|
||||
import { defaultLogOptions, error, info } from '../logger.js';
|
||||
import { ssr } from '../ssr/index.js';
|
||||
import { createRouteManifest, matchRoute } from '../ssr/routing.js';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { BuildResult } from 'esbuild';
|
||||
import type { ViteDevServer } from 'vite';
|
||||
import type { ViteDevServer } from '../../../vite';
|
||||
import type { AstroConfig, ComponentInstance, GetStaticPathsResult, Params, Props, Renderer, RouteCache, RouteData, RuntimeMode, SSRError } from '../../@types/astro-core';
|
||||
import type { AstroGlobal, TopLevelAstro, SSRResult } from '../../@types/astro-runtime';
|
||||
import type { LogOptions } from '../logger';
|
||||
|
|
2
packages/astro/src/core/vite.ts
Normal file
2
packages/astro/src/core/vite.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
export * from '../../vite/dist/node/index.js';
|
||||
export { default } from '../../vite/dist/node/index.js';
|
|
@ -1,5 +1,3 @@
|
|||
import { pathToFileURL } from 'url';
|
||||
|
||||
interface ModuleInfo {
|
||||
module: Record<string, any>;
|
||||
specifier: string;
|
||||
|
@ -14,7 +12,7 @@ class HydrationMap {
|
|||
public fileURL: URL;
|
||||
private metadataCache: Map<any, ComponentMetadata | null>;
|
||||
constructor(fileURL: string, public modules: ModuleInfo[], components: any[]) {
|
||||
this.fileURL = pathToFileURL(fileURL);
|
||||
this.fileURL = new URL(fileURL);
|
||||
this.metadataCache = new Map<any, ComponentMetadata | null>();
|
||||
}
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ function createFetchContentFn(url: URL) {
|
|||
}
|
||||
|
||||
export function createAstro(fileURLStr: string, site: string): TopLevelAstro {
|
||||
const url = pathToFileURL(fileURLStr);
|
||||
const url = new URL(fileURLStr);
|
||||
const fetchContent = createFetchContentFn(url) as unknown as TopLevelAstro['fetchContent'];
|
||||
return {
|
||||
// TODO I think this is no longer needed.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type * as t from '@babel/types';
|
||||
import type { Plugin } from 'vite';
|
||||
import type { Plugin } from '../core/vite';
|
||||
import type { AstroConfig } from '../@types/astro-core';
|
||||
import type { AstroDevServer } from '../core/dev/index';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { TransformResult } from '@astrojs/compiler';
|
||||
import type { Plugin } from 'vite';
|
||||
import type { Plugin } from '../core/vite';
|
||||
import type { AstroConfig } from '../@types/astro-core';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Plugin } from 'vite';
|
||||
import type { Plugin } from '../core/vite';
|
||||
import MagicString from 'magic-string';
|
||||
|
||||
// https://github.com/vitejs/vite/discussions/5109#discussioncomment-1450726
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Plugin } from 'vite';
|
||||
import type { Plugin } from '../core/vite';
|
||||
import type { TransformResult } from 'rollup';
|
||||
import type { AstroConfig, Renderer } from '../@types/astro-core';
|
||||
import type { LogOptions } from '../core/logger';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Plugin } from 'vite';
|
||||
import type { Plugin } from '../core/vite';
|
||||
import type { AstroConfig } from '../@types/astro-core';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
|
|
|
@ -2,16 +2,21 @@ import { expect } from 'chai';
|
|||
import cheerio from 'cheerio';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
|
||||
let fixture;
|
||||
let previewServer;
|
||||
|
||||
before(async () => {
|
||||
fixture = await loadFixture({ projectRoot: './fixtures/astro-basic/' });
|
||||
await fixture.build();
|
||||
previewServer = await fixture.preview();
|
||||
});
|
||||
|
||||
describe('Astro basics', () => {
|
||||
let fixture;
|
||||
let previewServer;
|
||||
|
||||
before(async () => {
|
||||
fixture = await loadFixture({ projectRoot: './fixtures/astro-basic/' });
|
||||
await fixture.build();
|
||||
previewServer = await fixture.preview();
|
||||
});
|
||||
|
||||
// important: close preview server (free up port and connection)
|
||||
after(async () => {
|
||||
if (previewServer) await previewServer.stop();
|
||||
});
|
||||
|
||||
describe('build', () => {
|
||||
it('Can load page', async () => {
|
||||
const html = await fixture.readFile(`/index.html`);
|
||||
|
@ -89,9 +94,4 @@ describe('Astro basics', () => {
|
|||
expect(result.status).to.equal(404);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// important: close preview server (free up port and connection)
|
||||
after(async () => {
|
||||
if (previewServer) await previewServer.stop();
|
||||
});
|
||||
});
|
|
@ -51,7 +51,7 @@ describe('Astro.*', () => {
|
|||
it('Astro.resolve in development', async () => {
|
||||
const html = await fixture.readFile('/resolve/index.html');
|
||||
const $ = cheerio.load(html);
|
||||
expect($('img').attr('src')).to.equal('/src/images/penguin.png');
|
||||
expect($('#inner-child img').attr('src')).to.equal('/src/components/nested/images/penguin.png');
|
||||
expect($('img').attr('src')).to.include('/src/images/penguin.png');
|
||||
expect($('#inner-child img').attr('src')).to.include('/src/components/nested/images/penguin.png');
|
||||
});
|
||||
});
|
||||
|
|
204
packages/astro/vite/client.d.ts
vendored
Normal file
204
packages/astro/vite/client.d.ts
vendored
Normal file
|
@ -0,0 +1,204 @@
|
|||
/// <reference lib="dom" />
|
||||
/// <reference path="./types/importMeta.d.ts" />
|
||||
|
||||
// CSS modules
|
||||
type CSSModuleClasses = { readonly [key: string]: string }
|
||||
|
||||
declare module '*.module.css' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.scss' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.sass' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.less' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.styl' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.stylus' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.pcss' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
|
||||
// CSS
|
||||
declare module '*.css' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.scss' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.sass' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.less' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.styl' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.stylus' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
declare module '*.pcss' {
|
||||
const css: string
|
||||
export default css
|
||||
}
|
||||
|
||||
// Built-in asset types
|
||||
// see `src/constants.ts`
|
||||
|
||||
// images
|
||||
declare module '*.jpg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.jpeg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.png' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.gif' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.svg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ico' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.webp' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.avif' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// media
|
||||
declare module '*.mp4' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.webm' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ogg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.mp3' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.wav' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.flac' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.aac' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// fonts
|
||||
declare module '*.woff' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.woff2' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.eot' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ttf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.otf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// other
|
||||
declare module '*.wasm' {
|
||||
const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Exports>
|
||||
export default initWasm
|
||||
}
|
||||
declare module '*.webmanifest' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.pdf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// web worker
|
||||
declare module '*?worker' {
|
||||
const workerConstructor: {
|
||||
new (): Worker
|
||||
}
|
||||
export default workerConstructor
|
||||
}
|
||||
|
||||
declare module '*?worker&inline' {
|
||||
const workerConstructor: {
|
||||
new (): Worker
|
||||
}
|
||||
export default workerConstructor
|
||||
}
|
||||
|
||||
declare module '*?sharedworker' {
|
||||
const sharedWorkerConstructor: {
|
||||
new (): SharedWorker
|
||||
}
|
||||
export default sharedWorkerConstructor
|
||||
}
|
||||
|
||||
declare module '*?raw' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?url' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?inline' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
553
packages/astro/vite/dist/client/client.mjs
vendored
Normal file
553
packages/astro/vite/dist/client/client.mjs
vendored
Normal file
|
@ -0,0 +1,553 @@
|
|||
import '@vite/env';
|
||||
|
||||
const template = /*html*/ `
|
||||
<style>
|
||||
:host {
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
margin: 0;
|
||||
background: rgba(0, 0, 0, 0.66);
|
||||
--monospace: 'SFMono-Regular', Consolas,
|
||||
'Liberation Mono', Menlo, Courier, monospace;
|
||||
--red: #ff5555;
|
||||
--yellow: #e2aa53;
|
||||
--purple: #cfa4ff;
|
||||
--cyan: #2dd9da;
|
||||
--dim: #c9c9c9;
|
||||
}
|
||||
|
||||
.window {
|
||||
font-family: var(--monospace);
|
||||
line-height: 1.5;
|
||||
width: 800px;
|
||||
color: #d8d8d8;
|
||||
margin: 30px auto;
|
||||
padding: 25px 40px;
|
||||
position: relative;
|
||||
background: #181818;
|
||||
border-radius: 6px 6px 8px 8px;
|
||||
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
||||
overflow: hidden;
|
||||
border-top: 8px solid var(--red);
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: var(--monospace);
|
||||
font-size: 16px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1em;
|
||||
overflow-x: scroll;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
pre::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.message {
|
||||
line-height: 1.3;
|
||||
font-weight: 600;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.message-body {
|
||||
color: var(--red);
|
||||
}
|
||||
|
||||
.plugin {
|
||||
color: var(--purple);
|
||||
}
|
||||
|
||||
.file {
|
||||
color: var(--cyan);
|
||||
margin-bottom: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.frame {
|
||||
color: var(--yellow);
|
||||
}
|
||||
|
||||
.stack {
|
||||
font-size: 13px;
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
border-top: 1px dotted #999;
|
||||
padding-top: 13px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 13px;
|
||||
font-family: var(--monospace);
|
||||
color: var(--yellow);
|
||||
}
|
||||
|
||||
.file-link {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div class="window">
|
||||
<pre class="message"><span class="plugin"></span><span class="message-body"></span></pre>
|
||||
<pre class="file"></pre>
|
||||
<pre class="frame"></pre>
|
||||
<pre class="stack"></pre>
|
||||
<div class="tip">
|
||||
Click outside or fix the code to dismiss.<br>
|
||||
You can also disable this overlay with
|
||||
<code>hmr: { overlay: false }</code> in <code>vite.config.js.</code>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
||||
const codeframeRE = /^(?:>?\s+\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
||||
class ErrorOverlay extends HTMLElement {
|
||||
constructor(err) {
|
||||
var _a;
|
||||
super();
|
||||
this.root = this.attachShadow({ mode: 'open' });
|
||||
this.root.innerHTML = template;
|
||||
codeframeRE.lastIndex = 0;
|
||||
const hasFrame = err.frame && codeframeRE.test(err.frame);
|
||||
const message = hasFrame
|
||||
? err.message.replace(codeframeRE, '')
|
||||
: err.message;
|
||||
if (err.plugin) {
|
||||
this.text('.plugin', `[plugin:${err.plugin}] `);
|
||||
}
|
||||
this.text('.message-body', message.trim());
|
||||
const [file] = (((_a = err.loc) === null || _a === void 0 ? void 0 : _a.file) || err.id || 'unknown file').split(`?`);
|
||||
if (err.loc) {
|
||||
this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, true);
|
||||
}
|
||||
else if (err.id) {
|
||||
this.text('.file', file);
|
||||
}
|
||||
if (hasFrame) {
|
||||
this.text('.frame', err.frame.trim());
|
||||
}
|
||||
this.text('.stack', err.stack, true);
|
||||
this.root.querySelector('.window').addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
this.addEventListener('click', () => {
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
text(selector, text, linkFiles = false) {
|
||||
const el = this.root.querySelector(selector);
|
||||
if (!linkFiles) {
|
||||
el.textContent = text;
|
||||
}
|
||||
else {
|
||||
let curIndex = 0;
|
||||
let match;
|
||||
while ((match = fileRE.exec(text))) {
|
||||
const { 0: file, index } = match;
|
||||
if (index != null) {
|
||||
const frag = text.slice(curIndex, index);
|
||||
el.appendChild(document.createTextNode(frag));
|
||||
const link = document.createElement('a');
|
||||
link.textContent = file;
|
||||
link.className = 'file-link';
|
||||
link.onclick = () => {
|
||||
fetch('/__open-in-editor?file=' + encodeURIComponent(file));
|
||||
};
|
||||
el.appendChild(link);
|
||||
curIndex += frag.length + file.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close() {
|
||||
var _a;
|
||||
(_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this);
|
||||
}
|
||||
}
|
||||
const overlayId = 'vite-error-overlay';
|
||||
if (customElements && !customElements.get(overlayId)) {
|
||||
customElements.define(overlayId, ErrorOverlay);
|
||||
}
|
||||
|
||||
console.log('[vite] connecting...');
|
||||
// use server configuration, then fallback to inference
|
||||
const socketProtocol = __HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws');
|
||||
const socketHost = `${__HMR_HOSTNAME__ || location.hostname}:${__HMR_PORT__}`;
|
||||
const socket = new WebSocket(`${socketProtocol}://${socketHost}`, 'vite-hmr');
|
||||
const base = __BASE__ || '/';
|
||||
function warnFailedFetch(err, path) {
|
||||
if (!err.message.match('fetch')) {
|
||||
console.error(err);
|
||||
}
|
||||
console.error(`[hmr] Failed to reload ${path}. ` +
|
||||
`This could be due to syntax errors or importing non-existent ` +
|
||||
`modules. (see errors above)`);
|
||||
}
|
||||
// Listen for messages
|
||||
socket.addEventListener('message', async ({ data }) => {
|
||||
handleMessage(JSON.parse(data));
|
||||
});
|
||||
let isFirstUpdate = true;
|
||||
async function handleMessage(payload) {
|
||||
switch (payload.type) {
|
||||
case 'connected':
|
||||
console.log(`[vite] connected.`);
|
||||
// proxy(nginx, docker) hmr ws maybe caused timeout,
|
||||
// so send ping package let ws keep alive.
|
||||
setInterval(() => socket.send('ping'), __HMR_TIMEOUT__);
|
||||
break;
|
||||
case 'update':
|
||||
notifyListeners('vite:beforeUpdate', payload);
|
||||
// if this is the first update and there's already an error overlay, it
|
||||
// means the page opened with existing server compile error and the whole
|
||||
// module script failed to load (since one of the nested imports is 500).
|
||||
// in this case a normal update won't work and a full reload is needed.
|
||||
if (isFirstUpdate && hasErrorOverlay()) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
clearErrorOverlay();
|
||||
isFirstUpdate = false;
|
||||
}
|
||||
payload.updates.forEach((update) => {
|
||||
if (update.type === 'js-update') {
|
||||
queueUpdate(fetchUpdate(update));
|
||||
}
|
||||
else {
|
||||
// css-update
|
||||
// this is only sent when a css file referenced with <link> is updated
|
||||
let { path, timestamp } = update;
|
||||
path = path.replace(/\?.*/, '');
|
||||
// can't use querySelector with `[href*=]` here since the link may be
|
||||
// using relative paths so we need to use link.href to grab the full
|
||||
// URL for the include check.
|
||||
const el = [].slice.call(document.querySelectorAll(`link`)).find((e) => e.href.includes(path));
|
||||
if (el) {
|
||||
const newPath = `${base}${path.slice(1)}${path.includes('?') ? '&' : '?'}t=${timestamp}`;
|
||||
el.href = new URL(newPath, el.href).href;
|
||||
}
|
||||
console.log(`[vite] css hot updated: ${path}`);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'custom': {
|
||||
notifyListeners(payload.event, payload.data);
|
||||
break;
|
||||
}
|
||||
case 'full-reload':
|
||||
notifyListeners('vite:beforeFullReload', payload);
|
||||
if (payload.path && payload.path.endsWith('.html')) {
|
||||
// if html file is edited, only reload the page if the browser is
|
||||
// currently on that page.
|
||||
const pagePath = location.pathname;
|
||||
const payloadPath = base + payload.path.slice(1);
|
||||
if (pagePath === payloadPath ||
|
||||
(pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)) {
|
||||
location.reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
}
|
||||
break;
|
||||
case 'prune':
|
||||
notifyListeners('vite:beforePrune', payload);
|
||||
// After an HMR update, some modules are no longer imported on the page
|
||||
// but they may have left behind side effects that need to be cleaned up
|
||||
// (.e.g style injections)
|
||||
// TODO Trigger their dispose callbacks.
|
||||
payload.paths.forEach((path) => {
|
||||
const fn = pruneMap.get(path);
|
||||
if (fn) {
|
||||
fn(dataMap.get(path));
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'error': {
|
||||
notifyListeners('vite:error', payload);
|
||||
const err = payload.err;
|
||||
if (enableOverlay) {
|
||||
createErrorOverlay(err);
|
||||
}
|
||||
else {
|
||||
console.error(`[vite] Internal Server Error\n${err.message}\n${err.stack}`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
const check = payload;
|
||||
return check;
|
||||
}
|
||||
}
|
||||
}
|
||||
function notifyListeners(event, data) {
|
||||
const cbs = customListenersMap.get(event);
|
||||
if (cbs) {
|
||||
cbs.forEach((cb) => cb(data));
|
||||
}
|
||||
}
|
||||
const enableOverlay = __HMR_ENABLE_OVERLAY__;
|
||||
function createErrorOverlay(err) {
|
||||
if (!enableOverlay)
|
||||
return;
|
||||
clearErrorOverlay();
|
||||
document.body.appendChild(new ErrorOverlay(err));
|
||||
}
|
||||
function clearErrorOverlay() {
|
||||
document
|
||||
.querySelectorAll(overlayId)
|
||||
.forEach((n) => n.close());
|
||||
}
|
||||
function hasErrorOverlay() {
|
||||
return document.querySelectorAll(overlayId).length;
|
||||
}
|
||||
let pending = false;
|
||||
let queued = [];
|
||||
/**
|
||||
* buffer multiple hot updates triggered by the same src change
|
||||
* so that they are invoked in the same order they were sent.
|
||||
* (otherwise the order may be inconsistent because of the http request round trip)
|
||||
*/
|
||||
async function queueUpdate(p) {
|
||||
queued.push(p);
|
||||
if (!pending) {
|
||||
pending = true;
|
||||
await Promise.resolve();
|
||||
pending = false;
|
||||
const loading = [...queued];
|
||||
queued = [];
|
||||
(await Promise.all(loading)).forEach((fn) => fn && fn());
|
||||
}
|
||||
}
|
||||
async function waitForSuccessfulPing(ms = 1000) {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
try {
|
||||
await fetch(`${base}__vite_ping`);
|
||||
break;
|
||||
}
|
||||
catch (e) {
|
||||
await new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
}
|
||||
}
|
||||
// ping server
|
||||
socket.addEventListener('close', async ({ wasClean }) => {
|
||||
if (wasClean)
|
||||
return;
|
||||
console.log(`[vite] server connection lost. polling for restart...`);
|
||||
await waitForSuccessfulPing();
|
||||
location.reload();
|
||||
});
|
||||
const sheetsMap = new Map();
|
||||
function updateStyle(id, content) {
|
||||
let style = sheetsMap.get(id);
|
||||
{
|
||||
if (style && !(style instanceof HTMLStyleElement)) {
|
||||
removeStyle(id);
|
||||
style = undefined;
|
||||
}
|
||||
if (!style) {
|
||||
style = document.createElement('style');
|
||||
style.setAttribute('type', 'text/css');
|
||||
style.innerHTML = content;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
else {
|
||||
style.innerHTML = content;
|
||||
}
|
||||
}
|
||||
sheetsMap.set(id, style);
|
||||
}
|
||||
function removeStyle(id) {
|
||||
const style = sheetsMap.get(id);
|
||||
if (style) {
|
||||
if (style instanceof CSSStyleSheet) {
|
||||
// @ts-ignore
|
||||
document.adoptedStyleSheets.indexOf(style);
|
||||
// @ts-ignore
|
||||
document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== style);
|
||||
}
|
||||
else {
|
||||
document.head.removeChild(style);
|
||||
}
|
||||
sheetsMap.delete(id);
|
||||
}
|
||||
}
|
||||
async function fetchUpdate({ path, acceptedPath, timestamp }) {
|
||||
const mod = hotModulesMap.get(path);
|
||||
if (!mod) {
|
||||
// In a code-splitting project,
|
||||
// it is common that the hot-updating module is not loaded yet.
|
||||
// https://github.com/vitejs/vite/issues/721
|
||||
return;
|
||||
}
|
||||
const moduleMap = new Map();
|
||||
const isSelfUpdate = path === acceptedPath;
|
||||
// make sure we only import each dep once
|
||||
const modulesToUpdate = new Set();
|
||||
if (isSelfUpdate) {
|
||||
// self update - only update self
|
||||
modulesToUpdate.add(path);
|
||||
}
|
||||
else {
|
||||
// dep update
|
||||
for (const { deps } of mod.callbacks) {
|
||||
deps.forEach((dep) => {
|
||||
if (acceptedPath === dep) {
|
||||
modulesToUpdate.add(dep);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// determine the qualified callbacks before we re-import the modules
|
||||
const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => {
|
||||
return deps.some((dep) => modulesToUpdate.has(dep));
|
||||
});
|
||||
await Promise.all(Array.from(modulesToUpdate).map(async (dep) => {
|
||||
const disposer = disposeMap.get(dep);
|
||||
if (disposer)
|
||||
await disposer(dataMap.get(dep));
|
||||
const [path, query] = dep.split(`?`);
|
||||
try {
|
||||
const newMod = await import(
|
||||
/* @vite-ignore */
|
||||
base +
|
||||
path.slice(1) +
|
||||
`?import&t=${timestamp}${query ? `&${query}` : ''}`);
|
||||
moduleMap.set(dep, newMod);
|
||||
}
|
||||
catch (e) {
|
||||
warnFailedFetch(e, dep);
|
||||
}
|
||||
}));
|
||||
return () => {
|
||||
for (const { deps, fn } of qualifiedCallbacks) {
|
||||
fn(deps.map((dep) => moduleMap.get(dep)));
|
||||
}
|
||||
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
||||
console.log(`[vite] hot updated: ${loggedPath}`);
|
||||
};
|
||||
}
|
||||
const hotModulesMap = new Map();
|
||||
const disposeMap = new Map();
|
||||
const pruneMap = new Map();
|
||||
const dataMap = new Map();
|
||||
const customListenersMap = new Map();
|
||||
const ctxToListenersMap = new Map();
|
||||
// Just infer the return type for now
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
const createHotContext = (ownerPath) => {
|
||||
if (!dataMap.has(ownerPath)) {
|
||||
dataMap.set(ownerPath, {});
|
||||
}
|
||||
// when a file is hot updated, a new context is created
|
||||
// clear its stale callbacks
|
||||
const mod = hotModulesMap.get(ownerPath);
|
||||
if (mod) {
|
||||
mod.callbacks = [];
|
||||
}
|
||||
// clear stale custom event listeners
|
||||
const staleListeners = ctxToListenersMap.get(ownerPath);
|
||||
if (staleListeners) {
|
||||
for (const [event, staleFns] of staleListeners) {
|
||||
const listeners = customListenersMap.get(event);
|
||||
if (listeners) {
|
||||
customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
||||
}
|
||||
}
|
||||
}
|
||||
const newListeners = new Map();
|
||||
ctxToListenersMap.set(ownerPath, newListeners);
|
||||
function acceptDeps(deps, callback = () => { }) {
|
||||
const mod = hotModulesMap.get(ownerPath) || {
|
||||
id: ownerPath,
|
||||
callbacks: []
|
||||
};
|
||||
mod.callbacks.push({
|
||||
deps,
|
||||
fn: callback
|
||||
});
|
||||
hotModulesMap.set(ownerPath, mod);
|
||||
}
|
||||
const hot = {
|
||||
get data() {
|
||||
return dataMap.get(ownerPath);
|
||||
},
|
||||
accept(deps, callback) {
|
||||
if (typeof deps === 'function' || !deps) {
|
||||
// self-accept: hot.accept(() => {})
|
||||
acceptDeps([ownerPath], ([mod]) => deps && deps(mod));
|
||||
}
|
||||
else if (typeof deps === 'string') {
|
||||
// explicit deps
|
||||
acceptDeps([deps], ([mod]) => callback && callback(mod));
|
||||
}
|
||||
else if (Array.isArray(deps)) {
|
||||
acceptDeps(deps, callback);
|
||||
}
|
||||
else {
|
||||
throw new Error(`invalid hot.accept() usage.`);
|
||||
}
|
||||
},
|
||||
acceptDeps() {
|
||||
throw new Error(`hot.acceptDeps() is deprecated. ` +
|
||||
`Use hot.accept() with the same signature instead.`);
|
||||
},
|
||||
dispose(cb) {
|
||||
disposeMap.set(ownerPath, cb);
|
||||
},
|
||||
prune(cb) {
|
||||
pruneMap.set(ownerPath, cb);
|
||||
},
|
||||
// TODO
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
decline() { },
|
||||
invalidate() {
|
||||
// TODO should tell the server to re-perform hmr propagation
|
||||
// from this module as root
|
||||
location.reload();
|
||||
},
|
||||
// custom events
|
||||
on: (event, cb) => {
|
||||
const addToMap = (map) => {
|
||||
const existing = map.get(event) || [];
|
||||
existing.push(cb);
|
||||
map.set(event, existing);
|
||||
};
|
||||
addToMap(customListenersMap);
|
||||
addToMap(newListeners);
|
||||
}
|
||||
};
|
||||
return hot;
|
||||
};
|
||||
/**
|
||||
* urls here are dynamic import() urls that couldn't be statically analyzed
|
||||
*/
|
||||
function injectQuery(url, queryToInject) {
|
||||
// skip urls that won't be handled by vite
|
||||
if (!url.startsWith('.') && !url.startsWith('/')) {
|
||||
return url;
|
||||
}
|
||||
// can't use pathname from URL since it may be relative like ../
|
||||
const pathname = url.replace(/#.*$/, '').replace(/\?.*$/, '');
|
||||
const { search, hash } = new URL(url, 'http://vitejs.dev');
|
||||
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${hash || ''}`;
|
||||
}
|
||||
|
||||
export { createHotContext, injectQuery, removeStyle, updateStyle };
|
||||
//# sourceMappingURL=client.mjs.map
|
1
packages/astro/vite/dist/client/client.mjs.map
vendored
Normal file
1
packages/astro/vite/dist/client/client.mjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
30
packages/astro/vite/dist/client/env.mjs
vendored
Normal file
30
packages/astro/vite/dist/client/env.mjs
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
const context = (() => {
|
||||
if (typeof globalThis !== 'undefined') {
|
||||
return globalThis;
|
||||
}
|
||||
else if (typeof self !== 'undefined') {
|
||||
return self;
|
||||
}
|
||||
else if (typeof window !== 'undefined') {
|
||||
return window;
|
||||
}
|
||||
else {
|
||||
return Function('return this')();
|
||||
}
|
||||
})();
|
||||
// assign defines
|
||||
const defines = __DEFINES__;
|
||||
Object.keys(defines).forEach((key) => {
|
||||
const segments = key.split('.');
|
||||
let target = context;
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
const segment = segments[i];
|
||||
if (i === segments.length - 1) {
|
||||
target[segment] = defines[key];
|
||||
}
|
||||
else {
|
||||
target = target[segment] || (target[segment] = {});
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=env.mjs.map
|
1
packages/astro/vite/dist/client/env.mjs.map
vendored
Normal file
1
packages/astro/vite/dist/client/env.mjs.map
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"env.mjs","sources":["../../src/client/env.ts"],"sourcesContent":["declare const __MODE__: string\ndeclare const __DEFINES__: Record<string, any>\n\nconst context = (() => {\n if (typeof globalThis !== 'undefined') {\n return globalThis\n } else if (typeof self !== 'undefined') {\n return self\n } else if (typeof window !== 'undefined') {\n return window\n } else {\n return Function('return this')()\n }\n})()\n\n// assign defines\nconst defines = __DEFINES__\nObject.keys(defines).forEach((key) => {\n const segments = key.split('.')\n let target = context\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i]\n if (i === segments.length - 1) {\n target[segment] = defines[key]\n } else {\n target = target[segment] || (target[segment] = {})\n }\n }\n})\n"],"names":[],"mappings":"AAGA,MAAM,OAAO,GAAG,CAAC;IACf,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAA;KAClB;SAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QACtC,OAAO,IAAI,CAAA;KACZ;SAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACxC,OAAO,MAAM,CAAA;KACd;SAAM;QACL,OAAO,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAA;KACjC;AACH,CAAC,GAAG,CAAA;AAEJ;AACA,MAAM,OAAO,GAAG,WAAW,CAAA;AAC3B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG;IAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAI,MAAM,GAAG,OAAO,CAAA;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC3B,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;SAC/B;aAAM;YACL,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;SACnD;KACF;AACH,CAAC,CAAC"}
|
11404
packages/astro/vite/dist/node/chunks/dep-077e5c0c.js
vendored
Normal file
11404
packages/astro/vite/dist/node/chunks/dep-077e5c0c.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
packages/astro/vite/dist/node/chunks/dep-077e5c0c.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-077e5c0c.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
8734
packages/astro/vite/dist/node/chunks/dep-68d11c39.js
vendored
Normal file
8734
packages/astro/vite/dist/node/chunks/dep-68d11c39.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
packages/astro/vite/dist/node/chunks/dep-68d11c39.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-68d11c39.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
29182
packages/astro/vite/dist/node/chunks/dep-76a5a694.js
vendored
Normal file
29182
packages/astro/vite/dist/node/chunks/dep-76a5a694.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
packages/astro/vite/dist/node/chunks/dep-76a5a694.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-76a5a694.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
531
packages/astro/vite/dist/node/chunks/dep-ac1b4bf9.js
vendored
Normal file
531
packages/astro/vite/dist/node/chunks/dep-ac1b4bf9.js
vendored
Normal file
|
@ -0,0 +1,531 @@
|
|||
'use strict';
|
||||
|
||||
var openParentheses = "(".charCodeAt(0);
|
||||
var closeParentheses = ")".charCodeAt(0);
|
||||
var singleQuote = "'".charCodeAt(0);
|
||||
var doubleQuote = '"'.charCodeAt(0);
|
||||
var backslash = "\\".charCodeAt(0);
|
||||
var slash = "/".charCodeAt(0);
|
||||
var comma = ",".charCodeAt(0);
|
||||
var colon = ":".charCodeAt(0);
|
||||
var star = "*".charCodeAt(0);
|
||||
var uLower = "u".charCodeAt(0);
|
||||
var uUpper = "U".charCodeAt(0);
|
||||
var plus$1 = "+".charCodeAt(0);
|
||||
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
||||
|
||||
var parse$1 = function(input) {
|
||||
var tokens = [];
|
||||
var value = input;
|
||||
|
||||
var next,
|
||||
quote,
|
||||
prev,
|
||||
token,
|
||||
escape,
|
||||
escapePos,
|
||||
whitespacePos,
|
||||
parenthesesOpenPos;
|
||||
var pos = 0;
|
||||
var code = value.charCodeAt(pos);
|
||||
var max = value.length;
|
||||
var stack = [{ nodes: tokens }];
|
||||
var balanced = 0;
|
||||
var parent;
|
||||
|
||||
var name = "";
|
||||
var before = "";
|
||||
var after = "";
|
||||
|
||||
while (pos < max) {
|
||||
// Whitespaces
|
||||
if (code <= 32) {
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
prev = tokens[tokens.length - 1];
|
||||
if (code === closeParentheses && balanced) {
|
||||
after = token;
|
||||
} else if (prev && prev.type === "div") {
|
||||
prev.after = token;
|
||||
} else if (
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
(code === slash &&
|
||||
value.charCodeAt(next + 1) !== star &&
|
||||
(!parent ||
|
||||
(parent && parent.type === "function" && parent.value !== "calc")))
|
||||
) {
|
||||
before = token;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "space",
|
||||
sourceIndex: pos,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
|
||||
// Quotes
|
||||
} else if (code === singleQuote || code === doubleQuote) {
|
||||
next = pos;
|
||||
quote = code === singleQuote ? "'" : '"';
|
||||
token = {
|
||||
type: "string",
|
||||
sourceIndex: pos,
|
||||
quote: quote
|
||||
};
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(quote, next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += quote;
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
token.value = value.slice(pos + 1, next);
|
||||
|
||||
tokens.push(token);
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Comments
|
||||
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
||||
token = {
|
||||
type: "comment",
|
||||
sourceIndex: pos
|
||||
};
|
||||
|
||||
next = value.indexOf("*/", pos);
|
||||
if (next === -1) {
|
||||
token.unclosed = true;
|
||||
next = value.length;
|
||||
}
|
||||
|
||||
token.value = value.slice(pos + 2, next);
|
||||
tokens.push(token);
|
||||
|
||||
pos = next + 2;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Operation within calc
|
||||
} else if (
|
||||
(code === slash || code === star) &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc"
|
||||
) {
|
||||
token = value[pos];
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos - before.length,
|
||||
value: token
|
||||
});
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Dividers
|
||||
} else if (code === slash || code === comma || code === colon) {
|
||||
token = value[pos];
|
||||
|
||||
tokens.push({
|
||||
type: "div",
|
||||
sourceIndex: pos - before.length,
|
||||
value: token,
|
||||
before: before,
|
||||
after: ""
|
||||
});
|
||||
before = "";
|
||||
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Open parentheses
|
||||
} else if (openParentheses === code) {
|
||||
// Whitespaces after open parentheses
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
parenthesesOpenPos = pos;
|
||||
token = {
|
||||
type: "function",
|
||||
sourceIndex: pos - name.length,
|
||||
value: name,
|
||||
before: value.slice(parenthesesOpenPos + 1, next)
|
||||
};
|
||||
pos = next;
|
||||
|
||||
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
||||
next -= 1;
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(")", next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += ")";
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
// Whitespaces before closed
|
||||
whitespacePos = next;
|
||||
do {
|
||||
whitespacePos -= 1;
|
||||
code = value.charCodeAt(whitespacePos);
|
||||
} while (code <= 32);
|
||||
if (parenthesesOpenPos < whitespacePos) {
|
||||
if (pos !== whitespacePos + 1) {
|
||||
token.nodes = [
|
||||
{
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
value: value.slice(pos, whitespacePos + 1)
|
||||
}
|
||||
];
|
||||
} else {
|
||||
token.nodes = [];
|
||||
}
|
||||
if (token.unclosed && whitespacePos + 1 !== next) {
|
||||
token.after = "";
|
||||
token.nodes.push({
|
||||
type: "space",
|
||||
sourceIndex: whitespacePos + 1,
|
||||
value: value.slice(whitespacePos + 1, next)
|
||||
});
|
||||
} else {
|
||||
token.after = value.slice(whitespacePos + 1, next);
|
||||
}
|
||||
} else {
|
||||
token.after = "";
|
||||
token.nodes = [];
|
||||
}
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
tokens.push(token);
|
||||
} else {
|
||||
balanced += 1;
|
||||
token.after = "";
|
||||
tokens.push(token);
|
||||
stack.push(token);
|
||||
tokens = token.nodes = [];
|
||||
parent = token;
|
||||
}
|
||||
name = "";
|
||||
|
||||
// Close parentheses
|
||||
} else if (closeParentheses === code && balanced) {
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
parent.after = after;
|
||||
after = "";
|
||||
balanced -= 1;
|
||||
stack.pop();
|
||||
parent = stack[balanced];
|
||||
tokens = parent.nodes;
|
||||
|
||||
// Words
|
||||
} else {
|
||||
next = pos;
|
||||
do {
|
||||
if (code === backslash) {
|
||||
next += 1;
|
||||
}
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (
|
||||
next < max &&
|
||||
!(
|
||||
code <= 32 ||
|
||||
code === singleQuote ||
|
||||
code === doubleQuote ||
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
code === slash ||
|
||||
code === openParentheses ||
|
||||
(code === star &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === slash &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === closeParentheses && balanced)
|
||||
)
|
||||
);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
if (openParentheses === code) {
|
||||
name = token;
|
||||
} else if (
|
||||
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
|
||||
plus$1 === token.charCodeAt(1) &&
|
||||
isUnicodeRange.test(token.slice(2))
|
||||
) {
|
||||
tokens.push({
|
||||
type: "unicode-range",
|
||||
sourceIndex: pos,
|
||||
value: token
|
||||
});
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = stack.length - 1; pos; pos -= 1) {
|
||||
stack[pos].unclosed = true;
|
||||
}
|
||||
|
||||
return stack[0].nodes;
|
||||
};
|
||||
|
||||
var walk$1 = function walk(nodes, cb, bubble) {
|
||||
var i, max, node, result;
|
||||
|
||||
for (i = 0, max = nodes.length; i < max; i += 1) {
|
||||
node = nodes[i];
|
||||
if (!bubble) {
|
||||
result = cb(node, i, nodes);
|
||||
}
|
||||
|
||||
if (
|
||||
result !== false &&
|
||||
node.type === "function" &&
|
||||
Array.isArray(node.nodes)
|
||||
) {
|
||||
walk(node.nodes, cb, bubble);
|
||||
}
|
||||
|
||||
if (bubble) {
|
||||
cb(node, i, nodes);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function stringifyNode(node, custom) {
|
||||
var type = node.type;
|
||||
var value = node.value;
|
||||
var buf;
|
||||
var customResult;
|
||||
|
||||
if (custom && (customResult = custom(node)) !== undefined) {
|
||||
return customResult;
|
||||
} else if (type === "word" || type === "space") {
|
||||
return value;
|
||||
} else if (type === "string") {
|
||||
buf = node.quote || "";
|
||||
return buf + value + (node.unclosed ? "" : buf);
|
||||
} else if (type === "comment") {
|
||||
return "/*" + value + (node.unclosed ? "" : "*/");
|
||||
} else if (type === "div") {
|
||||
return (node.before || "") + value + (node.after || "");
|
||||
} else if (Array.isArray(node.nodes)) {
|
||||
buf = stringify$1(node.nodes, custom);
|
||||
if (type !== "function") {
|
||||
return buf;
|
||||
}
|
||||
return (
|
||||
value +
|
||||
"(" +
|
||||
(node.before || "") +
|
||||
buf +
|
||||
(node.after || "") +
|
||||
(node.unclosed ? "" : ")")
|
||||
);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function stringify$1(nodes, custom) {
|
||||
var result, i;
|
||||
|
||||
if (Array.isArray(nodes)) {
|
||||
result = "";
|
||||
for (i = nodes.length - 1; ~i; i -= 1) {
|
||||
result = stringifyNode(nodes[i], custom) + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return stringifyNode(nodes, custom);
|
||||
}
|
||||
|
||||
var stringify_1 = stringify$1;
|
||||
|
||||
var minus = "-".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var dot = ".".charCodeAt(0);
|
||||
var exp = "e".charCodeAt(0);
|
||||
var EXP = "E".charCodeAt(0);
|
||||
|
||||
// Check if three code points would start a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
|
||||
function likeNumber(value) {
|
||||
var code = value.charCodeAt(0);
|
||||
var nextCode;
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var nextNextCode = value.charCodeAt(2);
|
||||
|
||||
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code === dot) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code >= 48 && code <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Consume a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#consume-number
|
||||
var unit = function(value) {
|
||||
var pos = 0;
|
||||
var length = value.length;
|
||||
var code;
|
||||
var nextCode;
|
||||
var nextNextCode;
|
||||
|
||||
if (length === 0 || !likeNumber(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
pos++;
|
||||
}
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
|
||||
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
||||
pos += 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
nextNextCode = value.charCodeAt(pos + 2);
|
||||
|
||||
if (
|
||||
(code === exp || code === EXP) &&
|
||||
((nextCode >= 48 && nextCode <= 57) ||
|
||||
((nextCode === plus || nextCode === minus) &&
|
||||
nextNextCode >= 48 &&
|
||||
nextNextCode <= 57))
|
||||
) {
|
||||
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
number: value.slice(0, pos),
|
||||
unit: value.slice(pos)
|
||||
};
|
||||
};
|
||||
|
||||
var parse = parse$1;
|
||||
var walk = walk$1;
|
||||
var stringify = stringify_1;
|
||||
|
||||
function ValueParser(value) {
|
||||
if (this instanceof ValueParser) {
|
||||
this.nodes = parse(value);
|
||||
return this;
|
||||
}
|
||||
return new ValueParser(value);
|
||||
}
|
||||
|
||||
ValueParser.prototype.toString = function() {
|
||||
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
||||
};
|
||||
|
||||
ValueParser.prototype.walk = function(cb, bubble) {
|
||||
walk(this.nodes, cb, bubble);
|
||||
return this;
|
||||
};
|
||||
|
||||
ValueParser.unit = unit;
|
||||
|
||||
ValueParser.walk = walk;
|
||||
|
||||
ValueParser.stringify = stringify;
|
||||
|
||||
var lib = ValueParser;
|
||||
|
||||
exports.lib = lib;
|
||||
//# sourceMappingURL=dep-ac1b4bf9.js.map
|
1
packages/astro/vite/dist/node/chunks/dep-ac1b4bf9.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-ac1b4bf9.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
92073
packages/astro/vite/dist/node/chunks/dep-d8f4aa6e.js
vendored
Normal file
92073
packages/astro/vite/dist/node/chunks/dep-d8f4aa6e.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
packages/astro/vite/dist/node/chunks/dep-d8f4aa6e.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-d8f4aa6e.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
746
packages/astro/vite/dist/node/chunks/dep-e39b05d6.js
vendored
Normal file
746
packages/astro/vite/dist/node/chunks/dep-e39b05d6.js
vendored
Normal file
|
@ -0,0 +1,746 @@
|
|||
'use strict';
|
||||
|
||||
var path$3 = require('path');
|
||||
var resolve$2 = require('resolve');
|
||||
var fs$1 = require('fs');
|
||||
var index$1 = require('./dep-ac1b4bf9.js');
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
|
||||
|
||||
function _mergeNamespaces(n, m) {
|
||||
for (var i = 0; i < m.length; i++) {
|
||||
var e = m[i];
|
||||
for (var k in e) {
|
||||
if (k !== 'default' && !(k in n)) {
|
||||
n[k] = e[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path$3);
|
||||
var resolve__default = /*#__PURE__*/_interopDefaultLegacy(resolve$2);
|
||||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$1);
|
||||
|
||||
var joinMedia$1 = function (parentMedia, childMedia) {
|
||||
if (!parentMedia.length && childMedia.length) return childMedia
|
||||
if (parentMedia.length && !childMedia.length) return parentMedia
|
||||
if (!parentMedia.length && !childMedia.length) return []
|
||||
|
||||
const media = [];
|
||||
|
||||
parentMedia.forEach(parentItem => {
|
||||
childMedia.forEach(childItem => {
|
||||
if (parentItem !== childItem) media.push(`${parentItem} and ${childItem}`);
|
||||
});
|
||||
});
|
||||
|
||||
return media
|
||||
};
|
||||
|
||||
// external tooling
|
||||
const resolve$1 = resolve__default;
|
||||
|
||||
const moduleDirectories = ["web_modules", "node_modules"];
|
||||
|
||||
function resolveModule(id, opts) {
|
||||
return new Promise((res, rej) => {
|
||||
resolve$1(id, opts, (err, path) => (err ? rej(err) : res(path)));
|
||||
})
|
||||
}
|
||||
|
||||
var resolveId$1 = function (id, base, options) {
|
||||
const paths = options.path;
|
||||
|
||||
const resolveOpts = {
|
||||
basedir: base,
|
||||
moduleDirectory: moduleDirectories.concat(options.addModulesDirectories),
|
||||
paths,
|
||||
extensions: [".css"],
|
||||
packageFilter: function processPackage(pkg) {
|
||||
if (pkg.style) pkg.main = pkg.style;
|
||||
else if (!pkg.main || !/\.css$/.test(pkg.main)) pkg.main = "index.css";
|
||||
return pkg
|
||||
},
|
||||
preserveSymlinks: false,
|
||||
};
|
||||
|
||||
return resolveModule(`./${id}`, resolveOpts)
|
||||
.catch(() => resolveModule(id, resolveOpts))
|
||||
.catch(() => {
|
||||
if (paths.indexOf(base) === -1) paths.unshift(base);
|
||||
|
||||
throw new Error(
|
||||
`Failed to find '${id}'
|
||||
in [
|
||||
${paths.join(",\n ")}
|
||||
]`
|
||||
)
|
||||
})
|
||||
};
|
||||
|
||||
var readCache$1 = {exports: {}};
|
||||
|
||||
var pify$2 = {exports: {}};
|
||||
|
||||
var processFn = function (fn, P, opts) {
|
||||
return function () {
|
||||
var that = this;
|
||||
var args = new Array(arguments.length);
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
return new P(function (resolve, reject) {
|
||||
args.push(function (err, result) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else if (opts.multiArgs) {
|
||||
var results = new Array(arguments.length - 1);
|
||||
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
|
||||
fn.apply(that, args);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
var pify$1 = pify$2.exports = function (obj, P, opts) {
|
||||
if (typeof P !== 'function') {
|
||||
opts = P;
|
||||
P = Promise;
|
||||
}
|
||||
|
||||
opts = opts || {};
|
||||
opts.exclude = opts.exclude || [/.+Sync$/];
|
||||
|
||||
var filter = function (key) {
|
||||
var match = function (pattern) {
|
||||
return typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
};
|
||||
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
};
|
||||
|
||||
var ret = typeof obj === 'function' ? function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, P, opts).apply(this, arguments);
|
||||
} : {};
|
||||
|
||||
return Object.keys(obj).reduce(function (ret, key) {
|
||||
var x = obj[key];
|
||||
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
|
||||
|
||||
return ret;
|
||||
}, ret);
|
||||
};
|
||||
|
||||
pify$1.all = pify$1;
|
||||
|
||||
var fs = fs__default;
|
||||
var path$2 = path__default;
|
||||
var pify = pify$2.exports;
|
||||
|
||||
var stat = pify(fs.stat);
|
||||
var readFile = pify(fs.readFile);
|
||||
var resolve = path$2.resolve;
|
||||
|
||||
var cache = Object.create(null);
|
||||
|
||||
function convert(content, encoding) {
|
||||
if (Buffer.isEncoding(encoding)) {
|
||||
return content.toString(encoding);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
readCache$1.exports = function (path, encoding) {
|
||||
path = resolve(path);
|
||||
|
||||
return stat(path).then(function (stats) {
|
||||
var item = cache[path];
|
||||
|
||||
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
|
||||
return convert(item.content, encoding);
|
||||
}
|
||||
|
||||
return readFile(path).then(function (data) {
|
||||
cache[path] = {
|
||||
mtime: stats.mtime,
|
||||
content: data
|
||||
};
|
||||
|
||||
return convert(data, encoding);
|
||||
});
|
||||
}).catch(function (err) {
|
||||
cache[path] = null;
|
||||
return Promise.reject(err);
|
||||
});
|
||||
};
|
||||
|
||||
readCache$1.exports.sync = function (path, encoding) {
|
||||
path = resolve(path);
|
||||
|
||||
try {
|
||||
var stats = fs.statSync(path);
|
||||
var item = cache[path];
|
||||
|
||||
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
|
||||
return convert(item.content, encoding);
|
||||
}
|
||||
|
||||
var data = fs.readFileSync(path);
|
||||
|
||||
cache[path] = {
|
||||
mtime: stats.mtime,
|
||||
content: data
|
||||
};
|
||||
|
||||
return convert(data, encoding);
|
||||
} catch (err) {
|
||||
cache[path] = null;
|
||||
throw err;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
readCache$1.exports.get = function (path, encoding) {
|
||||
path = resolve(path);
|
||||
if (cache[path]) {
|
||||
return convert(cache[path].content, encoding);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
readCache$1.exports.clear = function () {
|
||||
cache = Object.create(null);
|
||||
};
|
||||
|
||||
const readCache = readCache$1.exports;
|
||||
|
||||
var loadContent$1 = filename => readCache(filename, "utf-8");
|
||||
|
||||
// builtin tooling
|
||||
const path$1 = path__default;
|
||||
|
||||
// placeholder tooling
|
||||
let sugarss;
|
||||
|
||||
var processContent$1 = function processContent(
|
||||
result,
|
||||
content,
|
||||
filename,
|
||||
options,
|
||||
postcss
|
||||
) {
|
||||
const { plugins } = options;
|
||||
const ext = path$1.extname(filename);
|
||||
|
||||
const parserList = [];
|
||||
|
||||
// SugarSS support:
|
||||
if (ext === ".sss") {
|
||||
if (!sugarss) {
|
||||
try {
|
||||
sugarss = eval('require')('sugarss');
|
||||
} catch {} // Ignore
|
||||
}
|
||||
if (sugarss)
|
||||
return runPostcss(postcss, content, filename, plugins, [sugarss])
|
||||
}
|
||||
|
||||
// Syntax support:
|
||||
if (result.opts.syntax && result.opts.syntax.parse) {
|
||||
parserList.push(result.opts.syntax.parse);
|
||||
}
|
||||
|
||||
// Parser support:
|
||||
if (result.opts.parser) parserList.push(result.opts.parser);
|
||||
// Try the default as a last resort:
|
||||
parserList.push(null);
|
||||
|
||||
return runPostcss(postcss, content, filename, plugins, parserList)
|
||||
};
|
||||
|
||||
function runPostcss(postcss, content, filename, plugins, parsers, index) {
|
||||
if (!index) index = 0;
|
||||
return postcss(plugins)
|
||||
.process(content, {
|
||||
from: filename,
|
||||
parser: parsers[index],
|
||||
})
|
||||
.catch(err => {
|
||||
// If there's an error, try the next parser
|
||||
index++;
|
||||
// If there are no parsers left, throw it
|
||||
if (index === parsers.length) throw err
|
||||
return runPostcss(postcss, content, filename, plugins, parsers, index)
|
||||
})
|
||||
}
|
||||
|
||||
// external tooling
|
||||
const valueParser = index$1.lib;
|
||||
|
||||
// extended tooling
|
||||
const { stringify } = valueParser;
|
||||
|
||||
function split(params, start) {
|
||||
const list = [];
|
||||
const last = params.reduce((item, node, index) => {
|
||||
if (index < start) return ""
|
||||
if (node.type === "div" && node.value === ",") {
|
||||
list.push(item);
|
||||
return ""
|
||||
}
|
||||
return item + stringify(node)
|
||||
}, "");
|
||||
list.push(last);
|
||||
return list
|
||||
}
|
||||
|
||||
var parseStatements$1 = function (result, styles) {
|
||||
const statements = [];
|
||||
let nodes = [];
|
||||
|
||||
styles.each(node => {
|
||||
let stmt;
|
||||
if (node.type === "atrule") {
|
||||
if (node.name === "import") stmt = parseImport(result, node);
|
||||
else if (node.name === "media") stmt = parseMedia(result, node);
|
||||
else if (node.name === "charset") stmt = parseCharset(result, node);
|
||||
}
|
||||
|
||||
if (stmt) {
|
||||
if (nodes.length) {
|
||||
statements.push({
|
||||
type: "nodes",
|
||||
nodes,
|
||||
media: [],
|
||||
});
|
||||
nodes = [];
|
||||
}
|
||||
statements.push(stmt);
|
||||
} else nodes.push(node);
|
||||
});
|
||||
|
||||
if (nodes.length) {
|
||||
statements.push({
|
||||
type: "nodes",
|
||||
nodes,
|
||||
media: [],
|
||||
});
|
||||
}
|
||||
|
||||
return statements
|
||||
};
|
||||
|
||||
function parseMedia(result, atRule) {
|
||||
const params = valueParser(atRule.params).nodes;
|
||||
return {
|
||||
type: "media",
|
||||
node: atRule,
|
||||
media: split(params, 0),
|
||||
}
|
||||
}
|
||||
|
||||
function parseCharset(result, atRule) {
|
||||
if (atRule.prev()) {
|
||||
return result.warn("@charset must precede all other statements", {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
return {
|
||||
type: "charset",
|
||||
node: atRule,
|
||||
media: [],
|
||||
}
|
||||
}
|
||||
|
||||
function parseImport(result, atRule) {
|
||||
let prev = atRule.prev();
|
||||
if (prev) {
|
||||
do {
|
||||
if (
|
||||
prev.type !== "comment" &&
|
||||
(prev.type !== "atrule" ||
|
||||
(prev.name !== "import" && prev.name !== "charset"))
|
||||
) {
|
||||
return result.warn(
|
||||
"@import must precede all other statements (besides @charset)",
|
||||
{ node: atRule }
|
||||
)
|
||||
}
|
||||
prev = prev.prev();
|
||||
} while (prev)
|
||||
}
|
||||
|
||||
if (atRule.nodes) {
|
||||
return result.warn(
|
||||
"It looks like you didn't end your @import statement correctly. " +
|
||||
"Child nodes are attached to it.",
|
||||
{ node: atRule }
|
||||
)
|
||||
}
|
||||
|
||||
const params = valueParser(atRule.params).nodes;
|
||||
const stmt = {
|
||||
type: "import",
|
||||
node: atRule,
|
||||
media: [],
|
||||
};
|
||||
|
||||
// prettier-ignore
|
||||
if (
|
||||
!params.length ||
|
||||
(
|
||||
params[0].type !== "string" ||
|
||||
!params[0].value
|
||||
) &&
|
||||
(
|
||||
params[0].type !== "function" ||
|
||||
params[0].value !== "url" ||
|
||||
!params[0].nodes.length ||
|
||||
!params[0].nodes[0].value
|
||||
)
|
||||
) {
|
||||
return result.warn(`Unable to find uri in '${ atRule.toString() }'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (params[0].type === "string") stmt.uri = params[0].value;
|
||||
else stmt.uri = params[0].nodes[0].value;
|
||||
stmt.fullUri = stringify(params[0]);
|
||||
|
||||
if (params.length > 2) {
|
||||
if (params[1].type !== "space") {
|
||||
return result.warn("Invalid import media statement", { node: atRule })
|
||||
}
|
||||
stmt.media = split(params, 2);
|
||||
}
|
||||
|
||||
return stmt
|
||||
}
|
||||
|
||||
// builtin tooling
|
||||
const path = path__default;
|
||||
|
||||
// internal tooling
|
||||
const joinMedia = joinMedia$1;
|
||||
const resolveId = resolveId$1;
|
||||
const loadContent = loadContent$1;
|
||||
const processContent = processContent$1;
|
||||
const parseStatements = parseStatements$1;
|
||||
|
||||
function AtImport(options) {
|
||||
options = {
|
||||
root: process.cwd(),
|
||||
path: [],
|
||||
skipDuplicates: true,
|
||||
resolve: resolveId,
|
||||
load: loadContent,
|
||||
plugins: [],
|
||||
addModulesDirectories: [],
|
||||
...options,
|
||||
};
|
||||
|
||||
options.root = path.resolve(options.root);
|
||||
|
||||
// convert string to an array of a single element
|
||||
if (typeof options.path === "string") options.path = [options.path];
|
||||
|
||||
if (!Array.isArray(options.path)) options.path = [];
|
||||
|
||||
options.path = options.path.map(p => path.resolve(options.root, p));
|
||||
|
||||
return {
|
||||
postcssPlugin: "postcss-import",
|
||||
Once(styles, { result, atRule, postcss }) {
|
||||
const state = {
|
||||
importedFiles: {},
|
||||
hashFiles: {},
|
||||
};
|
||||
|
||||
if (styles.source && styles.source.input && styles.source.input.file) {
|
||||
state.importedFiles[styles.source.input.file] = {};
|
||||
}
|
||||
|
||||
if (options.plugins && !Array.isArray(options.plugins)) {
|
||||
throw new Error("plugins option must be an array")
|
||||
}
|
||||
|
||||
return parseStyles(result, styles, options, state, []).then(bundle => {
|
||||
applyRaws(bundle);
|
||||
applyMedia(bundle);
|
||||
applyStyles(bundle, styles);
|
||||
})
|
||||
|
||||
function applyRaws(bundle) {
|
||||
bundle.forEach((stmt, index) => {
|
||||
if (index === 0) return
|
||||
|
||||
if (stmt.parent) {
|
||||
const { before } = stmt.parent.node.raws;
|
||||
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before;
|
||||
else stmt.node.raws.before = before;
|
||||
} else if (stmt.type === "nodes") {
|
||||
stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function applyMedia(bundle) {
|
||||
bundle.forEach(stmt => {
|
||||
if (!stmt.media.length || stmt.type === "charset") return
|
||||
if (stmt.type === "import") {
|
||||
stmt.node.params = `${stmt.fullUri} ${stmt.media.join(", ")}`;
|
||||
} else if (stmt.type === "media")
|
||||
stmt.node.params = stmt.media.join(", ");
|
||||
else {
|
||||
const { nodes } = stmt;
|
||||
const { parent } = nodes[0];
|
||||
const mediaNode = atRule({
|
||||
name: "media",
|
||||
params: stmt.media.join(", "),
|
||||
source: parent.source,
|
||||
});
|
||||
|
||||
parent.insertBefore(nodes[0], mediaNode);
|
||||
|
||||
// remove nodes
|
||||
nodes.forEach(node => {
|
||||
node.parent = undefined;
|
||||
});
|
||||
|
||||
// better output
|
||||
nodes[0].raws.before = nodes[0].raws.before || "\n";
|
||||
|
||||
// wrap new rules with media query
|
||||
mediaNode.append(nodes);
|
||||
|
||||
stmt.type = "media";
|
||||
stmt.node = mediaNode;
|
||||
delete stmt.nodes;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function applyStyles(bundle, styles) {
|
||||
styles.nodes = [];
|
||||
|
||||
// Strip additional statements.
|
||||
bundle.forEach(stmt => {
|
||||
if (["charset", "import", "media"].includes(stmt.type)) {
|
||||
stmt.node.parent = undefined;
|
||||
styles.append(stmt.node);
|
||||
} else if (stmt.type === "nodes") {
|
||||
stmt.nodes.forEach(node => {
|
||||
node.parent = undefined;
|
||||
styles.append(node);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parseStyles(result, styles, options, state, media) {
|
||||
const statements = parseStatements(result, styles);
|
||||
|
||||
return Promise.resolve(statements)
|
||||
.then(stmts => {
|
||||
// process each statement in series
|
||||
return stmts.reduce((promise, stmt) => {
|
||||
return promise.then(() => {
|
||||
stmt.media = joinMedia(media, stmt.media || []);
|
||||
|
||||
// skip protocol base uri (protocol://url) or protocol-relative
|
||||
if (
|
||||
stmt.type !== "import" ||
|
||||
/^(?:[a-z]+:)?\/\//i.test(stmt.uri)
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (options.filter && !options.filter(stmt.uri)) {
|
||||
// rejected by filter
|
||||
return
|
||||
}
|
||||
|
||||
return resolveImportId(result, stmt, options, state)
|
||||
})
|
||||
}, Promise.resolve())
|
||||
})
|
||||
.then(() => {
|
||||
let charset;
|
||||
const imports = [];
|
||||
const bundle = [];
|
||||
|
||||
function handleCharset(stmt) {
|
||||
if (!charset) charset = stmt;
|
||||
// charsets aren't case-sensitive, so convert to lower case to compare
|
||||
else if (
|
||||
stmt.node.params.toLowerCase() !==
|
||||
charset.node.params.toLowerCase()
|
||||
) {
|
||||
throw new Error(
|
||||
`Incompatable @charset statements:
|
||||
${stmt.node.params} specified in ${stmt.node.source.input.file}
|
||||
${charset.node.params} specified in ${charset.node.source.input.file}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// squash statements and their children
|
||||
statements.forEach(stmt => {
|
||||
if (stmt.type === "charset") handleCharset(stmt);
|
||||
else if (stmt.type === "import") {
|
||||
if (stmt.children) {
|
||||
stmt.children.forEach((child, index) => {
|
||||
if (child.type === "import") imports.push(child);
|
||||
else if (child.type === "charset") handleCharset(child);
|
||||
else bundle.push(child);
|
||||
// For better output
|
||||
if (index === 0) child.parent = stmt;
|
||||
});
|
||||
} else imports.push(stmt);
|
||||
} else if (stmt.type === "media" || stmt.type === "nodes") {
|
||||
bundle.push(stmt);
|
||||
}
|
||||
});
|
||||
|
||||
return charset
|
||||
? [charset, ...imports.concat(bundle)]
|
||||
: imports.concat(bundle)
|
||||
})
|
||||
}
|
||||
|
||||
function resolveImportId(result, stmt, options, state) {
|
||||
const atRule = stmt.node;
|
||||
let sourceFile;
|
||||
if (atRule.source && atRule.source.input && atRule.source.input.file) {
|
||||
sourceFile = atRule.source.input.file;
|
||||
}
|
||||
const base = sourceFile
|
||||
? path.dirname(atRule.source.input.file)
|
||||
: options.root;
|
||||
|
||||
return Promise.resolve(options.resolve(stmt.uri, base, options))
|
||||
.then(paths => {
|
||||
if (!Array.isArray(paths)) paths = [paths];
|
||||
// Ensure that each path is absolute:
|
||||
return Promise.all(
|
||||
paths.map(file => {
|
||||
return !path.isAbsolute(file)
|
||||
? resolveId(file, base, options)
|
||||
: file
|
||||
})
|
||||
)
|
||||
})
|
||||
.then(resolved => {
|
||||
// Add dependency messages:
|
||||
resolved.forEach(file => {
|
||||
result.messages.push({
|
||||
type: "dependency",
|
||||
plugin: "postcss-import",
|
||||
file,
|
||||
parent: sourceFile,
|
||||
});
|
||||
});
|
||||
|
||||
return Promise.all(
|
||||
resolved.map(file => {
|
||||
return loadImportContent(result, stmt, file, options, state)
|
||||
})
|
||||
)
|
||||
})
|
||||
.then(result => {
|
||||
// Merge loaded statements
|
||||
stmt.children = result.reduce((result, statements) => {
|
||||
return statements ? result.concat(statements) : result
|
||||
}, []);
|
||||
})
|
||||
}
|
||||
|
||||
function loadImportContent(result, stmt, filename, options, state) {
|
||||
const atRule = stmt.node;
|
||||
const { media } = stmt;
|
||||
if (options.skipDuplicates) {
|
||||
// skip files already imported at the same scope
|
||||
if (
|
||||
state.importedFiles[filename] &&
|
||||
state.importedFiles[filename][media]
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
// save imported files to skip them next time
|
||||
if (!state.importedFiles[filename]) state.importedFiles[filename] = {};
|
||||
state.importedFiles[filename][media] = true;
|
||||
}
|
||||
|
||||
return Promise.resolve(options.load(filename, options)).then(
|
||||
content => {
|
||||
if (content.trim() === "") {
|
||||
result.warn(`${filename} is empty`, { node: atRule });
|
||||
return
|
||||
}
|
||||
|
||||
// skip previous imported files not containing @import rules
|
||||
if (state.hashFiles[content] && state.hashFiles[content][media])
|
||||
return
|
||||
|
||||
return processContent(
|
||||
result,
|
||||
content,
|
||||
filename,
|
||||
options,
|
||||
postcss
|
||||
).then(importedResult => {
|
||||
const styles = importedResult.root;
|
||||
result.messages = result.messages.concat(importedResult.messages);
|
||||
|
||||
if (options.skipDuplicates) {
|
||||
const hasImport = styles.some(child => {
|
||||
return child.type === "atrule" && child.name === "import"
|
||||
});
|
||||
if (!hasImport) {
|
||||
// save hash files to skip them next time
|
||||
if (!state.hashFiles[content]) state.hashFiles[content] = {};
|
||||
state.hashFiles[content][media] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// recursion: import @import from imported file
|
||||
return parseStyles(result, styles, options, state, media)
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
AtImport.postcss = true;
|
||||
|
||||
var postcssImport = AtImport;
|
||||
|
||||
var index = /*#__PURE__*/_mergeNamespaces({
|
||||
__proto__: null,
|
||||
'default': postcssImport
|
||||
}, [postcssImport]);
|
||||
|
||||
exports.index = index;
|
||||
//# sourceMappingURL=dep-e39b05d6.js.map
|
1
packages/astro/vite/dist/node/chunks/dep-e39b05d6.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/chunks/dep-e39b05d6.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
803
packages/astro/vite/dist/node/cli.js
vendored
Normal file
803
packages/astro/vite/dist/node/cli.js
vendored
Normal file
|
@ -0,0 +1,803 @@
|
|||
'use strict';
|
||||
|
||||
var require$$0 = require('events');
|
||||
var build = require('./chunks/dep-d8f4aa6e.js');
|
||||
var perf_hooks = require('perf_hooks');
|
||||
require('fs');
|
||||
require('path');
|
||||
require('util');
|
||||
require('stream');
|
||||
require('os');
|
||||
require('url');
|
||||
require('crypto');
|
||||
require('module');
|
||||
require('esbuild');
|
||||
require('worker_threads');
|
||||
require('assert');
|
||||
require('child_process');
|
||||
require('readline');
|
||||
require('zlib');
|
||||
require('resolve');
|
||||
require('querystring');
|
||||
require('tty');
|
||||
require('net');
|
||||
require('http');
|
||||
require('buffer');
|
||||
require('https');
|
||||
require('tls');
|
||||
|
||||
function toArr(any) {
|
||||
return any == null ? [] : Array.isArray(any) ? any : [any];
|
||||
}
|
||||
|
||||
function toVal(out, key, val, opts) {
|
||||
var x, old=out[key], nxt=(
|
||||
!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))
|
||||
: typeof val === 'boolean' ? val
|
||||
: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))
|
||||
: (x = +val,x * 0 === 0) ? x : val
|
||||
);
|
||||
out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);
|
||||
}
|
||||
|
||||
function mri2 (args, opts) {
|
||||
args = args || [];
|
||||
opts = opts || {};
|
||||
|
||||
var k, arr, arg, name, val, out={ _:[] };
|
||||
var i=0, j=0, idx=0, len=args.length;
|
||||
|
||||
const alibi = opts.alias !== void 0;
|
||||
const strict = opts.unknown !== void 0;
|
||||
const defaults = opts.default !== void 0;
|
||||
|
||||
opts.alias = opts.alias || {};
|
||||
opts.string = toArr(opts.string);
|
||||
opts.boolean = toArr(opts.boolean);
|
||||
|
||||
if (alibi) {
|
||||
for (k in opts.alias) {
|
||||
arr = opts.alias[k] = toArr(opts.alias[k]);
|
||||
for (i=0; i < arr.length; i++) {
|
||||
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=opts.boolean.length; i-- > 0;) {
|
||||
arr = opts.alias[opts.boolean[i]] || [];
|
||||
for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
||||
}
|
||||
|
||||
for (i=opts.string.length; i-- > 0;) {
|
||||
arr = opts.alias[opts.string[i]] || [];
|
||||
for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);
|
||||
}
|
||||
|
||||
if (defaults) {
|
||||
for (k in opts.default) {
|
||||
name = typeof opts.default[k];
|
||||
arr = opts.alias[k] = opts.alias[k] || [];
|
||||
if (opts[name] !== void 0) {
|
||||
opts[name].push(k);
|
||||
for (i=0; i < arr.length; i++) {
|
||||
opts[name].push(arr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const keys = strict ? Object.keys(opts.alias) : [];
|
||||
|
||||
for (i=0; i < len; i++) {
|
||||
arg = args[i];
|
||||
|
||||
if (arg === '--') {
|
||||
out._ = out._.concat(args.slice(++i));
|
||||
break;
|
||||
}
|
||||
|
||||
for (j=0; j < arg.length; j++) {
|
||||
if (arg.charCodeAt(j) !== 45) break; // "-"
|
||||
}
|
||||
|
||||
if (j === 0) {
|
||||
out._.push(arg);
|
||||
} else if (arg.substring(j, j + 3) === 'no-') {
|
||||
name = arg.substring(j + 3);
|
||||
if (strict && !~keys.indexOf(name)) {
|
||||
return opts.unknown(arg);
|
||||
}
|
||||
out[name] = false;
|
||||
} else {
|
||||
for (idx=j+1; idx < arg.length; idx++) {
|
||||
if (arg.charCodeAt(idx) === 61) break; // "="
|
||||
}
|
||||
|
||||
name = arg.substring(j, idx);
|
||||
val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);
|
||||
arr = (j === 2 ? [name] : name);
|
||||
|
||||
for (idx=0; idx < arr.length; idx++) {
|
||||
name = arr[idx];
|
||||
if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
|
||||
toVal(out, name, (idx + 1 < arr.length) || val, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaults) {
|
||||
for (k in opts.default) {
|
||||
if (out[k] === void 0) {
|
||||
out[k] = opts.default[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (alibi) {
|
||||
for (k in out) {
|
||||
arr = opts.alias[k] || [];
|
||||
while (arr.length > 0) {
|
||||
out[arr.shift()] = out[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
|
||||
const findAllBrackets = (v) => {
|
||||
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
||||
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
||||
const res = [];
|
||||
const parse = (match) => {
|
||||
let variadic = false;
|
||||
let value = match[1];
|
||||
if (value.startsWith("...")) {
|
||||
value = value.slice(3);
|
||||
variadic = true;
|
||||
}
|
||||
return {
|
||||
required: match[0].startsWith("<"),
|
||||
value,
|
||||
variadic
|
||||
};
|
||||
};
|
||||
let angledMatch;
|
||||
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
|
||||
res.push(parse(angledMatch));
|
||||
}
|
||||
let squareMatch;
|
||||
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
|
||||
res.push(parse(squareMatch));
|
||||
}
|
||||
return res;
|
||||
};
|
||||
const getMriOptions = (options) => {
|
||||
const result = {alias: {}, boolean: []};
|
||||
for (const [index, option] of options.entries()) {
|
||||
if (option.names.length > 1) {
|
||||
result.alias[option.names[0]] = option.names.slice(1);
|
||||
}
|
||||
if (option.isBoolean) {
|
||||
if (option.negated) {
|
||||
const hasStringTypeOption = options.some((o, i) => {
|
||||
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
||||
});
|
||||
if (!hasStringTypeOption) {
|
||||
result.boolean.push(option.names[0]);
|
||||
}
|
||||
} else {
|
||||
result.boolean.push(option.names[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const findLongest = (arr) => {
|
||||
return arr.sort((a, b) => {
|
||||
return a.length > b.length ? -1 : 1;
|
||||
})[0];
|
||||
};
|
||||
const padRight = (str, length) => {
|
||||
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
||||
};
|
||||
const camelcase = (input) => {
|
||||
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
||||
return p1 + p2.toUpperCase();
|
||||
});
|
||||
};
|
||||
const setDotProp = (obj, keys, val) => {
|
||||
let i = 0;
|
||||
let length = keys.length;
|
||||
let t = obj;
|
||||
let x;
|
||||
for (; i < length; ++i) {
|
||||
x = t[keys[i]];
|
||||
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
|
||||
}
|
||||
};
|
||||
const setByType = (obj, transforms) => {
|
||||
for (const key of Object.keys(transforms)) {
|
||||
const transform = transforms[key];
|
||||
if (transform.shouldTransform) {
|
||||
obj[key] = Array.prototype.concat.call([], obj[key]);
|
||||
if (typeof transform.transformFunction === "function") {
|
||||
obj[key] = obj[key].map(transform.transformFunction);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const getFileName = (input) => {
|
||||
const m = /([^\\\/]+)$/.exec(input);
|
||||
return m ? m[1] : "";
|
||||
};
|
||||
const camelcaseOptionName = (name) => {
|
||||
return name.split(".").map((v, i) => {
|
||||
return i === 0 ? camelcase(v) : v;
|
||||
}).join(".");
|
||||
};
|
||||
class CACError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = this.constructor.name;
|
||||
if (typeof Error.captureStackTrace === "function") {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
} else {
|
||||
this.stack = new Error(message).stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Option {
|
||||
constructor(rawName, description, config) {
|
||||
this.rawName = rawName;
|
||||
this.description = description;
|
||||
this.config = Object.assign({}, config);
|
||||
rawName = rawName.replace(/\.\*/g, "");
|
||||
this.negated = false;
|
||||
this.names = removeBrackets(rawName).split(",").map((v) => {
|
||||
let name = v.trim().replace(/^-{1,2}/, "");
|
||||
if (name.startsWith("no-")) {
|
||||
this.negated = true;
|
||||
name = name.replace(/^no-/, "");
|
||||
}
|
||||
return camelcaseOptionName(name);
|
||||
}).sort((a, b) => a.length > b.length ? 1 : -1);
|
||||
this.name = this.names[this.names.length - 1];
|
||||
if (this.negated && this.config.default == null) {
|
||||
this.config.default = true;
|
||||
}
|
||||
if (rawName.includes("<")) {
|
||||
this.required = true;
|
||||
} else if (rawName.includes("[")) {
|
||||
this.required = false;
|
||||
} else {
|
||||
this.isBoolean = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const processArgs = process.argv;
|
||||
const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
||||
|
||||
class Command {
|
||||
constructor(rawName, description, config = {}, cli) {
|
||||
this.rawName = rawName;
|
||||
this.description = description;
|
||||
this.config = config;
|
||||
this.cli = cli;
|
||||
this.options = [];
|
||||
this.aliasNames = [];
|
||||
this.name = removeBrackets(rawName);
|
||||
this.args = findAllBrackets(rawName);
|
||||
this.examples = [];
|
||||
}
|
||||
usage(text) {
|
||||
this.usageText = text;
|
||||
return this;
|
||||
}
|
||||
allowUnknownOptions() {
|
||||
this.config.allowUnknownOptions = true;
|
||||
return this;
|
||||
}
|
||||
ignoreOptionDefaultValue() {
|
||||
this.config.ignoreOptionDefaultValue = true;
|
||||
return this;
|
||||
}
|
||||
version(version, customFlags = "-v, --version") {
|
||||
this.versionNumber = version;
|
||||
this.option(customFlags, "Display version number");
|
||||
return this;
|
||||
}
|
||||
example(example) {
|
||||
this.examples.push(example);
|
||||
return this;
|
||||
}
|
||||
option(rawName, description, config) {
|
||||
const option = new Option(rawName, description, config);
|
||||
this.options.push(option);
|
||||
return this;
|
||||
}
|
||||
alias(name) {
|
||||
this.aliasNames.push(name);
|
||||
return this;
|
||||
}
|
||||
action(callback) {
|
||||
this.commandAction = callback;
|
||||
return this;
|
||||
}
|
||||
isMatched(name) {
|
||||
return this.name === name || this.aliasNames.includes(name);
|
||||
}
|
||||
get isDefaultCommand() {
|
||||
return this.name === "" || this.aliasNames.includes("!");
|
||||
}
|
||||
get isGlobalCommand() {
|
||||
return this instanceof GlobalCommand;
|
||||
}
|
||||
hasOption(name) {
|
||||
name = name.split(".")[0];
|
||||
return this.options.find((option) => {
|
||||
return option.names.includes(name);
|
||||
});
|
||||
}
|
||||
outputHelp() {
|
||||
const {name, commands} = this.cli;
|
||||
const {
|
||||
versionNumber,
|
||||
options: globalOptions,
|
||||
helpCallback
|
||||
} = this.cli.globalCommand;
|
||||
let sections = [
|
||||
{
|
||||
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
|
||||
}
|
||||
];
|
||||
sections.push({
|
||||
title: "Usage",
|
||||
body: ` $ ${name} ${this.usageText || this.rawName}`
|
||||
});
|
||||
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
|
||||
if (showCommands) {
|
||||
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
||||
sections.push({
|
||||
title: "Commands",
|
||||
body: commands.map((command) => {
|
||||
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
|
||||
}).join("\n")
|
||||
});
|
||||
sections.push({
|
||||
title: `For more info, run any command with the \`--help\` flag`,
|
||||
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
|
||||
});
|
||||
}
|
||||
const options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
|
||||
if (options.length > 0) {
|
||||
const longestOptionName = findLongest(options.map((option) => option.rawName));
|
||||
sections.push({
|
||||
title: "Options",
|
||||
body: options.map((option) => {
|
||||
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
|
||||
}).join("\n")
|
||||
});
|
||||
}
|
||||
if (this.examples.length > 0) {
|
||||
sections.push({
|
||||
title: "Examples",
|
||||
body: this.examples.map((example) => {
|
||||
if (typeof example === "function") {
|
||||
return example(name);
|
||||
}
|
||||
return example;
|
||||
}).join("\n")
|
||||
});
|
||||
}
|
||||
if (helpCallback) {
|
||||
sections = helpCallback(sections) || sections;
|
||||
}
|
||||
console.log(sections.map((section) => {
|
||||
return section.title ? `${section.title}:
|
||||
${section.body}` : section.body;
|
||||
}).join("\n\n"));
|
||||
}
|
||||
outputVersion() {
|
||||
const {name} = this.cli;
|
||||
const {versionNumber} = this.cli.globalCommand;
|
||||
if (versionNumber) {
|
||||
console.log(`${name}/${versionNumber} ${platformInfo}`);
|
||||
}
|
||||
}
|
||||
checkRequiredArgs() {
|
||||
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
|
||||
if (this.cli.args.length < minimalArgsCount) {
|
||||
throw new CACError(`missing required args for command \`${this.rawName}\``);
|
||||
}
|
||||
}
|
||||
checkUnknownOptions() {
|
||||
const {options, globalCommand} = this.cli;
|
||||
if (!this.config.allowUnknownOptions) {
|
||||
for (const name of Object.keys(options)) {
|
||||
if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) {
|
||||
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checkOptionValue() {
|
||||
const {options: parsedOptions, globalCommand} = this.cli;
|
||||
const options = [...globalCommand.options, ...this.options];
|
||||
for (const option of options) {
|
||||
const value = parsedOptions[option.name.split(".")[0]];
|
||||
if (option.required) {
|
||||
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
||||
if (value === true || value === false && !hasNegated) {
|
||||
throw new CACError(`option \`${option.rawName}\` value is missing`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
class GlobalCommand extends Command {
|
||||
constructor(cli) {
|
||||
super("@@global@@", "", {}, cli);
|
||||
}
|
||||
}
|
||||
|
||||
var __assign = Object.assign;
|
||||
class CAC extends require$$0.EventEmitter {
|
||||
constructor(name = "") {
|
||||
super();
|
||||
this.name = name;
|
||||
this.commands = [];
|
||||
this.rawArgs = [];
|
||||
this.args = [];
|
||||
this.options = {};
|
||||
this.globalCommand = new GlobalCommand(this);
|
||||
this.globalCommand.usage("<command> [options]");
|
||||
}
|
||||
usage(text) {
|
||||
this.globalCommand.usage(text);
|
||||
return this;
|
||||
}
|
||||
command(rawName, description, config) {
|
||||
const command = new Command(rawName, description || "", config, this);
|
||||
command.globalCommand = this.globalCommand;
|
||||
this.commands.push(command);
|
||||
return command;
|
||||
}
|
||||
option(rawName, description, config) {
|
||||
this.globalCommand.option(rawName, description, config);
|
||||
return this;
|
||||
}
|
||||
help(callback) {
|
||||
this.globalCommand.option("-h, --help", "Display this message");
|
||||
this.globalCommand.helpCallback = callback;
|
||||
this.showHelpOnExit = true;
|
||||
return this;
|
||||
}
|
||||
version(version, customFlags = "-v, --version") {
|
||||
this.globalCommand.version(version, customFlags);
|
||||
this.showVersionOnExit = true;
|
||||
return this;
|
||||
}
|
||||
example(example) {
|
||||
this.globalCommand.example(example);
|
||||
return this;
|
||||
}
|
||||
outputHelp() {
|
||||
if (this.matchedCommand) {
|
||||
this.matchedCommand.outputHelp();
|
||||
} else {
|
||||
this.globalCommand.outputHelp();
|
||||
}
|
||||
}
|
||||
outputVersion() {
|
||||
this.globalCommand.outputVersion();
|
||||
}
|
||||
setParsedInfo({args, options}, matchedCommand, matchedCommandName) {
|
||||
this.args = args;
|
||||
this.options = options;
|
||||
if (matchedCommand) {
|
||||
this.matchedCommand = matchedCommand;
|
||||
}
|
||||
if (matchedCommandName) {
|
||||
this.matchedCommandName = matchedCommandName;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
unsetMatchedCommand() {
|
||||
this.matchedCommand = void 0;
|
||||
this.matchedCommandName = void 0;
|
||||
}
|
||||
parse(argv = processArgs, {
|
||||
run = true
|
||||
} = {}) {
|
||||
this.rawArgs = argv;
|
||||
if (!this.name) {
|
||||
this.name = argv[1] ? getFileName(argv[1]) : "cli";
|
||||
}
|
||||
let shouldParse = true;
|
||||
for (const command of this.commands) {
|
||||
const parsed = this.mri(argv.slice(2), command);
|
||||
const commandName = parsed.args[0];
|
||||
if (command.isMatched(commandName)) {
|
||||
shouldParse = false;
|
||||
const parsedInfo = __assign(__assign({}, parsed), {
|
||||
args: parsed.args.slice(1)
|
||||
});
|
||||
this.setParsedInfo(parsedInfo, command, commandName);
|
||||
this.emit(`command:${commandName}`, command);
|
||||
}
|
||||
}
|
||||
if (shouldParse) {
|
||||
for (const command of this.commands) {
|
||||
if (command.name === "") {
|
||||
shouldParse = false;
|
||||
const parsed = this.mri(argv.slice(2), command);
|
||||
this.setParsedInfo(parsed, command);
|
||||
this.emit(`command:!`, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shouldParse) {
|
||||
const parsed = this.mri(argv.slice(2));
|
||||
this.setParsedInfo(parsed);
|
||||
}
|
||||
if (this.options.help && this.showHelpOnExit) {
|
||||
this.outputHelp();
|
||||
run = false;
|
||||
this.unsetMatchedCommand();
|
||||
}
|
||||
if (this.options.version && this.showVersionOnExit) {
|
||||
this.outputVersion();
|
||||
run = false;
|
||||
this.unsetMatchedCommand();
|
||||
}
|
||||
const parsedArgv = {args: this.args, options: this.options};
|
||||
if (run) {
|
||||
this.runMatchedCommand();
|
||||
}
|
||||
if (!this.matchedCommand && this.args[0]) {
|
||||
this.emit("command:*");
|
||||
}
|
||||
return parsedArgv;
|
||||
}
|
||||
mri(argv, command) {
|
||||
const cliOptions = [
|
||||
...this.globalCommand.options,
|
||||
...command ? command.options : []
|
||||
];
|
||||
const mriOptions = getMriOptions(cliOptions);
|
||||
let argsAfterDoubleDashes = [];
|
||||
const doubleDashesIndex = argv.indexOf("--");
|
||||
if (doubleDashesIndex > -1) {
|
||||
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
|
||||
argv = argv.slice(0, doubleDashesIndex);
|
||||
}
|
||||
let parsed = mri2(argv, mriOptions);
|
||||
parsed = Object.keys(parsed).reduce((res, name) => {
|
||||
return __assign(__assign({}, res), {
|
||||
[camelcaseOptionName(name)]: parsed[name]
|
||||
});
|
||||
}, {_: []});
|
||||
const args = parsed._;
|
||||
const options = {
|
||||
"--": argsAfterDoubleDashes
|
||||
};
|
||||
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
||||
let transforms = Object.create(null);
|
||||
for (const cliOption of cliOptions) {
|
||||
if (!ignoreDefault && cliOption.config.default !== void 0) {
|
||||
for (const name of cliOption.names) {
|
||||
options[name] = cliOption.config.default;
|
||||
}
|
||||
}
|
||||
if (Array.isArray(cliOption.config.type)) {
|
||||
if (transforms[cliOption.name] === void 0) {
|
||||
transforms[cliOption.name] = Object.create(null);
|
||||
transforms[cliOption.name]["shouldTransform"] = true;
|
||||
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const key of Object.keys(parsed)) {
|
||||
if (key !== "_") {
|
||||
const keys = key.split(".");
|
||||
setDotProp(options, keys, parsed[key]);
|
||||
setByType(options, transforms);
|
||||
}
|
||||
}
|
||||
return {
|
||||
args,
|
||||
options
|
||||
};
|
||||
}
|
||||
runMatchedCommand() {
|
||||
const {args, options, matchedCommand: command} = this;
|
||||
if (!command || !command.commandAction)
|
||||
return;
|
||||
command.checkUnknownOptions();
|
||||
command.checkOptionValue();
|
||||
command.checkRequiredArgs();
|
||||
const actionArgs = [];
|
||||
command.args.forEach((arg, index) => {
|
||||
if (arg.variadic) {
|
||||
actionArgs.push(args.slice(index));
|
||||
} else {
|
||||
actionArgs.push(args[index]);
|
||||
}
|
||||
});
|
||||
actionArgs.push(options);
|
||||
return command.commandAction.apply(this, actionArgs);
|
||||
}
|
||||
}
|
||||
|
||||
const cac = (name = "") => new CAC(name);
|
||||
|
||||
const cli = cac('vite');
|
||||
/**
|
||||
* removing global flags before passing as command specific sub-configs
|
||||
*/
|
||||
function cleanOptions(options) {
|
||||
const ret = { ...options };
|
||||
delete ret['--'];
|
||||
delete ret.c;
|
||||
delete ret.config;
|
||||
delete ret.r;
|
||||
delete ret.root;
|
||||
delete ret.base;
|
||||
delete ret.l;
|
||||
delete ret.logLevel;
|
||||
delete ret.clearScreen;
|
||||
delete ret.d;
|
||||
delete ret.debug;
|
||||
delete ret.f;
|
||||
delete ret.filter;
|
||||
delete ret.m;
|
||||
delete ret.mode;
|
||||
return ret;
|
||||
}
|
||||
cli
|
||||
.option('-c, --config <file>', `[string] use specified config file`)
|
||||
.option('-r, --root <path>', `[string] use specified root directory`)
|
||||
.option('--base <path>', `[string] public base path (default: /)`)
|
||||
.option('-l, --logLevel <level>', `[string] info | warn | error | silent`)
|
||||
.option('--clearScreen', `[boolean] allow/disable clear screen when logging`)
|
||||
.option('-d, --debug [feat]', `[string | boolean] show debug logs`)
|
||||
.option('-f, --filter <filter>', `[string] filter debug logs`)
|
||||
.option('-m, --mode <mode>', `[string] set env mode`);
|
||||
// dev
|
||||
cli
|
||||
.command('[root]') // default command
|
||||
.alias('serve')
|
||||
.option('--host [host]', `[string] specify hostname`)
|
||||
.option('--port <port>', `[number] specify port`)
|
||||
.option('--https', `[boolean] use TLS + HTTP/2`)
|
||||
.option('--open [path]', `[boolean | string] open browser on startup`)
|
||||
.option('--cors', `[boolean] enable CORS`)
|
||||
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
||||
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
||||
.action(async (root, options) => {
|
||||
// output structure is preserved even after bundling so require()
|
||||
// is ok here
|
||||
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-d8f4aa6e.js'); }).then(function (n) { return n.index$1; });
|
||||
try {
|
||||
const server = await createServer({
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
server: cleanOptions(options)
|
||||
});
|
||||
if (!server.httpServer) {
|
||||
throw new Error('HTTP server not available');
|
||||
}
|
||||
await server.listen();
|
||||
const info = server.config.logger.info;
|
||||
info(build.source.cyan(`\n vite v${require('vite/package.json').version}`) +
|
||||
build.source.green(` dev server running at:\n`), {
|
||||
clear: !server.config.logger.hasWarned
|
||||
});
|
||||
server.printUrls();
|
||||
// @ts-ignore
|
||||
if (global.__vite_start_time) {
|
||||
// @ts-ignore
|
||||
const startupDuration = perf_hooks.performance.now() - global.__vite_start_time;
|
||||
info(`\n ${build.source.cyan(`ready in ${Math.ceil(startupDuration)}ms.`)}\n`);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
build.createLogger(options.logLevel).error(build.source.red(`error when starting dev server:\n${e.stack}`), { error: e });
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
// build
|
||||
cli
|
||||
.command('build [root]')
|
||||
.option('--target <target>', `[string] transpile target (default: 'modules')`)
|
||||
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
||||
.option('--assetsDir <dir>', `[string] directory under outDir to place assets in (default: _assets)`)
|
||||
.option('--assetsInlineLimit <number>', `[number] static asset base64 inline threshold in bytes (default: 4096)`)
|
||||
.option('--ssr [entry]', `[string] build specified entry for server-side rendering`)
|
||||
.option('--sourcemap', `[boolean] output source maps for build (default: false)`)
|
||||
.option('--minify [minifier]', `[boolean | "terser" | "esbuild"] enable/disable minification, ` +
|
||||
`or specify minifier to use (default: esbuild)`)
|
||||
.option('--manifest', `[boolean] emit build manifest json`)
|
||||
.option('--ssrManifest', `[boolean] emit ssr manifest json`)
|
||||
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
||||
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
||||
.action(async (root, options) => {
|
||||
const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-d8f4aa6e.js'); }).then(function (n) { return n.build$1; });
|
||||
const buildOptions = cleanOptions(options);
|
||||
try {
|
||||
await build$1({
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
build: buildOptions
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
build.createLogger(options.logLevel).error(build.source.red(`error during build:\n${e.stack}`), { error: e });
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
// optimize
|
||||
cli
|
||||
.command('optimize [root]')
|
||||
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
||||
.action(async (root, options) => {
|
||||
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-d8f4aa6e.js'); }).then(function (n) { return n.index; });
|
||||
try {
|
||||
const config = await build.resolveConfig({
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
logLevel: options.logLevel
|
||||
}, 'build', 'development');
|
||||
await optimizeDeps(config, options.force, true);
|
||||
}
|
||||
catch (e) {
|
||||
build.createLogger(options.logLevel).error(build.source.red(`error when optimizing deps:\n${e.stack}`), { error: e });
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
cli
|
||||
.command('preview [root]')
|
||||
.option('--host [host]', `[string] specify hostname`)
|
||||
.option('--port <port>', `[number] specify port`)
|
||||
.option('--https', `[boolean] use TLS + HTTP/2`)
|
||||
.option('--open [path]', `[boolean | string] open browser on startup`)
|
||||
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
||||
.action(async (root, options) => {
|
||||
try {
|
||||
const config = await build.resolveConfig({
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
logLevel: options.logLevel,
|
||||
server: {
|
||||
open: options.open,
|
||||
strictPort: options.strictPort,
|
||||
https: options.https
|
||||
}
|
||||
}, 'serve', 'production');
|
||||
const server = await build.preview(config, cleanOptions(options));
|
||||
build.printHttpServerUrls(server, config);
|
||||
}
|
||||
catch (e) {
|
||||
build.createLogger(options.logLevel).error(build.source.red(`error when starting preview server:\n${e.stack}`), { error: e });
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
cli.help();
|
||||
cli.version(require('../../package.json').version);
|
||||
cli.parse();
|
||||
//# sourceMappingURL=cli.js.map
|
1
packages/astro/vite/dist/node/cli.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/cli.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2068
packages/astro/vite/dist/node/index.d.ts
vendored
Normal file
2068
packages/astro/vite/dist/node/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
52
packages/astro/vite/dist/node/index.js
vendored
Normal file
52
packages/astro/vite/dist/node/index.js
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var build = require('./chunks/dep-d8f4aa6e.js');
|
||||
require('fs');
|
||||
require('path');
|
||||
require('events');
|
||||
require('util');
|
||||
require('stream');
|
||||
require('os');
|
||||
require('perf_hooks');
|
||||
require('url');
|
||||
require('crypto');
|
||||
require('module');
|
||||
require('esbuild');
|
||||
require('worker_threads');
|
||||
require('assert');
|
||||
require('child_process');
|
||||
require('readline');
|
||||
require('zlib');
|
||||
require('resolve');
|
||||
require('querystring');
|
||||
require('tty');
|
||||
require('net');
|
||||
require('http');
|
||||
require('buffer');
|
||||
require('https');
|
||||
require('tls');
|
||||
|
||||
|
||||
|
||||
exports.build = build.build;
|
||||
exports.createLogger = build.createLogger;
|
||||
exports.createServer = build.createServer;
|
||||
exports.defineConfig = build.defineConfig;
|
||||
exports.loadConfigFromFile = build.loadConfigFromFile;
|
||||
exports.loadEnv = build.loadEnv;
|
||||
exports.mergeConfig = build.mergeConfig;
|
||||
exports.normalizePath = build.normalizePath;
|
||||
exports.optimizeDeps = build.optimizeDeps;
|
||||
exports.preview = build.preview;
|
||||
exports.printHttpServerUrls = build.printHttpServerUrls;
|
||||
exports.resolveConfig = build.resolveConfig;
|
||||
exports.resolveEnvPrefix = build.resolveEnvPrefix;
|
||||
exports.resolvePackageData = build.resolvePackageData;
|
||||
exports.resolvePackageEntry = build.resolvePackageEntry;
|
||||
exports.searchForWorkspaceRoot = build.searchForWorkspaceRoot;
|
||||
exports.send = build.send;
|
||||
exports.sortUserPlugins = build.sortUserPlugins;
|
||||
exports.transformWithEsbuild = build.transformWithEsbuild;
|
||||
//# sourceMappingURL=index.js.map
|
1
packages/astro/vite/dist/node/index.js.map
vendored
Normal file
1
packages/astro/vite/dist/node/index.js.map
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
31356
packages/astro/vite/dist/node/terser.js
vendored
Normal file
31356
packages/astro/vite/dist/node/terser.js
vendored
Normal file
File diff suppressed because one or more lines are too long
139
packages/astro/vite/package.json
Normal file
139
packages/astro/vite/package.json
Normal file
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
"name": "vite",
|
||||
"version": "2.6.7",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"description": "Native-ESM powered web dev build tool",
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
},
|
||||
"main": "dist/node/index.js",
|
||||
"types": "dist/node/index.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"dist",
|
||||
"client.d.ts",
|
||||
"src/client",
|
||||
"types"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12.2.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite.git",
|
||||
"directory": "packages/vite"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vitejs/vite/tree/main/#readme",
|
||||
"scripts": {
|
||||
"predev": "rimraf dist",
|
||||
"dev": "rollup -c -w",
|
||||
"prebuild": "rimraf dist && npm run lint",
|
||||
"build": "run-s build-bundle build-types",
|
||||
"build-bundle": "rollup -c",
|
||||
"build-types": "run-s build-temp-types patch-types roll-types",
|
||||
"build-temp-types": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
|
||||
"ci-build": "rimraf dist && run-s build-bundle build-types",
|
||||
"patch-types": "node scripts/patchTypes",
|
||||
"roll-types": "api-extractor run && rimraf temp",
|
||||
"lint": "eslint --ext .ts src/**",
|
||||
"format": "prettier --write --parser typescript \"src/**/*.ts\"",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path .",
|
||||
"release": "node ../../scripts/release.js"
|
||||
},
|
||||
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.13.2",
|
||||
"postcss": "^8.3.8",
|
||||
"resolve": "^1.20.0",
|
||||
"rollup": "^2.57.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ampproject/remapping": "^1.0.1",
|
||||
"@rollup/plugin-alias": "^3.1.5",
|
||||
"@rollup/plugin-commonjs": "^21.0.0",
|
||||
"@rollup/plugin-dynamic-import-vars": "^1.4.0",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "13.0.5",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@rollup/pluginutils": "^4.1.1",
|
||||
"@types/convert-source-map": "^1.5.2",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/es-module-lexer": "^0.3.0",
|
||||
"@types/estree": "^0.0.50",
|
||||
"@types/etag": "^1.8.1",
|
||||
"@types/less": "^3.0.3",
|
||||
"@types/mime": "^2.0.3",
|
||||
"@types/node": "^15.12.2",
|
||||
"@types/resolve": "^1.20.1",
|
||||
"@types/sass": "^1.16.1",
|
||||
"@types/stylus": "^0.48.36",
|
||||
"@types/ws": "^7.4.7",
|
||||
"@vue/compiler-dom": "^3.2.19",
|
||||
"acorn": "^8.5.0",
|
||||
"acorn-class-fields": "^1.0.0",
|
||||
"acorn-static-class-features": "^1.0.0",
|
||||
"builtin-modules": "^3.2.0",
|
||||
"cac": "^6.7.3",
|
||||
"chalk": "^4.1.2",
|
||||
"chokidar": "^3.5.2",
|
||||
"compression": "^1.7.4",
|
||||
"connect": "^3.7.0",
|
||||
"connect-history-api-fallback": "^1.6.0",
|
||||
"convert-source-map": "^1.8.0",
|
||||
"cors": "^2.8.5",
|
||||
"debug": "^4.3.2",
|
||||
"dotenv": "^10.0.0",
|
||||
"dotenv-expand": "^5.1.0",
|
||||
"es-module-lexer": "^0.9.2",
|
||||
"estree-walker": "^2.0.2",
|
||||
"etag": "^1.8.1",
|
||||
"execa": "^5.1.1",
|
||||
"fast-glob": "^3.2.7",
|
||||
"http-proxy": "^1.18.1",
|
||||
"launch-editor-middleware": "^2.2.1",
|
||||
"magic-string": "^0.25.7",
|
||||
"mime": "^2.5.2",
|
||||
"minimatch": "^3.0.4",
|
||||
"okie": "^1.0.1",
|
||||
"open": "^8.2.1",
|
||||
"periscopic": "^2.0.3",
|
||||
"postcss-import": "^14.0.2",
|
||||
"postcss-load-config": "^3.1.0",
|
||||
"postcss-modules": "^4.2.2",
|
||||
"resolve.exports": "^1.0.2",
|
||||
"rollup-plugin-license": "^2.5.0",
|
||||
"selfsigned": "^1.10.11",
|
||||
"sirv": "^1.0.17",
|
||||
"source-map": "^0.6.1",
|
||||
"source-map-support": "^0.5.20",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"terser": "^5.9.0",
|
||||
"tsconfck": "^1.0.0",
|
||||
"tslib": "^2.3.1",
|
||||
"types": "link:./types",
|
||||
"ws": "^7.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"less": "*",
|
||||
"sass": "*",
|
||||
"stylus": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"stylus": {
|
||||
"optional": true
|
||||
},
|
||||
"less": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
59
packages/astro/vite/types/alias.d.ts
vendored
Normal file
59
packages/astro/vite/types/alias.d.ts
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
Types from https://github.com/rollup/plugins/blob/master/packages/alias/types/index.d.ts
|
||||
Inlined because the plugin is bundled.
|
||||
|
||||
https://github.com/rollup/plugins/blob/master/LICENSE
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/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.
|
||||
*/
|
||||
|
||||
import { PluginHooks } from 'rollup'
|
||||
|
||||
export interface Alias {
|
||||
find: string | RegExp
|
||||
replacement: string
|
||||
/**
|
||||
* Instructs the plugin to use an alternative resolving algorithm,
|
||||
* rather than the Rollup's resolver.
|
||||
* @default null
|
||||
*/
|
||||
customResolver?: ResolverFunction | ResolverObject | null
|
||||
}
|
||||
|
||||
export type ResolverFunction = PluginHooks['resolveId']
|
||||
|
||||
export interface ResolverObject {
|
||||
buildStart?: PluginHooks['buildStart']
|
||||
resolveId: ResolverFunction
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies an `Object`, or an `Array` of `Object`,
|
||||
* which defines aliases used to replace values in `import` or `require` statements.
|
||||
* With either format, the order of the entries is important,
|
||||
* in that the first defined rules are applied first.
|
||||
*
|
||||
* This is passed to \@rollup/plugin-alias as the "entries" field
|
||||
* https://github.com/rollup/plugins/tree/master/packages/alias#entries
|
||||
*/
|
||||
export type AliasOptions = readonly Alias[] | { [find: string]: string }
|
5
packages/astro/vite/types/anymatch.d.ts
vendored
Normal file
5
packages/astro/vite/types/anymatch.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
export type AnymatchFn = (testString: string) => boolean
|
||||
export type AnymatchPattern = string | RegExp | AnymatchFn
|
||||
type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
|
||||
|
||||
export { AnymatchMatcher as Matcher }
|
218
packages/astro/vite/types/chokidar.d.ts
vendored
Normal file
218
packages/astro/vite/types/chokidar.d.ts
vendored
Normal file
|
@ -0,0 +1,218 @@
|
|||
// Inlined to avoid extra dependency (chokidar is bundled in the published build)
|
||||
|
||||
// https://github.com/paulmillr/chokidar/blob/master/types/index.d.ts
|
||||
// MIT Licensed https://github.com/paulmillr/chokidar/blob/master/LICENSE
|
||||
|
||||
/**
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
|
||||
|
||||
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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from 'fs'
|
||||
import { Matcher } from './anymatch'
|
||||
|
||||
export interface FSWatcher extends fs.FSWatcher {
|
||||
options: WatchOptions
|
||||
|
||||
/**
|
||||
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
|
||||
*/
|
||||
(options?: WatchOptions): void
|
||||
|
||||
/**
|
||||
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
add(paths: string | ReadonlyArray<string>): void
|
||||
|
||||
/**
|
||||
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
unwatch(paths: string | ReadonlyArray<string>): void
|
||||
|
||||
/**
|
||||
* Returns an object representing all the paths on the file system being watched by this
|
||||
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
|
||||
* the `cwd` option was used), and the values are arrays of the names of the items contained in
|
||||
* each directory.
|
||||
*/
|
||||
getWatched(): {
|
||||
[directory: string]: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all listeners from watched files.
|
||||
*/
|
||||
close(): Promise<void>
|
||||
|
||||
on(
|
||||
event: 'add' | 'addDir' | 'change',
|
||||
listener: (path: string, stats?: fs.Stats) => void
|
||||
): this
|
||||
|
||||
on(
|
||||
event: 'all',
|
||||
listener: (
|
||||
eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir',
|
||||
path: string,
|
||||
stats?: fs.Stats
|
||||
) => void
|
||||
): this
|
||||
|
||||
/**
|
||||
* Error occurred
|
||||
*/
|
||||
on(event: 'error', listener: (error: Error) => void): this
|
||||
|
||||
/**
|
||||
* Exposes the native Node `fs.FSWatcher events`
|
||||
*/
|
||||
on(
|
||||
event: 'raw',
|
||||
listener: (eventName: string, path: string, details: any) => void
|
||||
): this
|
||||
|
||||
/**
|
||||
* Fires when the initial scan is complete
|
||||
*/
|
||||
on(event: 'ready', listener: () => void): this
|
||||
|
||||
on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this
|
||||
}
|
||||
|
||||
export interface WatchOptions {
|
||||
/**
|
||||
* Indicates whether the process should continue to run as long as files are being watched. If
|
||||
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
|
||||
* even if the process continues to run.
|
||||
*/
|
||||
persistent?: boolean
|
||||
|
||||
/**
|
||||
* ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
|
||||
* be ignored. The whole relative or absolute path is tested, not just filename. If a function
|
||||
* with two arguments is provided, it gets called twice per path - once with a single argument
|
||||
* (the path), second time with two arguments (the path and the
|
||||
* [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
|
||||
*/
|
||||
ignored?: Matcher
|
||||
|
||||
/**
|
||||
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
|
||||
* instantiating the watching as chokidar discovers these file paths (before the `ready` event).
|
||||
*/
|
||||
ignoreInitial?: boolean
|
||||
|
||||
/**
|
||||
* When `false`, only the symlinks themselves will be watched for changes instead of following
|
||||
* the link references and bubbling events through the link's path.
|
||||
*/
|
||||
followSymlinks?: boolean
|
||||
|
||||
/**
|
||||
* The base directory from which watch `paths` are to be derived. Paths emitted with events will
|
||||
* be relative to this.
|
||||
*/
|
||||
cwd?: string
|
||||
|
||||
/**
|
||||
* If set to true then the strings passed to .watch() and .add() are treated as literal path
|
||||
* names, even if they look like globs. Default: false.
|
||||
*/
|
||||
disableGlobbing?: boolean
|
||||
|
||||
/**
|
||||
* Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
|
||||
* utilization, consider setting this to `false`. It is typically necessary to **set this to
|
||||
* `true` to successfully watch files over a network**, and it may be necessary to successfully
|
||||
* watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
|
||||
* the `useFsEvents` default.
|
||||
*/
|
||||
usePolling?: boolean
|
||||
|
||||
/**
|
||||
* Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
|
||||
* and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
|
||||
* OS X, `usePolling: true` becomes the default.
|
||||
*/
|
||||
useFsEvents?: boolean
|
||||
|
||||
/**
|
||||
* If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
|
||||
* may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
|
||||
* provided even in cases where it wasn't already available from the underlying watch events.
|
||||
*/
|
||||
alwaysStat?: boolean
|
||||
|
||||
/**
|
||||
* If set, limits how many levels of subdirectories will be traversed.
|
||||
*/
|
||||
depth?: number
|
||||
|
||||
/**
|
||||
* Interval of file system polling.
|
||||
*/
|
||||
interval?: number
|
||||
|
||||
/**
|
||||
* Interval of file system polling for binary files. ([see list of binary extensions](https://gi
|
||||
* thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
|
||||
*/
|
||||
binaryInterval?: number
|
||||
|
||||
/**
|
||||
* Indicates whether to watch files that don't have read permissions if possible. If watching
|
||||
* fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
|
||||
* silently.
|
||||
*/
|
||||
ignorePermissionErrors?: boolean
|
||||
|
||||
/**
|
||||
* `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
|
||||
* that occur when using editors that use "atomic writes" instead of writing directly to the
|
||||
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
|
||||
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
|
||||
* you can override it by setting `atomic` to a custom value, in milliseconds.
|
||||
*/
|
||||
atomic?: boolean | number
|
||||
|
||||
/**
|
||||
* can be set to an object in order to adjust timing params:
|
||||
*/
|
||||
awaitWriteFinish?:
|
||||
| {
|
||||
/**
|
||||
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
|
||||
*/
|
||||
stabilityThreshold?: number
|
||||
|
||||
/**
|
||||
* File size polling interval.
|
||||
*/
|
||||
pollInterval?: number
|
||||
}
|
||||
| boolean
|
||||
}
|
162
packages/astro/vite/types/commonjs.d.ts
vendored
Normal file
162
packages/astro/vite/types/commonjs.d.ts
vendored
Normal file
|
@ -0,0 +1,162 @@
|
|||
/**
|
||||
* https://github.com/rollup/plugins/blob/master/packages/commonjs/types/index.d.ts
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file at
|
||||
* https://github.com/rollup/plugins/blob/master/LICENSE
|
||||
*/
|
||||
export interface RollupCommonJSOptions {
|
||||
/**
|
||||
* A minimatch pattern, or array of patterns, which specifies the files in
|
||||
* the build the plugin should operate on. By default, all files with
|
||||
* extension `".cjs"` or those in `extensions` are included, but you can narrow
|
||||
* this list by only including specific files. These files will be analyzed
|
||||
* and transpiled if either the analysis does not find ES module specific
|
||||
* statements or `transformMixedEsModules` is `true`.
|
||||
* @default undefined
|
||||
*/
|
||||
include?: string | RegExp | readonly (string | RegExp)[]
|
||||
/**
|
||||
* A minimatch pattern, or array of patterns, which specifies the files in
|
||||
* the build the plugin should _ignore_. By default, all files with
|
||||
* extensions other than those in `extensions` or `".cjs"` are ignored, but you
|
||||
* can exclude additional files. See also the `include` option.
|
||||
* @default undefined
|
||||
*/
|
||||
exclude?: string | RegExp | readonly (string | RegExp)[]
|
||||
/**
|
||||
* For extensionless imports, search for extensions other than .js in the
|
||||
* order specified. Note that you need to make sure that non-JavaScript files
|
||||
* are transpiled by another plugin first.
|
||||
* @default [ '.js' ]
|
||||
*/
|
||||
extensions?: ReadonlyArray<string>
|
||||
/**
|
||||
* If true then uses of `global` won't be dealt with by this plugin
|
||||
* @default false
|
||||
*/
|
||||
ignoreGlobal?: boolean
|
||||
/**
|
||||
* If false, skips source map generation for CommonJS modules. This will improve performance.
|
||||
* @default true
|
||||
*/
|
||||
sourceMap?: boolean
|
||||
/**
|
||||
* Some `require` calls cannot be resolved statically to be translated to
|
||||
* imports.
|
||||
* When this option is set to `false`, the generated code will either
|
||||
* directly throw an error when such a call is encountered or, when
|
||||
* `dynamicRequireTargets` is used, when such a call cannot be resolved with a
|
||||
* configured dynamic require target.
|
||||
* Setting this option to `true` will instead leave the `require` call in the
|
||||
* code or use it as a fallback for `dynamicRequireTargets`.
|
||||
* @default false
|
||||
*/
|
||||
ignoreDynamicRequires?: boolean
|
||||
/**
|
||||
* Instructs the plugin whether to enable mixed module transformations. This
|
||||
* is useful in scenarios with modules that contain a mix of ES `import`
|
||||
* statements and CommonJS `require` expressions. Set to `true` if `require`
|
||||
* calls should be transformed to imports in mixed modules, or `false` if the
|
||||
* `require` expressions should survive the transformation. The latter can be
|
||||
* important if the code contains environment detection, or you are coding
|
||||
* for an environment with special treatment for `require` calls such as
|
||||
* ElectronJS. See also the `ignore` option.
|
||||
* @default false
|
||||
*/
|
||||
transformMixedEsModules?: boolean
|
||||
/**
|
||||
* Sometimes you have to leave require statements unconverted. Pass an array
|
||||
* containing the IDs or a `id => boolean` function.
|
||||
* @default []
|
||||
*/
|
||||
ignore?: ReadonlyArray<string> | ((id: string) => boolean)
|
||||
/**
|
||||
* Controls how to render imports from external dependencies. By default,
|
||||
* this plugin assumes that all external dependencies are CommonJS. This
|
||||
* means they are rendered as default imports to be compatible with e.g.
|
||||
* NodeJS where ES modules can only import a default export from a CommonJS
|
||||
* dependency.
|
||||
*
|
||||
* If you set `esmExternals` to `true`, this plugins assumes that all
|
||||
* external dependencies are ES modules and respect the
|
||||
* `requireReturnsDefault` option. If that option is not set, they will be
|
||||
* rendered as namespace imports.
|
||||
*
|
||||
* You can also supply an array of ids to be treated as ES modules, or a
|
||||
* function that will be passed each external id to determine if it is an ES
|
||||
* module.
|
||||
* @default false
|
||||
*/
|
||||
esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean)
|
||||
/**
|
||||
* Controls what is returned when requiring an ES module from a CommonJS file.
|
||||
* When using the `esmExternals` option, this will also apply to external
|
||||
* modules. By default, this plugin will render those imports as namespace
|
||||
* imports i.e.
|
||||
*
|
||||
* ```js
|
||||
* // input
|
||||
* const foo = require('foo');
|
||||
*
|
||||
* // output
|
||||
* import * as foo from 'foo';
|
||||
* ```
|
||||
*
|
||||
* However there are some situations where this may not be desired.
|
||||
* For these situations, you can change Rollup's behaviour either globally or
|
||||
* per module. To change it globally, set the `requireReturnsDefault` option
|
||||
* to one of the following values:
|
||||
*
|
||||
* - `false`: This is the default, requiring an ES module returns its
|
||||
* namespace. This is the only option that will also add a marker
|
||||
* `__esModule: true` to the namespace to support interop patterns in
|
||||
* CommonJS modules that are transpiled ES modules.
|
||||
* - `"namespace"`: Like `false`, requiring an ES module returns its
|
||||
* namespace, but the plugin does not add the `__esModule` marker and thus
|
||||
* creates more efficient code. For external dependencies when using
|
||||
* `esmExternals: true`, no additional interop code is generated.
|
||||
* - `"auto"`: This is complementary to how `output.exports: "auto"` works in
|
||||
* Rollup: If a module has a default export and no named exports, requiring
|
||||
* that module returns the default export. In all other cases, the namespace
|
||||
* is returned. For external dependencies when using `esmExternals: true`, a
|
||||
* corresponding interop helper is added.
|
||||
* - `"preferred"`: If a module has a default export, requiring that module
|
||||
* always returns the default export, no matter whether additional named
|
||||
* exports exist. This is similar to how previous versions of this plugin
|
||||
* worked. Again for external dependencies when using `esmExternals: true`,
|
||||
* an interop helper is added.
|
||||
* - `true`: This will always try to return the default export on require
|
||||
* without checking if it actually exists. This can throw at build time if
|
||||
* there is no default export. This is how external dependencies are handled
|
||||
* when `esmExternals` is not used. The advantage over the other options is
|
||||
* that, like `false`, this does not add an interop helper for external
|
||||
* dependencies, keeping the code lean.
|
||||
*
|
||||
* To change this for individual modules, you can supply a function for
|
||||
* `requireReturnsDefault` instead. This function will then be called once for
|
||||
* each required ES module or external dependency with the corresponding id
|
||||
* and allows you to return different values for different modules.
|
||||
* @default false
|
||||
*/
|
||||
requireReturnsDefault?:
|
||||
| boolean
|
||||
| 'auto'
|
||||
| 'preferred'
|
||||
| 'namespace'
|
||||
| ((id: string) => boolean | 'auto' | 'preferred' | 'namespace')
|
||||
/**
|
||||
* Some modules contain dynamic `require` calls, or require modules that
|
||||
* contain circular dependencies, which are not handled well by static
|
||||
* imports. Including those modules as `dynamicRequireTargets` will simulate a
|
||||
* CommonJS (NodeJS-like) environment for them with support for dynamic and
|
||||
* circular dependencies.
|
||||
*
|
||||
* Note: In extreme cases, this feature may result in some paths being
|
||||
* rendered as absolute in the final bundle. The plugin tries to avoid
|
||||
* exposing paths from the local machine, but if you are `dynamicRequirePaths`
|
||||
* with paths that are far away from your project's folder, that may require
|
||||
* replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
|
||||
*/
|
||||
dynamicRequireTargets?: string | ReadonlyArray<string>
|
||||
}
|
111
packages/astro/vite/types/connect.d.ts
vendored
Normal file
111
packages/astro/vite/types/connect.d.ts
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
// Inlined to avoid extra dependency
|
||||
// MIT Licensed https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/LICENSE
|
||||
|
||||
// Type definitions for connect v3.4.0
|
||||
// Project: https://github.com/senchalabs/connect
|
||||
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
||||
// Evan Hahn <https://github.com/EvanHahn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
import * as http from 'http'
|
||||
|
||||
export namespace Connect {
|
||||
export type ServerHandle = HandleFunction | http.Server
|
||||
|
||||
export class IncomingMessage extends http.IncomingMessage {
|
||||
originalUrl?: http.IncomingMessage['url']
|
||||
}
|
||||
|
||||
export type NextFunction = (err?: any) => void
|
||||
|
||||
export type SimpleHandleFunction = (
|
||||
req: IncomingMessage,
|
||||
res: http.ServerResponse
|
||||
) => void
|
||||
export type NextHandleFunction = (
|
||||
req: IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
next: NextFunction
|
||||
) => void
|
||||
export type ErrorHandleFunction = (
|
||||
err: any,
|
||||
req: IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
next: NextFunction
|
||||
) => void
|
||||
export type HandleFunction =
|
||||
| SimpleHandleFunction
|
||||
| NextHandleFunction
|
||||
| ErrorHandleFunction
|
||||
|
||||
export interface ServerStackItem {
|
||||
route: string
|
||||
handle: ServerHandle
|
||||
}
|
||||
|
||||
export interface Server extends NodeJS.EventEmitter {
|
||||
(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void
|
||||
|
||||
route: string
|
||||
stack: ServerStackItem[]
|
||||
|
||||
/**
|
||||
* Utilize the given middleware `handle` to the given `route`,
|
||||
* defaulting to _/_. This "route" is the mount-point for the
|
||||
* middleware, when given a value other than _/_ the middleware
|
||||
* is only effective when that segment is present in the request's
|
||||
* pathname.
|
||||
*
|
||||
* For example if we were to mount a function at _/admin_, it would
|
||||
* be invoked on _/admin_, and _/admin/settings_, however it would
|
||||
* not be invoked for _/_, or _/posts_.
|
||||
*/
|
||||
use(fn: NextHandleFunction): Server
|
||||
use(fn: HandleFunction): Server
|
||||
use(route: string, fn: NextHandleFunction): Server
|
||||
use(route: string, fn: HandleFunction): Server
|
||||
|
||||
/**
|
||||
* Handle server requests, punting them down
|
||||
* the middleware stack.
|
||||
*/
|
||||
handle(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
next: Function
|
||||
): void
|
||||
|
||||
/**
|
||||
* Listen for connections.
|
||||
*
|
||||
* This method takes the same arguments
|
||||
* as node's `http.Server#listen()`.
|
||||
*
|
||||
* HTTP and HTTPS:
|
||||
*
|
||||
* If you run your application both as HTTP
|
||||
* and HTTPS you may wrap them individually,
|
||||
* since your Connect "server" is really just
|
||||
* a JavaScript `Function`.
|
||||
*
|
||||
* var connect = require('connect')
|
||||
* , http = require('http')
|
||||
* , https = require('https');
|
||||
*
|
||||
* var app = connect();
|
||||
*
|
||||
* http.createServer(app).listen(80);
|
||||
* https.createServer(options, app).listen(443);
|
||||
*/
|
||||
listen(
|
||||
port: number,
|
||||
hostname?: string,
|
||||
backlog?: number,
|
||||
callback?: Function
|
||||
): http.Server
|
||||
listen(port: number, hostname?: string, callback?: Function): http.Server
|
||||
listen(path: string, callback?: Function): http.Server
|
||||
listen(handle: any, listeningListener?: Function): http.Server
|
||||
}
|
||||
}
|
5
packages/astro/vite/types/customEvent.d.ts
vendored
Normal file
5
packages/astro/vite/types/customEvent.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
// See https://stackoverflow.com/a/63549561.
|
||||
export type CustomEventName<T extends string> = (T extends `vite:${T}`
|
||||
? never
|
||||
: T) &
|
||||
(`vite:${T}` extends T ? never : T)
|
17
packages/astro/vite/types/dynamicImportVars.d.ts
vendored
Normal file
17
packages/astro/vite/types/dynamicImportVars.d.ts
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
export interface RollupDynamicImportVarsOptions {
|
||||
/**
|
||||
* Files to include in this plugin (default all).
|
||||
* @default []
|
||||
*/
|
||||
include?: string | RegExp | (string | RegExp)[]
|
||||
/**
|
||||
* Files to exclude in this plugin (default none).
|
||||
* @default []
|
||||
*/
|
||||
exclude?: string | RegExp | (string | RegExp)[]
|
||||
/**
|
||||
* By default, the plugin quits the build process when it encounters an error. If you set this option to true, it will throw a warning instead and leave the code untouched.
|
||||
* @default false
|
||||
*/
|
||||
warnOnError?: boolean
|
||||
}
|
57
packages/astro/vite/types/hmrPayload.d.ts
vendored
Normal file
57
packages/astro/vite/types/hmrPayload.d.ts
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
export type HMRPayload =
|
||||
| ConnectedPayload
|
||||
| UpdatePayload
|
||||
| FullReloadPayload
|
||||
| CustomPayload
|
||||
| ErrorPayload
|
||||
| PrunePayload
|
||||
|
||||
export interface ConnectedPayload {
|
||||
type: 'connected'
|
||||
}
|
||||
|
||||
export interface UpdatePayload {
|
||||
type: 'update'
|
||||
updates: Update[]
|
||||
}
|
||||
|
||||
export interface Update {
|
||||
type: 'js-update' | 'css-update'
|
||||
path: string
|
||||
acceptedPath: string
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
export interface PrunePayload {
|
||||
type: 'prune'
|
||||
paths: string[]
|
||||
}
|
||||
|
||||
export interface FullReloadPayload {
|
||||
type: 'full-reload'
|
||||
path?: string
|
||||
}
|
||||
|
||||
export interface CustomPayload {
|
||||
type: 'custom'
|
||||
event: string
|
||||
data?: any
|
||||
}
|
||||
|
||||
export interface ErrorPayload {
|
||||
type: 'error'
|
||||
err: {
|
||||
[name: string]: any
|
||||
message: string
|
||||
stack: string
|
||||
id?: string
|
||||
frame?: string
|
||||
plugin?: string
|
||||
pluginCode?: string
|
||||
loc?: {
|
||||
file?: string
|
||||
line: number
|
||||
column: number
|
||||
}
|
||||
}
|
||||
}
|
242
packages/astro/vite/types/http-proxy.d.ts
vendored
Normal file
242
packages/astro/vite/types/http-proxy.d.ts
vendored
Normal file
|
@ -0,0 +1,242 @@
|
|||
// Inlined to avoid extra dependency
|
||||
// MIT Licensed https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/LICENSE
|
||||
|
||||
// Type definitions for node-http-proxy 1.17
|
||||
// Project: https://github.com/nodejitsu/node-http-proxy
|
||||
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
||||
// Florian Oellerich <https://github.com/Raigen>
|
||||
// Daniel Schmidt <https://github.com/DanielMSchmidt>
|
||||
// Jordan Abreu <https://github.com/jabreu610>
|
||||
// Samuel Bodin <https://github.com/bodinsamuel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as net from 'net'
|
||||
import * as http from 'http'
|
||||
import * as events from 'events'
|
||||
import * as url from 'url'
|
||||
import * as stream from 'stream'
|
||||
|
||||
export namespace HttpProxy {
|
||||
export type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed
|
||||
|
||||
export type ProxyTargetUrl = string | Partial<url.Url>
|
||||
|
||||
export interface ProxyTargetDetailed {
|
||||
host: string
|
||||
port: number
|
||||
protocol?: string
|
||||
hostname?: string
|
||||
socketPath?: string
|
||||
key?: string
|
||||
passphrase?: string
|
||||
pfx?: Buffer | string
|
||||
cert?: string
|
||||
ca?: string
|
||||
ciphers?: string
|
||||
secureProtocol?: string
|
||||
}
|
||||
|
||||
export type ErrorCallback = (
|
||||
err: Error,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
target?: ProxyTargetUrl
|
||||
) => void
|
||||
|
||||
export class Server extends events.EventEmitter {
|
||||
/**
|
||||
* Creates the proxy server with specified options.
|
||||
* @param options - Config object passed to the proxy
|
||||
*/
|
||||
constructor(options?: ServerOptions)
|
||||
|
||||
/**
|
||||
* Used for proxying regular HTTP(S) requests
|
||||
* @param req - Client request.
|
||||
* @param res - Client response.
|
||||
* @param options - Additionnal options.
|
||||
*/
|
||||
web(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
options?: ServerOptions,
|
||||
callback?: ErrorCallback
|
||||
): void
|
||||
|
||||
/**
|
||||
* Used for proxying regular HTTP(S) requests
|
||||
* @param req - Client request.
|
||||
* @param socket - Client socket.
|
||||
* @param head - Client head.
|
||||
* @param options - Additional options.
|
||||
*/
|
||||
ws(
|
||||
req: http.IncomingMessage,
|
||||
socket: unknown,
|
||||
head: unknown,
|
||||
options?: ServerOptions,
|
||||
callback?: ErrorCallback
|
||||
): void
|
||||
|
||||
/**
|
||||
* A function that wraps the object in a webserver, for your convenience
|
||||
* @param port - Port to listen on
|
||||
*/
|
||||
listen(port: number): Server
|
||||
|
||||
/**
|
||||
* A function that closes the inner webserver and stops listening on given port
|
||||
*/
|
||||
close(callback?: () => void): void
|
||||
|
||||
/**
|
||||
* Creates the proxy server with specified options.
|
||||
* @param options - Config object passed to the proxy
|
||||
* @returns Proxy object with handlers for `ws` and `web` requests
|
||||
*/
|
||||
static createProxyServer(options?: ServerOptions): Server
|
||||
|
||||
/**
|
||||
* Creates the proxy server with specified options.
|
||||
* @param options - Config object passed to the proxy
|
||||
* @returns Proxy object with handlers for `ws` and `web` requests
|
||||
*/
|
||||
static createServer(options?: ServerOptions): Server
|
||||
|
||||
/**
|
||||
* Creates the proxy server with specified options.
|
||||
* @param options - Config object passed to the proxy
|
||||
* @returns Proxy object with handlers for `ws` and `web` requests
|
||||
*/
|
||||
static createProxy(options?: ServerOptions): Server
|
||||
|
||||
addListener(event: string, listener: () => void): this
|
||||
on(event: string, listener: () => void): this
|
||||
on(event: 'error', listener: ErrorCallback): this
|
||||
on(
|
||||
event: 'start',
|
||||
listener: (
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
target: ProxyTargetUrl
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'proxyReq',
|
||||
listener: (
|
||||
proxyReq: http.ClientRequest,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
options: ServerOptions
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'proxyRes',
|
||||
listener: (
|
||||
proxyRes: http.IncomingMessage,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'proxyReqWs',
|
||||
listener: (
|
||||
proxyReq: http.ClientRequest,
|
||||
req: http.IncomingMessage,
|
||||
socket: net.Socket,
|
||||
options: ServerOptions,
|
||||
head: any
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'econnreset',
|
||||
listener: (
|
||||
err: Error,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
target: ProxyTargetUrl
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'end',
|
||||
listener: (
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
proxyRes: http.IncomingMessage
|
||||
) => void
|
||||
): this
|
||||
on(
|
||||
event: 'close',
|
||||
listener: (
|
||||
proxyRes: http.IncomingMessage,
|
||||
proxySocket: net.Socket,
|
||||
proxyHead: any
|
||||
) => void
|
||||
): this
|
||||
|
||||
once(event: string, listener: () => void): this
|
||||
removeListener(event: string, listener: () => void): this
|
||||
removeAllListeners(event?: string): this
|
||||
getMaxListeners(): number
|
||||
setMaxListeners(n: number): this
|
||||
listeners(event: string): Array<() => void>
|
||||
emit(event: string, ...args: any[]): boolean
|
||||
listenerCount(type: string): number
|
||||
}
|
||||
|
||||
export interface ServerOptions {
|
||||
/** URL string to be parsed with the url module. */
|
||||
target?: ProxyTarget
|
||||
/** URL string to be parsed with the url module. */
|
||||
forward?: ProxyTargetUrl
|
||||
/** Object to be passed to http(s).request. */
|
||||
agent?: any
|
||||
/** Object to be passed to https.createServer(). */
|
||||
ssl?: any
|
||||
/** If you want to proxy websockets. */
|
||||
ws?: boolean
|
||||
/** Adds x- forward headers. */
|
||||
xfwd?: boolean
|
||||
/** Verify SSL certificate. */
|
||||
secure?: boolean
|
||||
/** Explicitly specify if we are proxying to another proxy. */
|
||||
toProxy?: boolean
|
||||
/** Specify whether you want to prepend the target's path to the proxy path. */
|
||||
prependPath?: boolean
|
||||
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
||||
ignorePath?: boolean
|
||||
/** Local interface string to bind for outgoing connections. */
|
||||
localAddress?: string
|
||||
/** Changes the origin of the host header to the target URL. */
|
||||
changeOrigin?: boolean
|
||||
/** specify whether you want to keep letter case of response header key */
|
||||
preserveHeaderKeyCase?: boolean
|
||||
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
||||
auth?: string
|
||||
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
||||
hostRewrite?: string
|
||||
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
||||
autoRewrite?: boolean
|
||||
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
||||
protocolRewrite?: string
|
||||
/** rewrites domain of set-cookie headers. */
|
||||
cookieDomainRewrite?: false | string | { [oldDomain: string]: string }
|
||||
/** rewrites path of set-cookie headers. Default: false */
|
||||
cookiePathRewrite?: false | string | { [oldPath: string]: string }
|
||||
/** object with extra headers to be added to target requests. */
|
||||
headers?: { [header: string]: string }
|
||||
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
||||
proxyTimeout?: number
|
||||
/** Timeout (in milliseconds) for incoming requests */
|
||||
timeout?: number
|
||||
/** Specify whether you want to follow redirects. Default: false */
|
||||
followRedirects?: boolean
|
||||
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
||||
selfHandleResponse?: boolean
|
||||
/** Buffer */
|
||||
buffer?: stream.Stream
|
||||
}
|
||||
}
|
69
packages/astro/vite/types/importMeta.d.ts
vendored
Normal file
69
packages/astro/vite/types/importMeta.d.ts
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
interface ImportMeta {
|
||||
url: string
|
||||
|
||||
readonly hot?: {
|
||||
readonly data: any
|
||||
|
||||
accept(): void
|
||||
accept(cb: (mod: any) => void): void
|
||||
accept(dep: string, cb: (mod: any) => void): void
|
||||
accept(deps: readonly string[], cb: (mods: any[]) => void): void
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
acceptDeps(): never
|
||||
|
||||
dispose(cb: (data: any) => void): void
|
||||
decline(): void
|
||||
invalidate(): void
|
||||
|
||||
on: {
|
||||
(
|
||||
event: 'vite:beforeUpdate',
|
||||
cb: (payload: import('./hmrPayload').UpdatePayload) => void
|
||||
): void
|
||||
(
|
||||
event: 'vite:beforePrune',
|
||||
cb: (payload: import('./hmrPayload').PrunePayload) => void
|
||||
): void
|
||||
(
|
||||
event: 'vite:beforeFullReload',
|
||||
cb: (payload: import('./hmrPayload').FullReloadPayload) => void
|
||||
): void
|
||||
(
|
||||
event: 'vite:error',
|
||||
cb: (payload: import('./hmrPayload').ErrorPayload) => void
|
||||
): void
|
||||
<T extends string>(
|
||||
event: import('./customEvent').CustomEventName<T>,
|
||||
cb: (data: any) => void
|
||||
): void
|
||||
}
|
||||
}
|
||||
|
||||
readonly env: ImportMetaEnv
|
||||
|
||||
glob(pattern: string): Record<
|
||||
string,
|
||||
() => Promise<{
|
||||
[key: string]: any
|
||||
}>
|
||||
>
|
||||
|
||||
globEager(pattern: string): Record<
|
||||
string,
|
||||
{
|
||||
[key: string]: any
|
||||
}
|
||||
>
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
[key: string]: string | boolean | undefined
|
||||
BASE_URL: string
|
||||
MODE: string
|
||||
DEV: boolean
|
||||
PROD: boolean
|
||||
SSR: boolean
|
||||
}
|
3
packages/astro/vite/types/package.json
Normal file
3
packages/astro/vite/types/package.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"//": "this file is just here to make pnpm happy with --frozen-lockfile"
|
||||
}
|
110
packages/astro/vite/types/shims.d.ts
vendored
Normal file
110
packages/astro/vite/types/shims.d.ts
vendored
Normal file
|
@ -0,0 +1,110 @@
|
|||
declare module 'connect' {
|
||||
const connect: () => any
|
||||
export = connect
|
||||
}
|
||||
|
||||
declare module 'cors' {
|
||||
function cors(options: any): any
|
||||
export = cors
|
||||
}
|
||||
|
||||
declare module 'selfsigned' {
|
||||
export function generate(attrs: any, options: any, done?: any): any
|
||||
}
|
||||
|
||||
declare module 'http-proxy' {
|
||||
const proxy: any
|
||||
export = proxy
|
||||
}
|
||||
|
||||
declare module 'acorn-class-fields' {
|
||||
const plugin: any
|
||||
export = plugin
|
||||
}
|
||||
|
||||
declare module 'acorn-static-class-features' {
|
||||
const plugin: any
|
||||
export default plugin
|
||||
}
|
||||
|
||||
declare module 'connect-history-api-fallback' {
|
||||
const plugin: any
|
||||
export = plugin
|
||||
}
|
||||
|
||||
declare module 'launch-editor-middleware' {
|
||||
const plugin: any
|
||||
export = plugin
|
||||
}
|
||||
|
||||
declare module 'postcss-load-config' {
|
||||
import { ProcessOptions, Plugin } from 'postcss'
|
||||
function load(
|
||||
inline: any,
|
||||
root: string
|
||||
): Promise<{
|
||||
options: ProcessOptions
|
||||
plugins: Plugin[]
|
||||
}>
|
||||
export = load
|
||||
}
|
||||
|
||||
declare module 'postcss-import' {
|
||||
import { Plugin } from 'postcss'
|
||||
const plugin: (options: {
|
||||
resolve: (
|
||||
id: string,
|
||||
basedir: string,
|
||||
importOptions: any
|
||||
) => string | string[] | Promise<string | string[]>
|
||||
}) => Plugin
|
||||
export = plugin
|
||||
}
|
||||
|
||||
declare module 'postcss-modules' {
|
||||
import { Plugin } from 'postcss'
|
||||
const plugin: (options: any) => Plugin
|
||||
export = plugin
|
||||
}
|
||||
|
||||
declare module '@rollup/plugin-dynamic-import-vars' {
|
||||
import { Plugin } from 'rollup'
|
||||
|
||||
interface Options {
|
||||
include?: string | RegExp | (string | RegExp)[]
|
||||
exclude?: string | RegExp | (string | RegExp)[]
|
||||
warnOnError?: boolean
|
||||
}
|
||||
|
||||
const p: (o?: Options) => Plugin
|
||||
export default p
|
||||
}
|
||||
|
||||
declare module 'rollup-plugin-web-worker-loader' {
|
||||
import { Plugin } from 'rollup'
|
||||
|
||||
interface Options {
|
||||
targetPlatform?: string
|
||||
pattern?: RegExp
|
||||
extensions?: string[]
|
||||
sourcemap?: boolean
|
||||
inline?: boolean
|
||||
}
|
||||
|
||||
const p: (o?: Options) => Plugin
|
||||
export default p
|
||||
}
|
||||
|
||||
declare module 'minimatch' {
|
||||
function match(path: string, pattern: string): boolean
|
||||
export default match
|
||||
}
|
||||
|
||||
declare module 'compression' {
|
||||
function compression(): any
|
||||
export default compression
|
||||
}
|
||||
|
||||
// LESS' types somewhat references this which doesn't make sense in Node,
|
||||
// so we have to shim it
|
||||
declare interface HTMLLinkElement {}
|
209
packages/astro/vite/types/terser.d.ts
vendored
Normal file
209
packages/astro/vite/types/terser.d.ts
vendored
Normal file
|
@ -0,0 +1,209 @@
|
|||
// Modified and inlined to avoid extra dependency
|
||||
// Source: https://github.com/terser/terser/blob/master/tools/terser.d.ts
|
||||
// BSD Licensed https://github.com/terser/terser/blob/master/LICENSE
|
||||
|
||||
/*
|
||||
Terser is released under the BSD license:
|
||||
|
||||
Copyright 2012-2018 (c) Mihai Bazon <mihai.bazon@gmail.com>
|
||||
|
||||
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 HOLDER “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 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.
|
||||
*/
|
||||
|
||||
export namespace Terser {
|
||||
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
||||
|
||||
export interface ParseOptions {
|
||||
bare_returns?: boolean
|
||||
ecma?: ECMA
|
||||
html5_comments?: boolean
|
||||
shebang?: boolean
|
||||
}
|
||||
|
||||
export interface CompressOptions {
|
||||
arguments?: boolean
|
||||
arrows?: boolean
|
||||
booleans_as_integers?: boolean
|
||||
booleans?: boolean
|
||||
collapse_vars?: boolean
|
||||
comparisons?: boolean
|
||||
computed_props?: boolean
|
||||
conditionals?: boolean
|
||||
dead_code?: boolean
|
||||
defaults?: boolean
|
||||
directives?: boolean
|
||||
drop_console?: boolean
|
||||
drop_debugger?: boolean
|
||||
ecma?: ECMA
|
||||
evaluate?: boolean
|
||||
expression?: boolean
|
||||
global_defs?: object
|
||||
hoist_funs?: boolean
|
||||
hoist_props?: boolean
|
||||
hoist_vars?: boolean
|
||||
ie8?: boolean
|
||||
if_return?: boolean
|
||||
inline?: boolean | InlineFunctions
|
||||
join_vars?: boolean
|
||||
keep_classnames?: boolean | RegExp
|
||||
keep_fargs?: boolean
|
||||
keep_fnames?: boolean | RegExp
|
||||
keep_infinity?: boolean
|
||||
loops?: boolean
|
||||
module?: boolean
|
||||
negate_iife?: boolean
|
||||
passes?: number
|
||||
properties?: boolean
|
||||
pure_funcs?: string[]
|
||||
pure_getters?: boolean | 'strict'
|
||||
reduce_funcs?: boolean
|
||||
reduce_vars?: boolean
|
||||
sequences?: boolean | number
|
||||
side_effects?: boolean
|
||||
switches?: boolean
|
||||
toplevel?: boolean
|
||||
top_retain?: null | string | string[] | RegExp
|
||||
typeofs?: boolean
|
||||
unsafe_arrows?: boolean
|
||||
unsafe?: boolean
|
||||
unsafe_comps?: boolean
|
||||
unsafe_Function?: boolean
|
||||
unsafe_math?: boolean
|
||||
unsafe_symbols?: boolean
|
||||
unsafe_methods?: boolean
|
||||
unsafe_proto?: boolean
|
||||
unsafe_regexp?: boolean
|
||||
unsafe_undefined?: boolean
|
||||
unused?: boolean
|
||||
}
|
||||
|
||||
export enum InlineFunctions {
|
||||
Disabled = 0,
|
||||
SimpleFunctions = 1,
|
||||
WithArguments = 2,
|
||||
WithArgumentsAndVariables = 3
|
||||
}
|
||||
|
||||
export interface MangleOptions {
|
||||
eval?: boolean
|
||||
keep_classnames?: boolean | RegExp
|
||||
keep_fnames?: boolean | RegExp
|
||||
module?: boolean
|
||||
properties?: boolean | ManglePropertiesOptions
|
||||
reserved?: string[]
|
||||
safari10?: boolean
|
||||
toplevel?: boolean
|
||||
}
|
||||
|
||||
export interface ManglePropertiesOptions {
|
||||
builtins?: boolean
|
||||
debug?: boolean
|
||||
keep_quoted?: boolean | 'strict'
|
||||
regex?: RegExp | string
|
||||
reserved?: string[]
|
||||
}
|
||||
|
||||
export interface FormatOptions {
|
||||
ascii_only?: boolean
|
||||
beautify?: boolean
|
||||
braces?: boolean
|
||||
comments?:
|
||||
| boolean
|
||||
| 'all'
|
||||
| 'some'
|
||||
| RegExp
|
||||
| ((
|
||||
node: any,
|
||||
comment: {
|
||||
value: string
|
||||
type: 'comment1' | 'comment2' | 'comment3' | 'comment4'
|
||||
pos: number
|
||||
line: number
|
||||
col: number
|
||||
}
|
||||
) => boolean)
|
||||
ecma?: ECMA
|
||||
ie8?: boolean
|
||||
indent_level?: number
|
||||
indent_start?: number
|
||||
inline_script?: boolean
|
||||
keep_quoted_props?: boolean
|
||||
max_line_len?: number | false
|
||||
preamble?: string
|
||||
preserve_annotations?: boolean
|
||||
quote_keys?: boolean
|
||||
quote_style?: OutputQuoteStyle
|
||||
safari10?: boolean
|
||||
semicolons?: boolean
|
||||
shebang?: boolean
|
||||
shorthand?: boolean
|
||||
source_map?: SourceMapOptions
|
||||
webkit?: boolean
|
||||
width?: number
|
||||
wrap_iife?: boolean
|
||||
wrap_func_args?: boolean
|
||||
}
|
||||
|
||||
export enum OutputQuoteStyle {
|
||||
PreferDouble = 0,
|
||||
AlwaysSingle = 1,
|
||||
AlwaysDouble = 2,
|
||||
AlwaysOriginal = 3
|
||||
}
|
||||
|
||||
export interface MinifyOptions {
|
||||
compress?: boolean | CompressOptions
|
||||
ecma?: ECMA
|
||||
ie8?: boolean
|
||||
keep_classnames?: boolean | RegExp
|
||||
keep_fnames?: boolean | RegExp
|
||||
mangle?: boolean | MangleOptions
|
||||
module?: boolean
|
||||
nameCache?: object
|
||||
format?: FormatOptions
|
||||
/** @deprecated use format instead */
|
||||
output?: FormatOptions
|
||||
parse?: ParseOptions
|
||||
safari10?: boolean
|
||||
sourceMap?: boolean | SourceMapOptions
|
||||
toplevel?: boolean
|
||||
}
|
||||
|
||||
export interface MinifyOutput {
|
||||
code?: string
|
||||
map?: object | string
|
||||
}
|
||||
|
||||
export interface SourceMapOptions {
|
||||
/** Source map object, 'inline' or source map file content */
|
||||
content?: object | string
|
||||
includeSources?: boolean
|
||||
filename?: string
|
||||
root?: string
|
||||
url?: string | 'inline'
|
||||
}
|
||||
}
|
186
yarn.lock
186
yarn.lock
|
@ -4082,11 +4082,6 @@ es6-promisify@^5.0.0:
|
|||
dependencies:
|
||||
es6-promise "^4.0.3"
|
||||
|
||||
esbuild-android-arm64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.4.tgz#5178a20d2b7aba741a31c19609f9e67b346996b9"
|
||||
integrity sha512-elDJt+jNyoHFId0/dKsuVYUPke3EcquIyUwzJCH17a3ERglN3A9aMBI5zbz+xNZ+FbaDNdpn0RaJHCFLbZX+fA==
|
||||
|
||||
esbuild-android-arm64@0.13.6:
|
||||
version "0.13.6"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.6.tgz#a109b4e5203e9ec144cadccdf18a5daf021423e5"
|
||||
|
@ -4097,10 +4092,10 @@ esbuild-android-arm64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.7.tgz#528886c36968aa6ab6496392d419654dda88f092"
|
||||
integrity sha512-yqCTKzmm3jiUXgi0yeKhvwZCZTqClUXwwMRAntcM9u/xvXhmpw0V0Z4qDEpnkmF2NCMzmJRH+DAAQ5whuf3CYA==
|
||||
|
||||
esbuild-darwin-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.4.tgz#7a3e66c8e1271b650541b25eed65c84f3564a69d"
|
||||
integrity sha512-zJQGyHRAdZUXlRzbN7W+7ykmEiGC+bq3Gc4GxKYjjWTgDRSEly98ym+vRNkDjXwXYD3gGzSwvH35+MiHAtWvLA==
|
||||
esbuild-android-arm64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz#c20e875c3c98164b1ffba9b28637bdf96f5e9e7c"
|
||||
integrity sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA==
|
||||
|
||||
esbuild-darwin-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4112,10 +4107,10 @@ esbuild-darwin-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.7.tgz#32cf420d43ca448e7741a90d0d4c6dc5385969da"
|
||||
integrity sha512-MvsgMUWzq5FxoeJLSavw3rgQbaC55A8QTI1U2/8MWamtAeDKyzWQnglcsF0/TkjGLaKEqS0ZLo8akJ8q34BCtw==
|
||||
|
||||
esbuild-darwin-arm64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.4.tgz#793feca6032b2a57ef291eb9b2d33768d60a49d6"
|
||||
integrity sha512-r8oYvAtqSGq8HNTZCAx4TdLE7jZiGhX9ooGi5AQAey37MA6XNaP8ZNlw9OCpcgpx3ryU2WctXwIqPzkHO7a8dg==
|
||||
esbuild-darwin-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz#f46e6b471ddbf62265234808a6a1aa91df18a417"
|
||||
integrity sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng==
|
||||
|
||||
esbuild-darwin-arm64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4127,10 +4122,10 @@ esbuild-darwin-arm64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.7.tgz#c80f0b62c8ae4710b17090f507037aeae73e9016"
|
||||
integrity sha512-tuP+dpIzXj17UC17VkHFDAH5nB7MajJK7sF8Fz4iVo8cml8YXj3MeNtjjLmx9YFvPs4XW3hFw1eqZJ06h2ssIA==
|
||||
|
||||
esbuild-freebsd-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.4.tgz#294aec3c2cf4b41fb6900212fc9c33dd8fbbb4a2"
|
||||
integrity sha512-u9DRGkn09EN8+lCh6z7FKle7awi17PJRBuAKdRNgSo5ZrH/3m+mYaJK2PR2URHMpAfXiwJX341z231tSdVe3Yw==
|
||||
esbuild-darwin-arm64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz#a991157a6013facd4f2e14159b7da52626c90154"
|
||||
integrity sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ==
|
||||
|
||||
esbuild-freebsd-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4142,10 +4137,10 @@ esbuild-freebsd-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.7.tgz#0b826a9655446c0d0a01a4a996d450e5cb0e033a"
|
||||
integrity sha512-p07TrpkCJJyAXXCXFm2IpAvyASUTcuT0OF43riEsgjuRJmtaNBOUENecr2B2k/zd9wkGz6UyxxtnFntaBttkDg==
|
||||
|
||||
esbuild-freebsd-arm64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.4.tgz#09fe66c751c12f9b976976b1d83f3de594cb2787"
|
||||
integrity sha512-q3B2k68Uf6gfjATjcK16DqxvjqRQkHL8aPoOfj4op+lSqegdXvBacB1d8jw8PxbWJ8JHpdTLdAVUYU80kotQXA==
|
||||
esbuild-freebsd-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz#301601d2e443ad458960e359b402a17d9500be9d"
|
||||
integrity sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw==
|
||||
|
||||
esbuild-freebsd-arm64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4157,10 +4152,10 @@ esbuild-freebsd-arm64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.7.tgz#f9c980ce7e71e6702f82706a6244959eba2b80dc"
|
||||
integrity sha512-MCtfBRkE1GwAnjVoWPYoZ+S/+zanzWxAJVER1/8jmWobCXJG0w+YM2IXQ2fN4T9U96RusFWQDMJVoACnqhIAzg==
|
||||
|
||||
esbuild-linux-32@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.4.tgz#a9f0793d7bcc9cef4f4ffa4398c525877fba5839"
|
||||
integrity sha512-UUYJPHSiKAO8KoN3Ls/iZtgDLZvK5HarES96aolDPWZnq9FLx4dIHM/x2z4Rxv9IYqQ/DxlPoE2Co1UPBIYYeA==
|
||||
esbuild-freebsd-arm64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz#039a63acc12ec0892006c147ea221e55f9125a9f"
|
||||
integrity sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng==
|
||||
|
||||
esbuild-linux-32@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4172,10 +4167,10 @@ esbuild-linux-32@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.7.tgz#3d9d704452ed13da20771537bf30f695b9f80327"
|
||||
integrity sha512-HM4d16XbqToo93LPrgzkiLgX3Xgr9Mw67tEM8vjhHDx18JnaZqPdIsl5ZfCqRGHlLUq+GdFKl6+dH7WlsiWMCA==
|
||||
|
||||
esbuild-linux-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.4.tgz#c0d0b4c9d62e3bbf8bdf2cece37403aa6d60fc2e"
|
||||
integrity sha512-+RnohAKiiUW4UHLGRkNR1AnENW1gCuDWuygEtd4jxTNPIoeC7lbXGor7rtgjj9AdUzFgOEvAXyNNX01kJ8NueQ==
|
||||
esbuild-linux-32@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz#c537b67d7e694b60bfa2786581412838c6ba0284"
|
||||
integrity sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw==
|
||||
|
||||
esbuild-linux-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4187,10 +4182,10 @@ esbuild-linux-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.7.tgz#ce5c7b964990fdb2713ce816f0a24ffffd96942c"
|
||||
integrity sha512-krgiIEyqcS0kfTjptGEQzdYwiEmmqpmiZHlKqZILVuU5BaIVWCBMmVx20HH9waJw1yT0Ao4fZTZ9kg8s/pKAYA==
|
||||
|
||||
esbuild-linux-arm64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.4.tgz#1292d97bfa64a08d12728f8a7837bf92776c779b"
|
||||
integrity sha512-+A188cAdd6QuSRxMIwRrWLjgphQA0LDAQ/ECVlrPVJwnx+1i64NjDZivoqPYLOTkSPIKntiWwMhhf0U5/RrPHQ==
|
||||
esbuild-linux-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz#0092fc8a064001a777bfa0e3b425bb8be8f96e6a"
|
||||
integrity sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w==
|
||||
|
||||
esbuild-linux-arm64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4202,10 +4197,10 @@ esbuild-linux-arm64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.7.tgz#53a53f43669ef705c925bf275491d507cb77b06b"
|
||||
integrity sha512-aM2BUTdbtzEUOuLqDusGCuWQRqc0JazgbA/6+Q9xhUgNLHGUMAsu4C5G0qPnJCTlWGZX+bcQYma6wFVEp9ibBg==
|
||||
|
||||
esbuild-linux-arm@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.4.tgz#186cd9b8885ac132b9953a4a0afe668168debd10"
|
||||
integrity sha512-BH5gKve4jglS7UPSsfwHSX79I5agC/lm4eKoRUEyo8lwQs89frQSRp2Xup+6SFQnxt3md5EsKcd2Dbkqeb3gPA==
|
||||
esbuild-linux-arm64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz#5cd3f2bb924212971482e8dbc25c4afd09b28110"
|
||||
integrity sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ==
|
||||
|
||||
esbuild-linux-arm@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4217,10 +4212,10 @@ esbuild-linux-arm@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.7.tgz#3372ea117517aa3194ed1622305ab76bf2550b1d"
|
||||
integrity sha512-GOAt1brGG14mmQx2sRD3wHi3rih94OzhmDRVyo7JvlSmWOfEczPf7zL7YfmgjuktvvuLTERtTJzaih7nyCwPOg==
|
||||
|
||||
esbuild-linux-mips64le@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.4.tgz#42049bf72bc586817b4a51cc9e32148d13e5e807"
|
||||
integrity sha512-0xkwtPaUkG5xMTFGaQPe1AadSe5QAiQuD4Gix1O9k5Xo/U8xGIkw9UFUTvfEUeu71vFb6ZgsIacfP1NLoFjWNw==
|
||||
esbuild-linux-arm@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz#ad634f96bf2975536907aeb9fdb75a3194f4ddce"
|
||||
integrity sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg==
|
||||
|
||||
esbuild-linux-mips64le@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4232,10 +4227,10 @@ esbuild-linux-mips64le@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.7.tgz#c431291deecb949a4cdbbab0bc01b6b4a962104a"
|
||||
integrity sha512-+UJq6cxpc2ldaQFdpEDrBhqhluXsqCNlWiHccIjq25r+3YbFg0c/RJEypoVU7tjhGXUGWyWWQ7SLkzHYpf+Nsg==
|
||||
|
||||
esbuild-linux-ppc64le@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.4.tgz#adf1ce2ef2302757c4383887da6ac4dd25be9d4f"
|
||||
integrity sha512-E1+oJPP7A+j23GPo3CEpBhGwG1bni4B8IbTA3/3rvzjURwUMZdcN3Fhrz24rnjzdLSHmULtOE4VsbT42h1Om4Q==
|
||||
esbuild-linux-mips64le@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz#57857edfebf9bf65766dc8be1637f2179c990572"
|
||||
integrity sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA==
|
||||
|
||||
esbuild-linux-ppc64le@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4247,6 +4242,11 @@ esbuild-linux-ppc64le@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.7.tgz#d47b2322ac1ad61669045d5f95181d4f0d9744d2"
|
||||
integrity sha512-6zwpliO4ZZtodDYM1JJEmSMpkd07I8bnNOKoHe7TOs9VhylXJooHh5ObSbSvk3FxCBs+jL5bxb24p10/Cg4RGw==
|
||||
|
||||
esbuild-linux-ppc64le@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz#fdb82a059a5b86bb10fb42091b4ebcf488b9cd46"
|
||||
integrity sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig==
|
||||
|
||||
esbuild-netbsd-64@0.13.6:
|
||||
version "0.13.6"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.6.tgz#1c5daa62571f1065e4a1100a1db5e488ef259024"
|
||||
|
@ -4257,10 +4257,10 @@ esbuild-netbsd-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.7.tgz#9c9fed5dfc2f3656de024496f10928368a29ea10"
|
||||
integrity sha512-CfTHeTfJWlwjgfpApXYvECytLD6BzTWovLE0+28KT7bjU5fM4ieDYzRvjWjFAOB2X6DWpaoQnJAlhJirQBW0EQ==
|
||||
|
||||
esbuild-openbsd-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.4.tgz#1c8122101898c52a20c8786935cf3eb7a19b83b4"
|
||||
integrity sha512-xEkI1o5HYxDzbv9jSox0EsDxpwraG09SRiKKv0W8pH6O3bt+zPSlnoK7+I7Q69tkvONkpIq5n2o+c55uq0X7cw==
|
||||
esbuild-netbsd-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz#d7879e7123d3b2c04754ece8bd061aa6866deeff"
|
||||
integrity sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q==
|
||||
|
||||
esbuild-openbsd-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4272,10 +4272,10 @@ esbuild-openbsd-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.7.tgz#fc039ce363b0ad5617a82dc9d312fccebd950070"
|
||||
integrity sha512-qfW+f0MQfl72zVwgbV00I1kAP2zty+N031cNnQINcBmzHOSbEbaBQbUM0kawq+wdfgS/Xmppgf7nD1H8GWAvow==
|
||||
|
||||
esbuild-sunos-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.4.tgz#4ec95faa14a60f295fe485bebffefff408739337"
|
||||
integrity sha512-bjXUMcODMnB6hQicLBBmmnBl7OMDyVpFahKvHGXJfDChIi5udiIRKCmFUFIRn+AUAKVlfrofRKdyPC7kBsbvGQ==
|
||||
esbuild-openbsd-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz#88b280b6cb0a3f6adb60abf27fc506c506a35cf0"
|
||||
integrity sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw==
|
||||
|
||||
esbuild-sunos-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4287,10 +4287,10 @@ esbuild-sunos-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.7.tgz#ad85a2f2cd38b6e920f2ad07ebc134cdba92e26d"
|
||||
integrity sha512-fVRM9mV0wAYLt92IqzudxACMLJZRQFx1oJsNeU4fPFmUxIkYE4C7G7z9vqI2eu9bpDo1fA+3+5djo/T/28Mckg==
|
||||
|
||||
esbuild-windows-32@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.4.tgz#3182c380487b797b04d0ec2c80c2945666869080"
|
||||
integrity sha512-z4CH07pfyVY0XF98TCsGmLxKCl0kyvshKDbdpTekW9f2d+dJqn5mmoUyWhpSVJ0SfYWJg86FoD9nMbbaMVyGdg==
|
||||
esbuild-sunos-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz#229ae7c7703196a58acd0f0291ad9bebda815d63"
|
||||
integrity sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw==
|
||||
|
||||
esbuild-windows-32@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4302,10 +4302,10 @@ esbuild-windows-32@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.7.tgz#146b416c5172a2c252ce29f899c0c8f1a20eac50"
|
||||
integrity sha512-v3csjeQtlHHWS1q/tE9rTRCSSU/fGvJVh1l7gkS93ysAaIMeC0j9Q0h2PxFpQ6yxuwftuDYfQdnkVGcqjkKM8A==
|
||||
|
||||
esbuild-windows-64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.4.tgz#b9e995f92d81f433a04f33611e603e82f9232e69"
|
||||
integrity sha512-uVL11vORRPjocGLYam67rwFLd0LvkrHEs+JG+1oJN4UD9MQmNGZPa4gBHo6hDpF+kqRJ9kXgQSeDqUyRy0tj/Q==
|
||||
esbuild-windows-32@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz#892d093e32a21c0c9135e5a0ffdc380aeb70e763"
|
||||
integrity sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A==
|
||||
|
||||
esbuild-windows-64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4317,10 +4317,10 @@ esbuild-windows-64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.7.tgz#9eaffae2204263a7b35313ea51a6a6e5a5e0bb48"
|
||||
integrity sha512-vk+yv/vYpHZP0vxSaxaA4EMaicuxy4E435EXkbsgk5UgpcQgSP0CVlIeaqtgfSM3IwGnpbagOirRVqqZqxyMDQ==
|
||||
|
||||
esbuild-windows-arm64@0.13.4:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.4.tgz#fb239532f07b764d158f4cc787178ef4c6fadb5c"
|
||||
integrity sha512-vA6GLvptgftRcDcWngD5cMlL4f4LbL8JjU2UMT9yJ0MT5ra6hdZNFWnOeOoEtY4GtJ6OjZ0i+81sTqhAB0fMkg==
|
||||
esbuild-windows-64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz#7defd8d79ae3bb7e6f53b65a7190be7daf901686"
|
||||
integrity sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg==
|
||||
|
||||
esbuild-windows-arm64@0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -4332,32 +4332,38 @@ esbuild-windows-arm64@0.13.7:
|
|||
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.7.tgz#6937647f05528248b1634027d839ae81ffdde8c2"
|
||||
integrity sha512-0Fp+IeG5qWLCK+U6d8L9/SnXkI6f3JMtauSQ8HHzw3Fl0pZ+VImUAUWZ3g2fhthNqp+t8dB3n238CJD6XBn15w==
|
||||
|
||||
esbuild-windows-arm64@0.13.8:
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz#e59ae004496fd8a5ab67bfc7945a2e47480d6fb9"
|
||||
integrity sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg==
|
||||
|
||||
esbuild@^0.11.16:
|
||||
version "0.11.23"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.23.tgz#c42534f632e165120671d64db67883634333b4b8"
|
||||
integrity sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==
|
||||
|
||||
esbuild@^0.13.2:
|
||||
version "0.13.4"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.4.tgz#ce2deb56c4fb360938311cbfc67f8e467bb6841b"
|
||||
integrity sha512-wMA5eUwpavTBiNl+It6j8OQuKVh69l6z4DKDLzoTIqC+gChnPpcmqdA8WNHptUHRnfyML+mKEQPlW7Mybj8gHg==
|
||||
version "0.13.8"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.8.tgz#bd7cc51b881ab067789f88e17baca74724c1ec4f"
|
||||
integrity sha512-A4af7G7YZLfG5OnARJRMtlpEsCkq/zHZQXewgPA864l9D6VjjbH1SuFYK/OSV6BtHwDGkdwyRrX0qQFLnMfUcw==
|
||||
optionalDependencies:
|
||||
esbuild-android-arm64 "0.13.4"
|
||||
esbuild-darwin-64 "0.13.4"
|
||||
esbuild-darwin-arm64 "0.13.4"
|
||||
esbuild-freebsd-64 "0.13.4"
|
||||
esbuild-freebsd-arm64 "0.13.4"
|
||||
esbuild-linux-32 "0.13.4"
|
||||
esbuild-linux-64 "0.13.4"
|
||||
esbuild-linux-arm "0.13.4"
|
||||
esbuild-linux-arm64 "0.13.4"
|
||||
esbuild-linux-mips64le "0.13.4"
|
||||
esbuild-linux-ppc64le "0.13.4"
|
||||
esbuild-openbsd-64 "0.13.4"
|
||||
esbuild-sunos-64 "0.13.4"
|
||||
esbuild-windows-32 "0.13.4"
|
||||
esbuild-windows-64 "0.13.4"
|
||||
esbuild-windows-arm64 "0.13.4"
|
||||
esbuild-android-arm64 "0.13.8"
|
||||
esbuild-darwin-64 "0.13.8"
|
||||
esbuild-darwin-arm64 "0.13.8"
|
||||
esbuild-freebsd-64 "0.13.8"
|
||||
esbuild-freebsd-arm64 "0.13.8"
|
||||
esbuild-linux-32 "0.13.8"
|
||||
esbuild-linux-64 "0.13.8"
|
||||
esbuild-linux-arm "0.13.8"
|
||||
esbuild-linux-arm64 "0.13.8"
|
||||
esbuild-linux-mips64le "0.13.8"
|
||||
esbuild-linux-ppc64le "0.13.8"
|
||||
esbuild-netbsd-64 "0.13.8"
|
||||
esbuild-openbsd-64 "0.13.8"
|
||||
esbuild-sunos-64 "0.13.8"
|
||||
esbuild-windows-32 "0.13.8"
|
||||
esbuild-windows-64 "0.13.8"
|
||||
esbuild-windows-arm64 "0.13.8"
|
||||
|
||||
esbuild@^0.13.6:
|
||||
version "0.13.6"
|
||||
|
@ -7624,9 +7630,9 @@ nanoid@3.1.25, nanoid@^3.1.23:
|
|||
integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==
|
||||
|
||||
nanoid@^3.1.28:
|
||||
version "3.1.29"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4"
|
||||
integrity sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg==
|
||||
version "3.1.30"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
|
||||
integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
|
||||
|
||||
nanostores@^0.3.3:
|
||||
version "0.3.3"
|
||||
|
@ -11066,9 +11072,9 @@ vfile@^5.0.0:
|
|||
vfile-message "^3.0.0"
|
||||
|
||||
vite@^2.6.7:
|
||||
version "2.6.7"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.7.tgz#e15c1d8327950720b5d7c4ec3fb36a5a58ccf7cb"
|
||||
integrity sha512-ewk//jve9k6vlU8PfJmWUHN8k0YYdw4VaKOMvoQ3nT2Pb6k5OSMKQi4jPOzVH/TlUqMsCrq7IJ80xcuDDVyigg==
|
||||
version "2.6.10"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.10.tgz#7a4f420c6e2c7d9062c7f9ce4578a817c72b3842"
|
||||
integrity sha512-XbevwpDJMs3lKiGEj0UQScsOCpwHIjFgfzPnFVkPgnxsF9oPv1uGyckLg58XkXv6LnO46KN9yZqJzINFmAxtUg==
|
||||
dependencies:
|
||||
esbuild "^0.13.2"
|
||||
postcss "^8.3.8"
|
||||
|
|
Loading…
Reference in a new issue