Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Oct 23, 2023
1 parent c9935cd commit 69fcb81
Show file tree
Hide file tree
Showing 22 changed files with 91 additions and 235 deletions.
1 change: 0 additions & 1 deletion examples/dev-overlay/.codesandbox/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions examples/dev-overlay/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/dev-overlay/.vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions examples/dev-overlay/.vscode/launch.json

This file was deleted.

47 changes: 0 additions & 47 deletions examples/dev-overlay/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions examples/dev-overlay/astro-devtools-plugin.js

This file was deleted.

11 changes: 0 additions & 11 deletions examples/dev-overlay/astro.config.mjs

This file was deleted.

3 changes: 0 additions & 3 deletions examples/dev-overlay/components/Component.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions examples/dev-overlay/package.json

This file was deleted.

Binary file removed examples/dev-overlay/public/astro-logo.png
Binary file not shown.
9 changes: 0 additions & 9 deletions examples/dev-overlay/public/favicon.svg

This file was deleted.

27 changes: 0 additions & 27 deletions examples/dev-overlay/src/pages/index.astro

This file was deleted.

7 changes: 0 additions & 7 deletions examples/dev-overlay/tsconfig.json

This file was deleted.

6 changes: 2 additions & 4 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,6 @@ export interface AstroUserConfig {
remotePatterns?: Partial<RemotePattern>[];
};

devOverlay?: {
plugins: string[];
};

/**
* @docs
* @kind heading
Expand Down Expand Up @@ -1526,6 +1522,7 @@ export interface AstroSettings {
* Map of directive name (e.g. `load`) to the directive script code
*/
clientDirectives: Map<string, string>;
devOverlayPlugins: string[];
tsConfig: TSConfig | undefined;
tsConfigPath: string | undefined;
watchFiles: string[];
Expand Down Expand Up @@ -2051,6 +2048,7 @@ export interface AstroIntegration {
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectRoute: (injectRoute: InjectedRoute) => void;
addClientDirective: (directive: ClientDirectiveConfig) => void;
addDevOverlayPlugin: (entrypoint: string) => void;
logger: AstroIntegrationLogger;
// TODO: Add support for `injectElement()` for full HTML element injection, not just scripts.
// This may require some refactoring of `scripts`, `styles`, and `links` into something
Expand Down
6 changes: 0 additions & 6 deletions packages/astro/src/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ const ASTRO_CONFIG_DEFAULTS = {
image: {
service: { entrypoint: 'astro/assets/services/sharp', config: {} },
},
devOverlay: {
plugins: [],
},
compressHTML: true,
server: {
host: false,
Expand Down Expand Up @@ -231,9 +228,6 @@ export const AstroConfigSchema = z.object({
.default([]),
})
.default(ASTRO_CONFIG_DEFAULTS.image),
devOverlay: z
.object({ plugins: z.array(z.string()).default([]) })
.default(ASTRO_CONFIG_DEFAULTS.devOverlay),
markdown: z
.object({
drafts: z.boolean().default(false),
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/core/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function createBaseSettings(config: AstroConfig): AstroSettings {
scripts: [],
clientDirectives: getDefaultClientDirectives(),
watchFiles: [],
devOverlayPlugins: [],
timer: new AstroTimer(),
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.j
import { vitePluginAstroServer } from '../vite-plugin-astro-server/index.js';
import astroVitePlugin from '../vite-plugin-astro/index.js';
import configAliasVitePlugin from '../vite-plugin-config-alias/index.js';
import astroDevTools from '../vite-plugin-dev-tools/vite-plugin-dev-tools.js';
import astroDevOverlay from '../vite-plugin-dev-tools/vite-plugin-dev-overlay.js';
import envVitePlugin from '../vite-plugin-env/index.js';
import astroHeadPlugin from '../vite-plugin-head/index.js';
import htmlVitePlugin from '../vite-plugin-html/index.js';
Expand Down Expand Up @@ -133,7 +133,7 @@ export async function createVite(
vitePluginSSRManifest(),
astroAssetsPlugin({ settings, logger, mode }),
astroTransitions(),
astroDevTools({ settings, logger }),
astroDevOverlay({ settings, logger }),
],
publicDir: fileURLToPath(settings.config.publicDir),
root: fileURLToPath(settings.config.root),
Expand Down
3 changes: 3 additions & 0 deletions packages/astro/src/integrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export async function runHookConfigSetup({
addWatchFile: (path) => {
updatedSettings.watchFiles.push(path instanceof URL ? fileURLToPath(path) : path);
},
addDevOverlayPlugin: (entrypoint) => {
updatedSettings.devOverlayPlugins.push(entrypoint);
},
addClientDirective: ({ name, entrypoint }) => {
if (updatedSettings.clientDirectives.has(name) || addedClientDirectives.has(name)) {
throw new Error(
Expand Down
Loading

0 comments on commit 69fcb81

Please sign in to comment.