summaryrefslogtreecommitdiff
path: root/packages/create-astro/src/frameworks.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2022-04-27 20:58:18 -0400
committerGravatar GitHub <noreply@github.com> 2022-04-27 20:58:18 -0400
commitb7cd69588453cf874346bf2f14c41accd183129e (patch)
tree4d1feaf3bbc6f6eca552920415528a6a32117a21 /packages/create-astro/src/frameworks.ts
parent79378523957462705ca4a32f69c14aacb1a8244b (diff)
downloadastro-b7cd69588453cf874346bf2f14c41accd183129e.tar.gz
astro-b7cd69588453cf874346bf2f14c41accd183129e.tar.zst
astro-b7cd69588453cf874346bf2f14c41accd183129e.zip
Feat: [create astro] replace component selector with "astro add" (#3223)
* feat: remove component framework selector * feat: update templates to use "basics" * feat: add "astro add" cli step * tests: astro add step * fix: reset env for pnpm tests * fix: update install step test * chore: remove "frameworks" step from tests * deps: remove node-fetch from create-astro * chore: changeset * fix: use "preferLocal" for astro add command * refactor: remove POSTPROCESS_FILES * feat: add --yes flag to simplify astro add * feat: bring back minimal option as "completely empty"
Diffstat (limited to 'packages/create-astro/src/frameworks.ts')
-rw-r--r--packages/create-astro/src/frameworks.ts136
1 files changed, 0 insertions, 136 deletions
diff --git a/packages/create-astro/src/frameworks.ts b/packages/create-astro/src/frameworks.ts
deleted file mode 100644
index 0483b7474..000000000
--- a/packages/create-astro/src/frameworks.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-export const COUNTER_COMPONENTS = {
- preact: {
- filename: `src/components/PreactCounter.jsx`,
- content: `import { useState } from 'preact/hooks';
-
-export default function PreactCounter() {
- const [count, setCount] = useState(0);
- const add = () => setCount((i) => i + 1);
- const subtract = () => setCount((i) => i - 1);
-
- return (
- <div id="preact" class="counter">
- <button onClick={subtract}>-</button>
- <pre>{count}</pre>
- <button onClick={add}>+</button>
- </div>
- );
-}
-`,
- },
- react: {
- filename: `src/components/ReactCounter.jsx`,
- content: `import { useState } from 'react';
-
-export default function ReactCounter() {
- const [count, setCount] = useState(0);
- const add = () => setCount((i) => i + 1);
- const subtract = () => setCount((i) => i - 1);
-
- return (
- <div id="react" className="counter">
- <button onClick={subtract}>-</button>
- <pre>{count}</pre>
- <button onClick={add}>+</button>
- </div>
- );
-}
-`,
- },
- solid: {
- filename: `src/components/SolidCounter.jsx`,
- content: `import { createSignal } from "solid-js";
-
-export default function SolidCounter() {
- const [count, setCount] = createSignal(0);
- const add = () => setCount(count() + 1);
- const subtract = () => setCount(count() - 1);
-
- return (
- <div id="solid" class="counter">
- <button onClick={subtract}>-</button>
- <pre>{count()}</pre>
- <button onClick={add}>+</button>
- </div>
- );
-}
-`,
- },
- svelte: {
- filename: `src/components/SvelteCounter.svelte`,
- content: `<script>
- let count = 0;
-
- function add() {
- count += 1;
- }
-
- function subtract() {
- count -= 1;
- }
-</script>
-
-<div id="svelte" class="counter">
- <button on:click={subtract}>-</button>
- <pre>{ count }</pre>
- <button on:click={add}>+</button>
-</div>
-`,
- },
- vue: {
- filename: `src/components/VueCounter.vue`,
- content: `<template>
- <div id="vue" class="counter">
- <button @click="subtract()">-</button>
- <pre>{{ count }}</pre>
- <button @click="add()">+</button>
- </div>
-</template>
-
-<script>
-import { ref } from 'vue';
-export default {
- setup() {
- const count = ref(0)
- const add = () => count.value = count.value + 1;
- const subtract = () => count.value = count.value - 1;
-
- return {
- count,
- add,
- subtract
- }
- }
-}
-</script>
-`,
- },
-};
-
-export interface Integration {
- id: string;
- packageName: string;
-}
-
-export const FRAMEWORKS: { title: string; value: Integration }[] = [
- {
- title: 'Preact',
- value: { id: 'preact', packageName: '@astrojs/preact' },
- },
- {
- title: 'React',
- value: { id: 'react', packageName: '@astrojs/react' },
- },
- {
- title: 'Solid.js',
- value: { id: 'solid', packageName: '@astrojs/solid-js' },
- },
- {
- title: 'Svelte',
- value: { id: 'svelte', packageName: '@astrojs/svelte' },
- },
- {
- title: 'Vue',
- value: { id: 'vue', packageName: '@astrojs/vue' },
- },
-];