Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/post_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:

- name: Upload version file to dl.deno.land
run: |
cat versions.json | jq -r ".[0]" > release-latest.txt
cat packages/fresh/deno.json | jq -r ".version" > release-latest.txt
gsutil -h "Cache-Control: no-cache" cp release-latest.txt gs://dl.deno.land/fresh/release-latest.txt
30 changes: 1 addition & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,5 @@ jobs:
with:
cache: true

- name: Publish Fresh
run: deno publish

- name: Publish @fresh/build-id
working-directory: ./build-id
run: deno publish

- name: Publish @fresh/init
working-directory: ./init
run: deno publish

- name: Publish @fresh/plugin-tailwindcss
working-directory: ./plugin-tailwindcss
run: deno publish

- name: Publish @fresh/plugin-tailwindcss-v3
working-directory: ./plugin-tailwindcss-v3
run: deno publish

- name: Publish @fresh/update
working-directory: ./update
run: deno publish

- name: Publish @fresh/plugin-vite
working-directory: ./plugin-vite
run: deno publish

- name: Publish @fresh/examples
working-directory: ./examples
- name: Publish
run: deno publish
4 changes: 2 additions & 2 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[files]
extend-exclude = [
"tests/fixture_partials/routes/scroll_restoration/index.tsx",
"packages/fresh/tests/fixture_partials/routes/scroll_restoration/index.tsx",
"www/static/fonts/FixelVariable.woff2",
"www/static/fonts/FixelVariableItalic.woff2",
"tests/lorem_ipsum.txt",
"packages/fresh/tests/lorem_ipsum.txt",
]

