diff --git a/build-scripts/main.mjs b/build-scripts/main.mjs deleted file mode 100644 index cfc2751..0000000 --- a/build-scripts/main.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import fs from "fs"; - -import { sampleFiles, baseUrl } from "./sampleFiles.mjs"; - -async function fetchSamples(baseUrl, files) { - return await Promise.all( - files.map(async sample => { - const response = await fetch(baseUrl + sample.file); - const code = await response.text(); - - return { - name: sample.name, - code, - }; - }) - ); -} - -const samples = await fetchSamples(baseUrl, sampleFiles); -const objString = JSON.stringify(samples); -const fileString = ` -// This file is generated by build-scripts/main.mjs -/* eslint-disable */ -export default ${objString}; -`; - -// The file is placed in the src directory to include it in the bundle -fs.mkdirSync("./src/data", { recursive: true }); -fs.writeFileSync("./src/data/Samples.js", fileString); diff --git a/build-scripts/sampleFiles.mjs b/build-scripts/sampleFiles.mjs deleted file mode 100644 index 44d0170..0000000 --- a/build-scripts/sampleFiles.mjs +++ /dev/null @@ -1,104 +0,0 @@ -const version = "0.38.0"; -export const baseUrl = `https://raw.githubusercontent.com/flix/flix/v${version}/examples/`; -export const sampleFiles = [ - { - name: "Algebraic Data Types and Pattern Matching", - file: "algebraic-data-types-and-pattern-matching.flix", - }, - { - name: "Lists and List Processing", - file: "lists-and-list-processing.flix", - }, - { - name: "Higher-Order Functions", - file: "higher-order-functions.flix", - }, - { - name: "Enums and Parametric Polymorphism", - file: "enums-and-parametric-polymorphism.flix", - }, - { - name: "Record Construction and Use", - file: "record-construction-and-use.flix", - }, - { - name: "Polymorphic Record Update", - file: "polymorphic-record-update.flix", - }, - { - name: "Polymorphic Record Extension and Restriction", - file: "polymorphic-record-extension-and-restriction.flix", - }, - { - name: "Function Composition, Pipelines, and Currying", - file: "function-composition-pipelines-and-currying.flix", - }, - { - name: "Pure and Impure Functions", - file: "pure-and-impure-functions.flix", - }, - { - name: "Effect Polymorphic Functions", - file: "effect-polymorphic-functions.flix", - }, - { - name: "Type Aliases", - file: "type-aliases.flix", - }, - { - name: "Mutual Recursion with Full Tail-Call Elimination", - file: "mutual-recursion-with-full-tail-call-elimination.flix", - }, - { - name: "Sending and Receiving on Channels", - file: "sending-and-receiving-on-channels.flix", - }, - { - name: "Using Channels and Select", - file: "using-channels-and-select.flix", - }, - { - name: "Select with Defaults and Timers", - file: "select-with-defaults-and-timers.flix", - }, - { - name: "First-Class Constraints and Fixpoints", - file: "first-class-constraints-and-fixpoints.flix", - }, - { - name: "Polymorphic First-Class Constraints", - file: "polymorphic-first-class-constraints.flix", - }, - { - name: "Pipelines of Fixpoint Computations", - file: "pipelines-of-fixpoint-computations.flix", - }, - { - name: "Using Datalog to Solve a Compiler Puzzle", - file: "compiler-puzzle.flix", - }, - { - name: "An Interpreter for a Trivial Expression Language", - file: "an-interpreter-for-a-trivial-expression-language.flix", - }, - { - name: "A Simple Card Game Simulation", - file: "simple-card-game.flix", - }, - { - name: "Deriving Type Classes", - file: "deriving-type-classes.flix", - }, - { - name: "Internal Mutability with Regions", - file: "internal-mutability-with-regions.flix", - }, - { - name: "File Information", - file: "file-information.flix", - }, - { - name: "Working with Files and Directories", - file: "working-with-files-and-directories.flix", - } -]; \ No newline at end of file diff --git a/package.json b/package.json index 786d9a9..5cd9cb0 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,8 @@ "reactstrap": "^9.2.3" }, "scripts": { - "build-script": "node build-scripts/main.mjs", - "dev": "npm run build-script && vite", - "build": "npm run build-script && vite build", + "dev": "vite", + "build": "vite build", "preview": "vite preview" }, "devDependencies": { diff --git a/vite.config.js b/vite.config.js index ca51680..94b5ac5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,7 +9,6 @@ export default defineConfig({ outDir: 'dist', }, server: { - port: 3000, open: true, }, });