Skip to content

Commit

Permalink
Merge branch 'main' into feature/add_showcase_echo-echo
Browse files Browse the repository at this point in the history
  • Loading branch information
Octo8080X committed Mar 25, 2024
2 parents 7488f2e + 93fb4bd commit ef2f90a
Show file tree
Hide file tree
Showing 972 changed files with 32,320 additions and 5,034 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Use Unix line endings in all text files.
* text=auto eol=lf
80 changes: 24 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: ci
on:
push:
branches: [main]
paths-ignore: [www/**]
pull_request:
branches: [main]
paths-ignore: [www/**]

jobs:
test:
Expand All @@ -16,80 +14,50 @@ jobs:
strategy:
fail-fast: false
matrix:
deno: ["v1.x", "canary"]
deno: ["canary", "v1.x"]
os: [macOS-latest, windows-latest, ubuntu-latest]
include:
- os: ubuntu-latest
cache_path: ~/.cache/deno/
- os: macos-latest
cache_path: ~/Library/Caches/deno/
- os: windows-latest
cache_path: ~\AppData\Local\deno\

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Verify formatting
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v1.x'
run: deno fmt --check

- name: Run linter
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
run: deno lint

- name: Cache dependencies
- name: Spell-check
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v1.x'
run: deno cache --no-check --import-map=./www/import_map.json src/dev/deps.ts src/server/deps.ts www/main.ts

- name: Cache Chrome (Linux)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/cache@v3
with:
path: ~/.cache/deno/deno_puppeteer
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-

- name: Cache Chrome (macOS)
if: startsWith(matrix.os, 'mac')
uses: actions/cache@v3
with:
path: ~/Library/Caches/deno/deno_puppeteer
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-
uses: crate-ci/typos@master

- name: Cache Chrome (Windows)
if: startsWith(matrix.os, 'win')
uses: actions/cache@v3
- name: Cache dependencies and Chrome
uses: actions/cache@v4
with:
path: "C:\\Users\\RUNNER~1\\AppData\\Local\\deno\\deno_puppeteer"
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-
path: |
${{ matrix.cache_path }}deps
${{ matrix.cache_path }}deno_puppeteer
key: ${{ runner.os }}-${{ hashFiles('**/*deps.ts', 'tests/fixture_twind_hydrate/twind.config.ts') }}

- name: Install Chromium (Unix)
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'mac')
run: PUPPETEER_PRODUCT=chrome deno run -A --unstable https://deno.land/x/[email protected]/install.ts
- name: Install Chromium
run: deno run -A --unstable https://deno.land/x/[email protected]/install.ts
env:
PUPPETEER_PRODUCT: chrome

- name: Install Chromium (Windows)
if: startsWith(matrix.os, 'windows')
run: set "PUPPETEER_PRODUCT=chrome" && deno run -A --unstable https://deno.land/x/[email protected]/install.ts
- name: Type check project
run: deno task check:types

- name: Run tests
run: deno test -A

- name: Type check init script
run: deno check --remote init.ts

- name: Type check website
run: deno check main.ts dev.ts
working-directory: www/

- name: Type check examples/counter
run: deno check --remote main.ts dev.ts
working-directory: examples/counter

- name: Type check tests/fixture
run: deno check main.ts dev.ts
working-directory: tests/fixture/

- name: Type check tests/fixture_error
run: deno check main.ts dev.ts
working-directory: tests/fixture_error/
run: deno task test
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: main

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Build step
working-directory: ./www
run: "deno task build" # 📝 Update the build command(s) if necessary

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "fresh" # 📝 Update the deploy project name if necessary
entrypoint: "./www/main.ts" # 📝 Update the entrypoint if necessary
root: "."
18 changes: 9 additions & 9 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
URL: ${{ github.event.deployment_status.environment_url }}

steps:
- uses: actions/checkout@v3
- name: Setup repo
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3

- name: Install Lighthouse CI
run: npm install -g @lhci/[email protected]

- name: Run Lighthouse
run: lhci autorun --collect.url="$URL" --collect.url="$URL/docs/introduction" --upload.target="temporary-public-storage"
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v10
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
with:
temporaryPublicStorage: true
urls: |
$URL
$URL/docs/introduction
32 changes: 32 additions & 0 deletions .github/workflows/post_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: post_publish

on:
release:
types: [published]

jobs:
update-dl-version:
name: update dl.deno.land version
runs-on: ubuntu-22.04
if: github.repository == 'denoland/fresh'
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: denoland
credentials_json: ${{ secrets.GCP_SA_KEY }}
export_environment_variables: true
create_credentials_file: true

- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: denoland

- name: Upload version file to dl.deno.land
run: |
cat versions.json | jq -r ".[0]" > release-latest.txt
gsutil -h "Cache-Control: no-cache" cp release-latest.txt gs://dl.deno.land/fresh/release-latest.txt
37 changes: 0 additions & 37 deletions .github/workflows/www.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_fresh/
tmp/
vendor/
node_modules/
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"recommendations": [
"denoland.vscode-deno",
"sastan.twind-intellisense"
"denoland.vscode-deno"
]
}
20 changes: 14 additions & 6 deletions .vscode/import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
"$fresh/": "../",
"twind": "https://esm.sh/[email protected]",
"twind/": "https://esm.sh/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/*[email protected]",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/@preact/[email protected]",
"$std/": "https://deno.land/[email protected]/"
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/@preact/[email protected]",
"@preact/[email protected]": "https://esm.sh/@preact/[email protected]",
"@preact/[email protected]": "https://esm.sh/@preact/[email protected]",
"$std/": "https://deno.land/[email protected]/",
"$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts",
"$marked-mangle": "https://esm.sh/[email protected]",
"$fresh-testing-library": "https://deno.land/x/[email protected]/mod.ts",
"$fresh-testing-library/": "https://deno.land/x/[email protected]/",
"tailwindcss": "npm:[email protected]",
"tailwindcss/": "npm:/[email protected]/",
"tailwindcss/plugin": "npm:/[email protected]/plugin.js"
}
}
20 changes: 19 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,23 @@
"deno.lint": true,
"deno.importMap": "./.vscode/import_map.json",
"deno.codeLens.test": true,
"editor.defaultFormatter": "denoland.vscode-deno"
"deno.documentPreloadLimit": 2000,
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"[typescriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[javascriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[javascript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[markdown]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"css.customData": [".vscode/tailwind.json"]
}
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
}
]
},
{
"name": "@apply",
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
}
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
}
]
}
]
}
Loading

0 comments on commit ef2f90a

Please sign in to comment.