astro 4.4.15 → 4.5.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.
Files changed (95) hide show
  1. package/components/Code.astro +15 -12
  2. package/dist/@types/astro.d.ts +95 -18
  3. package/dist/assets/utils/getAssetsPrefix.d.ts +2 -0
  4. package/dist/assets/utils/getAssetsPrefix.js +14 -0
  5. package/dist/assets/vite-plugin-assets.js +10 -3
  6. package/dist/content/types-generator.js +56 -7
  7. package/dist/content/vite-plugin-content-assets.js +11 -3
  8. package/dist/core/app/common.js +2 -0
  9. package/dist/core/app/index.js +10 -2
  10. package/dist/core/app/types.d.ts +7 -2
  11. package/dist/core/base-pipeline.d.ts +2 -1
  12. package/dist/core/base-pipeline.js +2 -1
  13. package/dist/core/build/generate.js +1 -0
  14. package/dist/core/build/internal.d.ts +6 -0
  15. package/dist/core/build/internal.js +1 -0
  16. package/dist/core/build/plugins/index.js +6 -1
  17. package/dist/core/build/plugins/plugin-analyzer.js +10 -98
  18. package/dist/core/build/plugins/plugin-css.js +27 -1
  19. package/dist/core/build/plugins/plugin-manifest.js +5 -2
  20. package/dist/core/build/plugins/plugin-scripts.d.ts +8 -0
  21. package/dist/core/build/plugins/plugin-scripts.js +34 -0
  22. package/dist/core/compile/compile.d.ts +1 -7
  23. package/dist/core/compile/compile.js +5 -4
  24. package/dist/core/compile/style.d.ts +4 -3
  25. package/dist/core/compile/style.js +5 -4
  26. package/dist/core/compile/types.d.ts +11 -0
  27. package/dist/core/config/schema.d.ts +177 -113
  28. package/dist/core/config/schema.js +42 -9
  29. package/dist/core/config/vite-load.js +1 -0
  30. package/dist/core/constants.d.ts +1 -0
  31. package/dist/core/constants.js +3 -1
  32. package/dist/core/create-vite.js +5 -3
  33. package/dist/core/dev/dev.js +1 -1
  34. package/dist/core/errors/dev/vite.js +1 -1
  35. package/dist/core/messages.js +2 -2
  36. package/dist/core/render/params-and-props.js +2 -1
  37. package/dist/core/render/ssr-element.d.ts +8 -8
  38. package/dist/core/render/ssr-element.js +4 -2
  39. package/dist/core/render-context.js +3 -1
  40. package/dist/core/routing/astro-designed-error-pages.d.ts +2 -0
  41. package/dist/core/routing/astro-designed-error-pages.js +21 -0
  42. package/dist/runtime/client/dev-toolbar/apps/audit/index.d.ts +8 -15
  43. package/dist/runtime/client/dev-toolbar/apps/audit/index.js +130 -249
  44. package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.js → rules/a11y.js} +4 -2
  45. package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.d.ts +35 -0
  46. package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.js +40 -0
  47. package/dist/runtime/client/dev-toolbar/apps/audit/{perf.js → rules/perf.js} +2 -2
  48. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.d.ts +7 -0
  49. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.js +137 -0
  50. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.d.ts +23 -0
  51. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.js +384 -0
  52. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.d.ts +6 -0
  53. package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.js +126 -0
  54. package/dist/runtime/client/dev-toolbar/apps/utils/window.d.ts +1 -1
  55. package/dist/runtime/client/dev-toolbar/apps/utils/window.js +3 -1
  56. package/dist/runtime/client/dev-toolbar/entrypoint.js +43 -15
  57. package/dist/runtime/client/dev-toolbar/settings.d.ts +3 -1
  58. package/dist/runtime/client/dev-toolbar/settings.js +8 -2
  59. package/dist/runtime/client/dev-toolbar/toolbar.d.ts +1 -0
  60. package/dist/runtime/client/dev-toolbar/toolbar.js +10 -8
  61. package/dist/runtime/client/dev-toolbar/ui-library/badge.d.ts +14 -4
  62. package/dist/runtime/client/dev-toolbar/ui-library/badge.js +72 -33
  63. package/dist/runtime/client/dev-toolbar/ui-library/button.d.ts +14 -4
  64. package/dist/runtime/client/dev-toolbar/ui-library/button.js +100 -47
  65. package/dist/runtime/client/dev-toolbar/ui-library/card.d.ts +9 -0
  66. package/dist/runtime/client/dev-toolbar/ui-library/card.js +57 -2
  67. package/dist/runtime/client/dev-toolbar/ui-library/highlight.d.ts +9 -0
  68. package/dist/runtime/client/dev-toolbar/ui-library/highlight.js +54 -2
  69. package/dist/runtime/client/dev-toolbar/ui-library/icons.d.ts +4 -0
  70. package/dist/runtime/client/dev-toolbar/ui-library/icons.js +5 -1
  71. package/dist/runtime/client/dev-toolbar/ui-library/toggle.d.ts +9 -0
  72. package/dist/runtime/client/dev-toolbar/ui-library/toggle.js +64 -5
  73. package/dist/runtime/compiler/index.d.ts +1 -1
  74. package/dist/runtime/compiler/index.js +2 -0
  75. package/dist/runtime/server/hydration.js +3 -2
  76. package/dist/runtime/server/index.d.ts +1 -1
  77. package/dist/runtime/server/index.js +2 -0
  78. package/dist/runtime/server/render/astro/factory.d.ts +1 -1
  79. package/dist/runtime/server/render/index.d.ts +1 -0
  80. package/dist/runtime/server/render/index.js +2 -0
  81. package/dist/runtime/server/render/script.d.ts +6 -0
  82. package/dist/runtime/server/render/script.js +15 -0
  83. package/dist/transitions/router.js +12 -3
  84. package/dist/vite-plugin-astro/index.d.ts +2 -2
  85. package/dist/vite-plugin-astro/index.js +12 -1
  86. package/dist/vite-plugin-astro/types.d.ts +21 -1
  87. package/dist/vite-plugin-astro-server/pipeline.js +6 -2
  88. package/dist/vite-plugin-astro-server/plugin.js +6 -2
  89. package/dist/vite-plugin-astro-server/response.d.ts +6 -0
  90. package/dist/vite-plugin-astro-server/response.js +13 -0
  91. package/dist/vite-plugin-astro-server/route.js +18 -2
  92. package/package.json +7 -8
  93. package/tsconfigs/base.json +3 -1
  94. /package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.d.ts → rules/a11y.d.ts} +0 -0
  95. /package/dist/runtime/client/dev-toolbar/apps/audit/{perf.d.ts → rules/perf.d.ts} +0 -0