[default]
Expand Down
21 changes: 1 addition & 20 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
{
"nodeModulesDir": "auto",
"workspace": [
"./build-id",
"./examples",
"./init",
"./plugin-tailwindcss",
"./plugin-tailwindcss-v3",
"./plugin-vite",
"./update",
"./packages/*",
"./www"
],
"name": "@fresh/core",
"version": "2.0.0-alpha.56",
"license": "MIT",
"exports": {
".": "./src/mod.ts",
"./runtime": "./src/runtime/shared.ts",
"./runtime-client": "./src/runtime/client/mod.tsx",
"./dev": "./src/dev/mod.ts",
"./compat": "./src/compat.ts",
"./internal": "./src/internals.ts",
"./internal-dev": "./src/internals_dev.ts"
},
"tasks": {
"test": "deno test -A --parallel",
"fixture": "deno run -A --watch=static/,routes/ tests/fixture/dev.ts",
"www": "deno task --cwd=www start",
"build-www": "deno task --cwd=www build",
"screenshot": "deno run -A www/utils/screenshot.ts",
Expand Down
19 changes: 16 additions & 3 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions packages/fresh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Fresh

Fresh is a small, fast and extensible full stack web framework built on Web
Standards. It’s designed for building high-quality, performant, and personalized
web applications.

[Learn more about Fresh](https://fresh.deno.dev/)
17 changes: 17 additions & 0 deletions packages/fresh/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@fresh/core",
"version": "2.0.0-alpha.56",
"license": "MIT",
"exports": {
".": "./src/mod.ts",
"./runtime": "./src/runtime/shared.ts",
"./runtime-client": "./src/runtime/client/mod.tsx",
"./dev": "./src/dev/mod.ts",
"./compat": "./src/compat.ts",
"./internal": "./src/internals.ts",
"./internal-dev": "./src/internals_dev.ts"
},
"imports": {
"@std/fmt": "jsr:@std/fmt@^1.0.8"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import twDenoJson from "../plugin-tailwindcss/deno.json" with { type: "json" };
import twDenoJson from "../../plugin-tailwindcss/deno.json" with {
type: "json",
};
import * as Marked from "marked";
import { ensureDir, walk } from "@std/fs";
import { dirname, join, relative } from "@std/path";
// import { expect } from "@std/expect/expect";
import { withTmpDir } from "../src/test_utils.ts";
import { FRESH_VERSION, PREACT_VERSION } from "../update/src/update.ts";
import { FRESH_VERSION, PREACT_VERSION } from "../../update/src/update.ts";

Deno.test("Docs Code example checks", async () => {
await using tmp = await withTmpDir();
Expand Down Expand Up @@ -63,7 +65,14 @@ Deno.test("Docs Code example checks", async () => {

async function* docsMarkdownFiles() {
// Limit to checking Fresh v2 (canary) docs for now
const docsDir = join(import.meta.dirname!, "..", "docs", "canary");
const docsDir = join(
import.meta.dirname!,
"..",
"..",
"..",
"docs",
"canary",
);
const docsIter = walk(docsDir, { exts: [".md"], includeDirs: false });

for await (const entry of docsIter) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 7 additions & 9 deletions init/src/init_test.ts → packages/init/src/init_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
initProject,
} from "./init.ts";
import * as path from "@std/path";
import { getStdOutput, withBrowser } from "../../tests/test_utils.tsx";
import { waitForText } from "../../tests/test_utils.tsx";
import { withChildProcessServer } from "../../tests/test_utils.tsx";
import { withTmpDir as withTmpDirBase } from "../../src/test_utils.ts";
import { getStdOutput, withBrowser } from "../../fresh/tests/test_utils.tsx";
import { waitForText } from "../../fresh/tests/test_utils.tsx";
import { withChildProcessServer } from "../../fresh/tests/test_utils.tsx";
import { withTmpDir as withTmpDirBase } from "../../fresh/src/test_utils.ts";
import { stub } from "@std/testing/mock";

function stubPrompt(result: string) {
Expand All @@ -24,10 +24,8 @@ function stubConfirm(steps: Record<string, boolean> = {}) {
}

function withTmpDir(): Promise<{ dir: string } & AsyncDisposable> {
return withTmpDirBase({
dir: path.join(import.meta.dirname!, "..", ".."),
prefix: "tmp_",
});
const dir = path.join(import.meta.dirname!, "..", "..", "..", "..");
return withTmpDirBase({ dir, prefix: "tmp_" });
}

async function patchProject(dir: string): Promise<void> {
Expand All @@ -37,7 +35,7 @@ async function patchProject(dir: string): Promise<void> {
json.workspace = [];
// See https://github.com/denoland/deno/issues/27313
// json.links = [path.fromFileURL(new URL("../..", import.meta.url))];
json.links = [new URL("../..", import.meta.url).href];
json.links = [new URL("../../fresh", import.meta.url).href];

// assert with this stricter rule, before adding it to initialized projects
json.lint.rules.include = ["verbatim-module-syntax"];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
waitForText,
withBrowser,
withChildProcessServer,
} from "../../tests/test_utils.tsx";
} from "../../fresh/tests/test_utils.tsx";
import { buildVite } from "./test_utils.ts";

Deno.test({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from "@std/path";
import { expect } from "@std/expect";
import { waitForText, withBrowser } from "../../tests/test_utils.tsx";
import { waitForText, withBrowser } from "../../fresh/tests/test_utils.tsx";
import { updateFile, withDevServer } from "./test_utils.ts";

Deno.test({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createBuilder } from "vite";
import * as path from "@std/path";
import { walk } from "@std/fs/walk";
import { withTmpDir } from "../../src/test_utils.ts";
import { withChildProcessServer } from "../../tests/test_utils.tsx";
import { withTmpDir } from "../../fresh/src/test_utils.ts";
import { withChildProcessServer } from "../../fresh/tests/test_utils.tsx";

export const DEMO_DIR = path.join(import.meta.dirname!, "..", "demo");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { expect } from "@std/expect";
import { spy, type SpyCall } from "@std/testing/mock";
import { walk } from "@std/fs/walk";
import { withTmpDir, writeFiles } from "../../src/test_utils.ts";
import { withTmpDir, writeFiles } from "../../fresh/src/test_utils.ts";

async function readFiles(dir: string): Promise<Record<string, string>> {
const files: Record<string, string> = {};
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/check_docs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkDocs } from "https://github.com/denoland/std/raw/refs/heads/main/_tools/check_docs.ts";

await checkDocs([
import.meta.resolve("../src/error.ts"),
import.meta.resolve("../packages/fresh/src/error.ts"),
]);
26 changes: 19 additions & 7 deletions tools/release.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cl from "@std/fmt/colors";
import * as path from "@std/path";
import type { DenoJson } from "../update/src/update.ts";
import type { DenoJson } from "../packages/update/src/update.ts";
import * as semver from "@std/semver";

function showHelp() {
Expand All @@ -24,7 +24,7 @@ if (Deno.args.length === 0) {
}

const ROOT_DIR = path.join(import.meta.dirname!, "..");
const denoJsonPath = path.join(ROOT_DIR, "deno.json");
const denoJsonPath = path.join(ROOT_DIR, "packages", "fresh", "deno.json");
const wwwDenoJsonPath = path.join(ROOT_DIR, "www", "deno.json");
const denoJson = JSON.parse(await Deno.readTextFile(denoJsonPath)) as DenoJson;

Expand Down Expand Up @@ -54,11 +54,11 @@ if (version === "major") {
}
}

const initJsonPath = path.join(ROOT_DIR, "init", "deno.json");
const initJsonPath = path.join(ROOT_DIR, "packages", "init", "deno.json");
const initJson = JSON.parse(await Deno.readTextFile(initJsonPath));
const currentInit = semver.parse(initJson.version);

const updateJsonPath = path.join(ROOT_DIR, "update", "deno.json");
const updateJsonPath = path.join(ROOT_DIR, "packages", "update", "deno.json");
const updateJson = JSON.parse(await Deno.readTextFile(updateJsonPath));
const currentUpdate = semver.parse(updateJson.version);

Expand Down Expand Up @@ -87,7 +87,7 @@ if (!confirm("Proceed with update?")) {

const denoTailwindJson = JSON.parse(
await Deno.readTextFile(
path.join(ROOT_DIR, "plugin-tailwindcss", "deno.json"),
path.join(ROOT_DIR, "packages", "plugin-tailwindcss", "deno.json"),
),
) as DenoJson;

Expand Down Expand Up @@ -183,8 +183,20 @@ await replaceInFile(
replaceDepVersion("npm", "@preact/signals", preactSignalsVersion),
);

const updateScriptPath = path.join(ROOT_DIR, "update", "src", "update.ts");
const updateScriptPath = path.join(
ROOT_DIR,
"packages",
"update",
"src",
"update.ts",
);
await replaceInFile(updateScriptPath, updateVersions);

const initScriptPath = path.join(ROOT_DIR, "init", "src", "init.ts");
const initScriptPath = path.join(
ROOT_DIR,
"packages",
"init",
"src",
"init.ts",
);
await replaceInFile(initScriptPath, updateVersions);
5 changes: 4 additions & 1 deletion www/main_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import VERSIONS from "../versions.json" with { type: "json" };
import { app } from "./main.ts";
import { buildProd, withBrowserApp } from "../tests/test_utils.tsx";
import {
buildProd,
withBrowserApp,
} from "../packages/fresh/tests/test_utils.tsx";
import { expect } from "@std/expect";
import { retry } from "@std/async/retry";

Expand Down
2 changes: 1 addition & 1 deletion www/utils/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import denoJson from "../../deno.json" with { type: "json" };
import denoJson from "../../packages/fresh/deno.json" with { type: "json" };

export { extractYaml as frontMatter } from "@std/front-matter";

Expand Down
Loading