astro 3.0.12 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/astro-jsx.d.ts +28 -1
- package/client.d.ts +8 -4
- package/components/ViewTransitions.astro +77 -24
- package/content-types.template.d.ts +6 -1
- package/dist/@types/astro.d.ts +43 -22
- package/dist/assets/build/generate.d.ts +1 -1
- package/dist/assets/build/remote.d.ts +1 -1
- package/dist/assets/consts.d.ts +2 -2
- package/dist/assets/consts.js +4 -10
- package/dist/assets/internal.js +3 -2
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +7 -3
- package/dist/assets/services/vendor/squoosh/avif/avif_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/avif/avif_node_enc.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/codecs.d.ts +4 -4
- package/dist/assets/services/vendor/squoosh/image-pool.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/image.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/image_data.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/impl.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/png/squoosh_oxipng_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/png/squoosh_png_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/resize/squoosh_resize_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/rotate/rotate.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/utils/workerPool.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/webp/webp_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/webp/webp_node_enc.wasm.d.ts +1 -1
- package/dist/assets/utils/metadata.d.ts +1 -1
- package/dist/assets/utils/metadata.js +6 -2
- package/dist/assets/vite-plugin-assets.d.ts +1 -1
- package/dist/assets/vite-plugin-assets.js +1 -1
- package/dist/cli/add/babel.d.ts +12 -11
- package/dist/config/index.d.ts +1 -1
- package/dist/config/vite-plugin-content-listen.d.ts +2 -2
- package/dist/content/server-listeners.d.ts +1 -1
- package/dist/content/types-generator.d.ts +2 -2
- package/dist/content/utils.d.ts +1 -1
- package/dist/content/utils.js +1 -1
- package/dist/content/vite-plugin-content-assets.d.ts +1 -1
- package/dist/content/vite-plugin-content-imports.d.ts +1 -1
- package/dist/content/vite-plugin-content-virtual-mod.d.ts +1 -1
- package/dist/core/app/common.d.ts +1 -1
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/node.d.ts +3 -3
- package/dist/core/app/ssrPipeline.d.ts +1 -1
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/build/buildPipeline.d.ts +4 -4
- package/dist/core/build/common.d.ts +1 -1
- package/dist/core/build/css-asset-name.d.ts +1 -1
- package/dist/core/build/generate.d.ts +2 -2
- package/dist/core/build/generate.js +3 -0
- package/dist/core/build/index.d.ts +1 -1
- package/dist/core/build/internal.d.ts +3 -3
- package/dist/core/build/page-data.d.ts +3 -3
- package/dist/core/build/plugin.d.ts +2 -2
- package/dist/core/build/plugins/index.d.ts +1 -1
- package/dist/core/build/plugins/plugin-css.d.ts +3 -3
- package/dist/core/build/plugins/plugin-hoisted-scripts.d.ts +3 -3
- package/dist/core/build/plugins/plugin-internals.d.ts +1 -1
- package/dist/core/build/plugins/plugin-manifest.d.ts +3 -3
- package/dist/core/build/plugins/plugin-manifest.js +2 -2
- package/dist/core/build/plugins/plugin-middleware.d.ts +3 -3
- package/dist/core/build/plugins/plugin-pages.d.ts +3 -3
- package/dist/core/build/plugins/plugin-prerender.d.ts +1 -1
- package/dist/core/build/plugins/plugin-renderers.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.js +2 -2
- package/dist/core/build/static-build.d.ts +2 -2
- package/dist/core/build/types.d.ts +5 -4
- package/dist/core/compile/cache.d.ts +1 -1
- package/dist/core/compile/compile.d.ts +1 -1
- package/dist/core/compile/index.d.ts +2 -2
- package/dist/core/config/config.d.ts +2 -2
- package/dist/core/config/index.d.ts +1 -1
- package/dist/core/config/schema.d.ts +29 -15
- package/dist/core/config/schema.js +1 -0
- package/dist/core/config/settings.d.ts +1 -1
- package/dist/core/config/vite-load.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/response.d.ts +1 -1
- package/dist/core/create-vite.d.ts +3 -3
- package/dist/core/create-vite.js +1 -1
- package/dist/core/dev/container.d.ts +4 -4
- package/dist/core/dev/dev.d.ts +3 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/dev/restart.d.ts +3 -3
- package/dist/core/endpoint/index.d.ts +3 -3
- package/dist/core/errors/dev/utils.js +4 -4
- package/dist/core/errors/errors-data.d.ts +12 -3
- package/dist/core/errors/errors-data.js +7 -4
- package/dist/core/errors/index.d.ts +1 -1
- package/dist/core/errors/overlay.js +2 -2
- package/dist/core/logger/node.d.ts +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/callMiddleware.d.ts +2 -2
- package/dist/core/middleware/index.d.ts +2 -2
- package/dist/core/middleware/loadMiddleware.d.ts +2 -2
- package/dist/core/middleware/sequence.d.ts +1 -1
- package/dist/core/module-loader/loader.d.ts +2 -2
- package/dist/core/module-loader/vite.d.ts +1 -1
- package/dist/core/pipeline.d.ts +1 -1
- package/dist/core/preview/index.d.ts +1 -1
- package/dist/core/preview/static-preview-server.d.ts +3 -3
- package/dist/core/redirects/component.d.ts +2 -2
- package/dist/core/redirects/helpers.d.ts +1 -1
- package/dist/core/render/context.d.ts +2 -2
- package/dist/core/render/core.d.ts +1 -1
- package/dist/core/render/environment.d.ts +1 -1
- package/dist/core/render/index.d.ts +2 -2
- package/dist/core/render/paginate.d.ts +1 -1
- package/dist/core/render/params-and-props.d.ts +1 -1
- package/dist/core/render/renderer.d.ts +1 -1
- package/dist/core/render/result.d.ts +1 -1
- package/dist/core/render/route-cache.d.ts +1 -1
- package/dist/core/render/ssr-element.d.ts +2 -2
- package/dist/core/render/ssr-element.js +1 -3
- package/dist/core/request.d.ts +2 -2
- package/dist/core/routing/manifest/create.d.ts +3 -3
- package/dist/core/routing/manifest/generator.d.ts +1 -1
- package/dist/core/routing/manifest/serialization.d.ts +1 -1
- package/dist/core/routing/match.d.ts +1 -1
- package/dist/core/routing/params.d.ts +1 -1
- package/dist/core/routing/validation.d.ts +2 -2
- package/dist/core/sync/index.d.ts +2 -2
- package/dist/core/util.d.ts +2 -2
- package/dist/events/session.d.ts +1 -1
- package/dist/integrations/astroFeaturesValidation.d.ts +1 -1
- package/dist/integrations/index.d.ts +3 -3
- package/dist/prerender/metadata.d.ts +1 -1
- package/dist/prerender/routing.d.ts +2 -2
- package/dist/prerender/utils.d.ts +1 -1
- package/dist/runtime/client/hmr.js +1 -1
- package/dist/runtime/client/idle.d.ts +1 -1
- package/dist/runtime/client/load.d.ts +1 -1
- package/dist/runtime/client/media.d.ts +1 -1
- package/dist/runtime/client/only.d.ts +1 -1
- package/dist/runtime/client/visible.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.js +1 -1
- package/dist/runtime/server/astro-component.d.ts +1 -1
- package/dist/runtime/server/astro-global.d.ts +1 -1
- package/dist/runtime/server/astro-island.d.ts +1 -4
- package/dist/runtime/server/endpoint.d.ts +2 -2
- package/dist/runtime/server/hydration.d.ts +1 -1
- package/dist/runtime/server/render/astro/factory.d.ts +3 -3
- package/dist/runtime/server/render/astro/head-and-content.d.ts +1 -1
- package/dist/runtime/server/render/astro/index.d.ts +2 -2
- package/dist/runtime/server/render/astro/instance.d.ts +1 -1
- package/dist/runtime/server/render/astro/render.d.ts +1 -1
- package/dist/runtime/server/render/common.d.ts +1 -1
- package/dist/runtime/server/render/component.d.ts +1 -1
- package/dist/runtime/server/render/dom.d.ts +1 -1
- package/dist/runtime/server/render/head.d.ts +1 -1
- package/dist/runtime/server/render/index.d.ts +2 -2
- package/dist/runtime/server/render/page.d.ts +2 -2
- package/dist/runtime/server/render/tags.d.ts +2 -2
- package/dist/runtime/server/render/tags.js +1 -1
- package/dist/runtime/server/render/util.d.ts +1 -1
- package/dist/runtime/server/scripts.d.ts +1 -1
- package/dist/runtime/server/serialize.d.ts +1 -1
- package/dist/runtime/server/transition.d.ts +1 -1
- package/dist/transitions/index.d.ts +1 -1
- package/dist/type-utils.d.ts +4 -0
- package/dist/vite-plugin-astro/hmr.d.ts +1 -1
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro/metadata.d.ts +2 -2
- package/dist/vite-plugin-astro/types.d.ts +1 -1
- package/dist/vite-plugin-astro-server/base.d.ts +1 -1
- package/dist/vite-plugin-astro-server/controller.d.ts +2 -2
- package/dist/vite-plugin-astro-server/css.d.ts +1 -1
- package/dist/vite-plugin-astro-server/devPipeline.d.ts +4 -4
- package/dist/vite-plugin-astro-server/index.d.ts +1 -1
- package/dist/vite-plugin-astro-server/metadata.d.ts +2 -2
- package/dist/vite-plugin-astro-server/plugin.d.ts +2 -2
- package/dist/vite-plugin-astro-server/request.d.ts +4 -4
- package/dist/vite-plugin-astro-server/resolve.d.ts +1 -1
- package/dist/vite-plugin-astro-server/response.d.ts +2 -2
- package/dist/vite-plugin-astro-server/route.d.ts +2 -2
- package/dist/vite-plugin-astro-server/route.js +0 -1
- package/dist/vite-plugin-astro-server/scripts.d.ts +2 -2
- package/dist/vite-plugin-astro-server/vite.d.ts +1 -1
- package/dist/vite-plugin-config-alias/index.d.ts +1 -1
- package/dist/vite-plugin-env/index.d.ts +1 -1
- package/dist/vite-plugin-inject-env-ts/index.d.ts +1 -1
- package/dist/vite-plugin-load-fallback/index.d.ts +1 -1
- package/dist/vite-plugin-markdown/index.d.ts +1 -1
- package/dist/vite-plugin-markdown/index.js +20 -20
- package/dist/vite-plugin-mdx/index.d.ts +1 -1
- package/dist/vite-plugin-utils/index.d.ts +1 -1
- package/package.json +4 -2
- package/types.d.ts +6 -1
- package/dist/assets/vendor/image-size/detector.d.ts +0 -3
- package/dist/assets/vendor/image-size/detector.js +0 -28
- package/dist/assets/vendor/image-size/index.d.ts +0 -11
- package/dist/assets/vendor/image-size/index.js +0 -93
- package/dist/assets/vendor/image-size/readUInt.d.ts +0 -4
- package/dist/assets/vendor/image-size/readUInt.js +0 -9
- package/dist/assets/vendor/image-size/types/bmp.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/bmp.js +0 -14
- package/dist/assets/vendor/image-size/types/cur.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/cur.js +0 -16
- package/dist/assets/vendor/image-size/types/dds.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/dds.js +0 -14
- package/dist/assets/vendor/image-size/types/gif.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/gif.js +0 -16
- package/dist/assets/vendor/image-size/types/icns.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/icns.js +0 -87
- package/dist/assets/vendor/image-size/types/ico.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/ico.js +0 -42
- package/dist/assets/vendor/image-size/types/interface.d.ts +0 -14
- package/dist/assets/vendor/image-size/types/interface.js +0 -0
- package/dist/assets/vendor/image-size/types/j2c.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/j2c.js +0 -14
- package/dist/assets/vendor/image-size/types/jp2.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/jp2.js +0 -56
- package/dist/assets/vendor/image-size/types/jpg.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/jpg.js +0 -95
- package/dist/assets/vendor/image-size/types/ktx.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/ktx.js +0 -15
- package/dist/assets/vendor/image-size/types/png.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/png.js +0 -33
- package/dist/assets/vendor/image-size/types/pnm.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/pnm.js +0 -72
- package/dist/assets/vendor/image-size/types/psd.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/psd.js +0 -14
- package/dist/assets/vendor/image-size/types/svg.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/svg.js +0 -91
- package/dist/assets/vendor/image-size/types/tiff.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/tiff.js +0 -81
- package/dist/assets/vendor/image-size/types/webp.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/webp.js +0 -51
- package/dist/assets/vendor/image-size/types.d.ts +0 -19
- package/dist/assets/vendor/image-size/types.js +0 -37
- package/dist/assets/vendor/queue/queue.d.ts +0 -39
- package/dist/assets/vendor/queue/queue.js +0 -187
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
const has = Object.prototype.hasOwnProperty;
|
|
2
|
-
class QueueEvent extends Event {
|
|
3
|
-
constructor(name, detail) {
|
|
4
|
-
super(name);
|
|
5
|
-
this.detail = detail;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
class Queue extends EventTarget {
|
|
9
|
-
constructor(options = {}) {
|
|
10
|
-
super();
|
|
11
|
-
const { concurrency = Infinity, timeout = 0, autostart = false, results = null } = options;
|
|
12
|
-
this.concurrency = concurrency;
|
|
13
|
-
this.timeout = timeout;
|
|
14
|
-
this.autostart = autostart;
|
|
15
|
-
this.results = results;
|
|
16
|
-
this.pending = 0;
|
|
17
|
-
this.session = 0;
|
|
18
|
-
this.running = false;
|
|
19
|
-
this.jobs = [];
|
|
20
|
-
this.timers = [];
|
|
21
|
-
this.addEventListener("error", this._errorHandler);
|
|
22
|
-
}
|
|
23
|
-
_errorHandler(evt) {
|
|
24
|
-
this.end(evt.detail.error);
|
|
25
|
-
}
|
|
26
|
-
pop() {
|
|
27
|
-
return this.jobs.pop();
|
|
28
|
-
}
|
|
29
|
-
shift() {
|
|
30
|
-
return this.jobs.shift();
|
|
31
|
-
}
|
|
32
|
-
indexOf(searchElement, fromIndex) {
|
|
33
|
-
return this.jobs.indexOf(searchElement, fromIndex);
|
|
34
|
-
}
|
|
35
|
-
lastIndexOf(searchElement, fromIndex) {
|
|
36
|
-
if (fromIndex !== void 0) {
|
|
37
|
-
return this.jobs.lastIndexOf(searchElement, fromIndex);
|
|
38
|
-
}
|
|
39
|
-
return this.jobs.lastIndexOf(searchElement);
|
|
40
|
-
}
|
|
41
|
-
slice(start, end) {
|
|
42
|
-
this.jobs = this.jobs.slice(start, end);
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
reverse() {
|
|
46
|
-
this.jobs.reverse();
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
push(...workers) {
|
|
50
|
-
const methodResult = this.jobs.push(...workers);
|
|
51
|
-
if (this.autostart) {
|
|
52
|
-
this.start();
|
|
53
|
-
}
|
|
54
|
-
return methodResult;
|
|
55
|
-
}
|
|
56
|
-
unshift(...workers) {
|
|
57
|
-
const methodResult = this.jobs.unshift(...workers);
|
|
58
|
-
if (this.autostart) {
|
|
59
|
-
this.start();
|
|
60
|
-
}
|
|
61
|
-
return methodResult;
|
|
62
|
-
}
|
|
63
|
-
splice(start, deleteCount, ...workers) {
|
|
64
|
-
this.jobs.splice(start, deleteCount, ...workers);
|
|
65
|
-
if (this.autostart) {
|
|
66
|
-
this.start();
|
|
67
|
-
}
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
get length() {
|
|
71
|
-
return this.pending + this.jobs.length;
|
|
72
|
-
}
|
|
73
|
-
start(callback) {
|
|
74
|
-
let awaiter;
|
|
75
|
-
if (callback) {
|
|
76
|
-
this._addCallbackToEndEvent(callback);
|
|
77
|
-
} else {
|
|
78
|
-
awaiter = this._createPromiseToEndEvent();
|
|
79
|
-
}
|
|
80
|
-
this.running = true;
|
|
81
|
-
if (this.pending >= this.concurrency) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (this.jobs.length === 0) {
|
|
85
|
-
if (this.pending === 0) {
|
|
86
|
-
this.done();
|
|
87
|
-
}
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const job = this.jobs.shift();
|
|
91
|
-
const session = this.session;
|
|
92
|
-
const timeout = job !== void 0 && has.call(job, "timeout") ? job.timeout : this.timeout;
|
|
93
|
-
let once = true;
|
|
94
|
-
let timeoutId = null;
|
|
95
|
-
let didTimeout = false;
|
|
96
|
-
let resultIndex = null;
|
|
97
|
-
const next = (error, ...result) => {
|
|
98
|
-
if (once && this.session === session) {
|
|
99
|
-
once = false;
|
|
100
|
-
this.pending--;
|
|
101
|
-
if (timeoutId !== null) {
|
|
102
|
-
this.timers = this.timers.filter((tID) => tID !== timeoutId);
|
|
103
|
-
clearTimeout(timeoutId);
|
|
104
|
-
}
|
|
105
|
-
if (error) {
|
|
106
|
-
this.dispatchEvent(new QueueEvent("error", { error, job }));
|
|
107
|
-
} else if (!didTimeout) {
|
|
108
|
-
if (resultIndex !== null && this.results !== null) {
|
|
109
|
-
this.results[resultIndex] = [...result];
|
|
110
|
-
}
|
|
111
|
-
this.dispatchEvent(new QueueEvent("success", { result: [...result], job }));
|
|
112
|
-
}
|
|
113
|
-
if (this.session === session) {
|
|
114
|
-
if (this.pending === 0 && this.jobs.length === 0) {
|
|
115
|
-
this.done();
|
|
116
|
-
} else if (this.running) {
|
|
117
|
-
this.start();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
if (timeout) {
|
|
123
|
-
timeoutId = setTimeout(() => {
|
|
124
|
-
didTimeout = true;
|
|
125
|
-
this.dispatchEvent(new QueueEvent("timeout", { next, job }));
|
|
126
|
-
next();
|
|
127
|
-
}, timeout);
|
|
128
|
-
this.timers.push(timeoutId);
|
|
129
|
-
}
|
|
130
|
-
if (this.results != null) {
|
|
131
|
-
resultIndex = this.results.length;
|
|
132
|
-
this.results[resultIndex] = null;
|
|
133
|
-
}
|
|
134
|
-
this.pending++;
|
|
135
|
-
this.dispatchEvent(new QueueEvent("start", { job }));
|
|
136
|
-
const promise = job(next);
|
|
137
|
-
if (promise !== void 0 && typeof promise.then === "function") {
|
|
138
|
-
promise.then(function(result) {
|
|
139
|
-
return next(void 0, result);
|
|
140
|
-
}).catch(function(err) {
|
|
141
|
-
return next(err || true);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
if (this.running && this.jobs.length > 0) {
|
|
145
|
-
return this.start();
|
|
146
|
-
}
|
|
147
|
-
return awaiter;
|
|
148
|
-
}
|
|
149
|
-
stop() {
|
|
150
|
-
this.running = false;
|
|
151
|
-
}
|
|
152
|
-
end(error) {
|
|
153
|
-
this.clearTimers();
|
|
154
|
-
this.jobs.length = 0;
|
|
155
|
-
this.pending = 0;
|
|
156
|
-
this.done(error);
|
|
157
|
-
}
|
|
158
|
-
clearTimers() {
|
|
159
|
-
this.timers.forEach((timer) => {
|
|
160
|
-
clearTimeout(timer);
|
|
161
|
-
});
|
|
162
|
-
this.timers = [];
|
|
163
|
-
}
|
|
164
|
-
_addCallbackToEndEvent(cb) {
|
|
165
|
-
const onend = (evt) => {
|
|
166
|
-
this.removeEventListener("end", onend);
|
|
167
|
-
cb(evt.detail.error, this.results);
|
|
168
|
-
};
|
|
169
|
-
this.addEventListener("end", onend);
|
|
170
|
-
}
|
|
171
|
-
_createPromiseToEndEvent() {
|
|
172
|
-
return new Promise((resolve) => {
|
|
173
|
-
this._addCallbackToEndEvent((error, results) => {
|
|
174
|
-
resolve({ error, results });
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
done(error) {
|
|
179
|
-
this.session++;
|
|
180
|
-
this.running = false;
|
|
181
|
-
this.dispatchEvent(new QueueEvent("end", { error }));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
QueueEvent,
|
|
186
|
-
Queue as default
|
|
187
|
-
};
|