@@ -12,6 +12,7 @@ import { pluginMiddleware } from "./plugin-middleware.js";
12
12
  import { pluginPages } from "./plugin-pages.js";
13
13
  import { pluginPrerender } from "./plugin-prerender.js";
14
14
  import { pluginRenderers } from "./plugin-renderers.js";
15
+ import { pluginScripts } from "./plugin-scripts.js";
15
16
  import { pluginSSR, pluginSSRSplit } from "./plugin-ssr.js";
16
17
  function registerAllPlugins({ internals, options, register }) {
17
18
  register(pluginComponentEntry(internals));
@@ -26,7 +27,11 @@ function registerAllPlugins({ internals, options, register }) {
26
27
  register(astroHeadBuildPlugin(internals));
27
28
  register(pluginPrerender(options, internals));
28
29
  register(astroConfigBuildPlugin(options, internals));
29
- register(pluginHoistedScripts(options, internals));
30
+ if (options.settings.config.experimental.directRenderScript) {
31
+ register(pluginScripts(internals));
32
+ } else {
33
+ register(pluginHoistedScripts(options, internals));
34
+ }
30
35
  register(pluginSSR(options, internals));
31
36
  register(pluginSSRSplit(options, internals));
32
37
  register(pluginChunks());
@@ -9,82 +9,6 @@ function isPropagatedAsset(id) {
9
9
  return false;
10
10
  }
11
11
  }
12
- async function doesParentImportChild(parentInfo, childInfo, childExportNames) {
13
- if (!childInfo || !parentInfo.ast || !childExportNames)
14
- return "no";
15
- if (childExportNames === "dynamic" || parentInfo.dynamicallyImportedIds?.includes(childInfo.id)) {
16
- return "dynamic";
17
- }
18
- const imports = [];
19
- const exports = [];
20
- for (const node of parentInfo.ast.body) {
21
- if (node.type === "ImportDeclaration") {
22
- imports.push(node);
23
- } else if (node.type === "ExportDefaultDeclaration" || node.type === "ExportNamedDeclaration") {
24
- exports.push(node);
25
- }
26
- }
27
- const importNames = [];
28
- const exportNames = [];
29
- for (const node of imports) {
30
- const resolved = await this.resolve(node.source.value, parentInfo.id);
31
- if (!resolved || resolved.id !== childInfo.id)
32
- continue;
33
- for (const specifier of node.specifiers) {
34
- if (specifier.type === "ImportNamespaceSpecifier")
35
- continue;
36
- const name = specifier.type === "ImportDefaultSpecifier" ? "default" : specifier.imported.name;
37
- if (childExportNames.includes(name)) {
38
- importNames.push(specifier.local.name);
39
- }
40
- }
41
- }
42
- for (const node of exports) {
43
- if (node.type === "ExportDefaultDeclaration") {
44
- if (node.declaration.type === "Identifier" && importNames.includes(node.declaration.name)) {
45
- exportNames.push("default");
46
- }
47
- } else {
48
- if (node.source) {
49
- const resolved = await this.resolve(node.source.value, parentInfo.id);
50
- if (!resolved || resolved.id !== childInfo.id)
51
- continue;
52
- for (const specifier of node.specifiers) {
53
- if (childExportNames.includes(specifier.local.name)) {
54
- importNames.push(specifier.local.name);
55
- exportNames.push(specifier.exported.name);
56
- }
57
- }
58
- }
59
- if (node.declaration) {
60
- if (node.declaration.type !== "VariableDeclaration")
61
- continue;
62
- for (const declarator of node.declaration.declarations) {
63
- if (declarator.init?.type !== "Identifier")
64
- continue;
65
- if (declarator.id.type !== "Identifier")
66
- continue;
67
- if (importNames.includes(declarator.init.name)) {
68
- exportNames.push(declarator.id.name);
69
- }
70
- }
71
- }
72
- for (const specifier of node.specifiers) {
73
- if (importNames.includes(specifier.local.name)) {
74
- exportNames.push(specifier.exported.name);
75
- }
76
- }
77
- }
78
- }
79
- if (!importNames.length)
80
- return "no";
81
- if (parentInfo.id.endsWith(".astro")) {
82
- exportNames.push("default");
83
- } else if (parentInfo.id.endsWith(".mdx")) {
84
- exportNames.push("Content");
85
- }
86
- return exportNames;
87
- }
88
12
  function vitePluginAnalyzer(options, internals) {
89
13
  function hoistedScriptScanner() {
90
14
  const uniqueHoistedIds = /* @__PURE__ */ new Map();
@@ -97,29 +21,9 @@ function vitePluginAnalyzer(options, internals) {
97
21
  hoistedScripts.add(hid);
98
22
  }
99
23
  if (hoistedScripts.size) {
100
- const depthsToChildren = /* @__PURE__ */ new Map();
101
- const depthsToExportNames = /* @__PURE__ */ new Map();
102
- depthsToExportNames.set(0, ["default"]);
103
- for (const [parentInfo, depth] of walkParentInfos(from, this, function until(importer) {
24
+ for (const [parentInfo] of walkParentInfos(from, this, function until(importer) {
104
25
  return isPropagatedAsset(importer);
105
26
  })) {
106
- if (options.settings.config.experimental.optimizeHoistedScript) {
107
- depthsToChildren.set(depth, parentInfo);
108
- if (depth > 0) {
109
- const childInfo = depthsToChildren.get(depth - 1);
110
- const childExportNames = depthsToExportNames.get(depth - 1);
111
- const doesImport = await doesParentImportChild.call(
112
- this,
113
- parentInfo,
114
- childInfo,
115
- childExportNames
116
- );
117
- if (doesImport === "no") {
118
- continue;
119
- }
120
- depthsToExportNames.set(depth, doesImport);
121
- }
122
- }
123
27
  if (isPropagatedAsset(parentInfo.id)) {
124
28
  for (const [nestedParentInfo] of walkParentInfos(from, this)) {
125
29
  if (moduleIsTopLevelPage(nestedParentInfo)) {
@@ -188,7 +92,9 @@ function vitePluginAnalyzer(options, internals) {
188
92
  return {
189
93
  name: "@astro/rollup-plugin-astro-analyzer",
190
94
  async generateBundle() {
191
- const hoistScanner = hoistedScriptScanner();
95
+ const hoistScanner = options.settings.config.experimental.directRenderScript ? { scan: async () => {
96
+ }, finalize: () => {
97
+ } } : hoistedScriptScanner();
192
98
  const ids = this.getModuleIds();
193
99
  for (const id of ids) {
194
100
  const info = this.getModuleInfo(id);
@@ -232,6 +138,12 @@ function vitePluginAnalyzer(options, internals) {
232
138
  trackClientOnlyPageDatas(internals, newPageData, clientOnlys);
233
139
  }
234
140
  }
141
+ if (options.settings.config.experimental.directRenderScript && astro.scripts.length) {
142
+ for (let i = 0; i < astro.scripts.length; i++) {
143
+ const hid = `${id.replace("/@fs", "")}?astro&type=script&index=${i}&lang.ts`;
144
+ internals.discoveredScripts.add(hid);
145
+ }
146
+ }
235
147
  }
236
148
  hoistScanner.finalize();
237
149
  }
@@ -125,6 +125,22 @@ function rollupPluginAstroBuildCSS(options) {
125
125
  }
126
126
  }
127
127
  };
128
+ const cssScopeToPlugin = {
129
+ name: "astro:rollup-plugin-css-scope-to",
130
+ renderChunk(_, chunk, __, meta) {
131
+ for (const id in chunk.modules) {
132
+ const modMeta = this.getModuleInfo(id)?.meta;
133
+ const cssScopeTo = modMeta?.astroCss?.cssScopeTo;
134
+ if (cssScopeTo && !isCssScopeToRendered(cssScopeTo, Object.values(meta.chunks))) {
135
+ delete chunk.modules[id];
136
+ const moduleIdsIndex = chunk.moduleIds.indexOf(id);
137
+ if (moduleIdsIndex > -1) {
138
+ chunk.moduleIds.splice(moduleIdsIndex, 1);
139
+ }
140
+ }
141
+ }
142
+ }
143
+ };
128
144
  const singleCssPlugin = {
129
145
  name: "astro:rollup-plugin-single-css",
130
146
  enforce: "post",
@@ -197,7 +213,7 @@ function rollupPluginAstroBuildCSS(options) {
197
213
  });
198
214
  }
199
215
  };
200
- return [cssBuildPlugin, singleCssPlugin, inlineStylesheetsPlugin];
216
+ return [cssBuildPlugin, cssScopeToPlugin, singleCssPlugin, inlineStylesheetsPlugin];
201
217
  }
202
218
  function* getParentClientOnlys(id, ctx, internals) {
203
219
  for (const [info] of walkParentInfos(id, ctx)) {
@@ -222,6 +238,16 @@ function appendCSSToPage(pageData, meta, pagesToCss, depth, order) {
222
238
  }
223
239
  }
224
240
  }
241
+ function isCssScopeToRendered(cssScopeTo, chunks) {
242
+ for (const moduleId in cssScopeTo) {
243
+ const exports = cssScopeTo[moduleId];
244
+ const renderedModule = chunks.find((c) => c.moduleIds.includes(moduleId))?.modules[moduleId];
245
+ if (renderedModule?.renderedExports.some((e) => exports.includes(e))) {
246
+ return true;
247
+ }
248
+ }
249
+ return false;
250
+ }
225
251
  export {
226
252
  pluginCSS
227
253
  };
@@ -1,11 +1,12 @@
1
1
  import { fileURLToPath } from "node:url";
2
2
  import glob from "fast-glob";
3
3
  import {} from "vite";
4
+ import { getAssetsPrefix } from "../../../assets/utils/getAssetsPrefix.js";
4
5
  import { normalizeTheLocale } from "../../../i18n/index.js";
5
6
  import { toRoutingStrategy } from "../../../i18n/utils.js";
6
7
  import { runHookBuildSsr } from "../../../integrations/index.js";
7
8
  import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from "../../../vite-plugin-scripts/index.js";
8
- import { joinPaths, prependForwardSlash } from "../../path.js";
9
+ import { fileExtension, joinPaths, prependForwardSlash } from "../../path.js";
9
10
  import { serializeRouteData } from "../../routing/index.js";
10
11
  import { addRollupInput } from "../add-rollup-input.js";
11
12
  import { getOutFile, getOutFolder } from "../common.js";
@@ -120,7 +121,8 @@ function buildManifest(opts, internals, staticFiles) {
120
121
  }
121
122
  const prefixAssetPath = (pth) => {
122
123
  if (settings.config.build.assetsPrefix) {
123
- return joinPaths(settings.config.build.assetsPrefix, pth);
124
+ const pf = getAssetsPrefix(fileExtension(pth), settings.config.build.assetsPrefix);
125
+ return joinPaths(pf, pth);
124
126
  } else {
125
127
  return prependForwardSlash(joinPaths(settings.config.base, pth));
126
128
  }
@@ -208,6 +210,7 @@ function buildManifest(opts, internals, staticFiles) {
208
210
  renderers: [],
209
211
  clientDirectives: Array.from(settings.clientDirectives),
210
212
  entryModules,
213
+ inlinedScripts: Array.from(internals.inlinedScripts),
211
214
  assets: staticFiles.map(prefixAssetPath),
212
215
  i18n: i18nManifest,
213
216
  buildFormat: settings.config.build.format
@@ -0,0 +1,8 @@
1
+ import type { Plugin as VitePlugin } from 'vite';
2
+ import type { BuildInternals } from '../internal.js';
3
+ import type { AstroBuildPlugin } from '../plugin.js';
4
+ /**
5
+ * Used by the `experimental.directRenderScript` option to inline scripts directly into the HTML.
6
+ */
7
+ export declare function vitePluginScripts(internals: BuildInternals): VitePlugin;
8
+ export declare function pluginScripts(internals: BuildInternals): AstroBuildPlugin;
@@ -0,0 +1,34 @@
1
+ import { shouldInlineAsset } from "./util.js";
2
+ function vitePluginScripts(internals) {
3
+ let assetInlineLimit;
4
+ return {
5
+ name: "@astro/plugin-scripts",
6
+ configResolved(config) {
7
+ assetInlineLimit = config.build.assetsInlineLimit;
8
+ },
9
+ async generateBundle(_options, bundle) {
10
+ for (const [id, output] of Object.entries(bundle)) {
11
+ if (output.type === "chunk" && output.facadeModuleId && internals.discoveredScripts.has(output.facadeModuleId) && output.imports.length === 0 && output.dynamicImports.length === 0 && shouldInlineAsset(output.code, output.fileName, assetInlineLimit)) {
12
+ internals.inlinedScripts.set(output.facadeModuleId, output.code.trim());
13
+ delete bundle[id];
14
+ }
15
+ }
16
+ }
17
+ };
18
+ }
19
+ function pluginScripts(internals) {
20
+ return {
21
+ targets: ["client"],
22
+ hooks: {
23
+ "build:before": () => {
24
+ return {
25
+ vitePlugin: vitePluginScripts(internals)
26
+ };
27
+ }
28
+ }
29
+ };
30
+ }
31
+ export {
32
+ pluginScripts,
33
+ vitePluginScripts
34
+ };
@@ -2,6 +2,7 @@ import type { TransformResult } from '@astrojs/compiler';
2
2
  import type { ResolvedConfig } from 'vite';
3
3
  import type { AstroConfig } from '../../@types/astro.js';
4
4
  import type { AstroPreferences } from '../../preferences/index.js';
5
+ import type { CompileCssResult } from './types.js';
5
6
  export interface CompileProps {
6
7
  astroConfig: AstroConfig;
7
8
  viteConfig: ResolvedConfig;
@@ -9,13 +10,6 @@ export interface CompileProps {
9
10
  filename: string;
10
11
  source: string;
11
12
  }
12
- export interface CompileCssResult {
13
- code: string;
14
- /**
15
- * The dependencies of the transformed CSS (Normalized paths)
16
- */
17
- dependencies?: string[];
18
- }
19
13
  export interface CompileResult extends Omit<TransformResult, 'css'> {
20
14
  css: CompileCssResult[];
21
15
  }
@@ -12,7 +12,7 @@ async function compile({
12
12
  filename,
13
13
  source
14
14
  }) {
15
- const cssDeps = [];
15
+ const cssPartialCompileResults = [];
16
16
  const cssTransformErrors = [];
17
17
  let transformResult;
18
18
  try {
@@ -29,10 +29,11 @@ async function compile({
29
29
  resultScopedSlot: true,
30
30
  transitionsAnimationURL: "astro/components/viewtransitions.css",
31
31
  annotateSourceFile: viteConfig.command === "serve" && astroConfig.devToolbar && astroConfig.devToolbar.enabled && await preferences.get("devToolbar.enabled"),
32
+ renderScript: astroConfig.experimental.directRenderScript,
32
33
  preprocessStyle: createStylePreprocessor({
33
34
  filename,
34
35
  viteConfig,
35
- cssDeps,
36
+ cssPartialCompileResults,
36
37
  cssTransformErrors
37
38
  }),
38
39
  async resolvePath(specifier) {
@@ -53,8 +54,8 @@ async function compile({
53
54
  return {
54
55
  ...transformResult,
55
56
  css: transformResult.css.map((code, i) => ({
56
- code,
57
- dependencies: cssDeps[i]
57
+ ...cssPartialCompileResults[i],
58
+ code
58
59
  }))
59
60
  };
60
61
  }
@@ -1,9 +1,10 @@
1
1
  import type { TransformOptions } from '@astrojs/compiler';
2
2
  import { type ResolvedConfig } from 'vite';
3
- import type { CompileCssResult } from './compile.js';
4
- export declare function createStylePreprocessor({ filename, viteConfig, cssDeps, cssTransformErrors, }: {
3
+ import type { CompileCssResult } from './types.js';
4
+ export type PartialCompileCssResult = Pick<CompileCssResult, 'isGlobal' | 'dependencies'>;
5
+ export declare function createStylePreprocessor({ filename, viteConfig, cssPartialCompileResults, cssTransformErrors, }: {
5
6
  filename: string;
6
7
  viteConfig: ResolvedConfig;
7
- cssDeps: CompileCssResult['dependencies'][];
8
+ cssPartialCompileResults: Partial<CompileCssResult>[];
8
9
  cssTransformErrors: Error[];
9
10
  }): TransformOptions['preprocessStyle'];
@@ -4,7 +4,7 @@ import { AstroErrorData, CSSError, positionAt } from "../errors/index.js";
4
4
  function createStylePreprocessor({
5
5
  filename,
6
6
  viteConfig,
7
- cssDeps,
7
+ cssPartialCompileResults,
8
8
  cssTransformErrors
9
9
  }) {
10
10
  let processedStylesCount = 0;
@@ -14,9 +14,10 @@ function createStylePreprocessor({
14
14
  const id = `${filename}?astro&type=style&index=${index}&lang${lang}`;
15
15
  try {
16
16
  const result = await preprocessCSS(content, id, viteConfig);
17
- if (result.deps) {
18
- cssDeps[index] = [...result.deps].map((dep) => normalizePath(dep));
19
- }
17
+ cssPartialCompileResults[index] = {
18
+ isGlobal: !!attrs["is:global"],
19
+ dependencies: result.deps ? [...result.deps].map((dep) => normalizePath(dep)) : []
20
+ };
20
21
  let map;
21
22
  if (result.map) {
22
23
  if (typeof result.map === "string") {
@@ -5,3 +5,14 @@ export type TransformStyleResult = null | {
5
5
  deps: Set<string>;
6
6
  };
7
7
  export type TransformStyle = (source: string, lang: string) => TransformStyleResult | Promise<TransformStyleResult>;
8
+ export interface CompileCssResult {
9
+ code: string;
10
+ /**
11
+ * Whether this is `<style is:global>`
12
+ */
13
+ isGlobal: boolean;
14
+ /**
15
+ * The dependencies of the transformed CSS (Normalized/forward-slash-only absolute paths)
16
+ */
17
+ dependencies: string[];
18
+ }