Skip to content

Commit

Permalink
Merge branch 'main' into preact-compat-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Aug 9, 2022
2 parents d453f97 + 4d29163 commit 06192ec
Show file tree
Hide file tree
Showing 463 changed files with 4,983 additions and 4,463 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions .changeset/curvy-donuts-build.md

This file was deleted.

26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/docker-existing-dockerfile
{
"name": "Contribute to Astro CodeSpaces",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../.Dockerfile",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
"postCreateCommand": "pnpm install"

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/---01-bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: "\U0001F41B Bug Report"
description: Report an issue or possible bug
title: "\U0001F41B BUG:"
labels: []
assignees: []
body:
Expand Down
50 changes: 28 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
FORCE_COLOR: true
ASTRO_TELEMETRY_DISABLED: true


jobs:
lint:
name: Lint
Expand Down Expand Up @@ -79,8 +80,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14]
OS: [ubuntu-latest]
NODE_VERSION: [14]
fail-fast: true
steps:
- name: Checkout
Expand All @@ -89,10 +90,10 @@ jobs:
- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -102,30 +103,31 @@ jobs:
run: pnpm run build

test:
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14, 16]
OS: [ubuntu-latest, windows-latest]
# TODO: Enable node@18!
NODE_VERSION: [14, 16]
include:
- os: windows-latest
node_version: 14
- os: macos-latest
node_version: 14
NODE_VERSION: 14
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Use Deno
Expand All @@ -143,26 +145,28 @@ jobs:
run: pnpm run test

e2e:
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
timeout-minutes: 20
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [14]
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [14]
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -175,24 +179,26 @@ jobs:
run: pnpm run test:e2e

smoke:
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14]
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [14]
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Checkout docs
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
image:
file: .gitpod.Dockerfile
file: .Dockerfile
# Commands to start on workspace startup
tasks:
- init: |
Expand Down
10 changes: 7 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# To be removed with ".astro" parsing is ready
# Also, be sure to remove "pluginSearchDirs" from config
**/*.astro
# Ignoring these files for now due to https://github.com/withastro/compiler/issues/318
examples/basics/src/layouts
examples/blog/src/layouts
examples/with-nanostores/src/layouts

# Ignoring this file for now due to https://github.com/withastro/compiler/issues/485
packages/markdown/component/Markdown.astro

# Deep Directories
**/dist
Expand Down
10 changes: 8 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": true,
"plugins": ["./node_modules/prettier-plugin-astro"],
"overrides": [
{
"files": [".*", "*.json", "*.md", "*.toml", "*.yml"],
"options": {
"useTabs": false
}
},
{
"files": ["**/*.astro"],
"options": {
"parser": "astro"
}
}
],
"pluginSearchDirs": ["./assets"]
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Join us on [Discord](https://astro.build/chat) to meet other maintainers. We'll
| [@astrojs/tailwind](packages/integrations/tailwind) | [![astro version](https://img.shields.io/npm/v/@astrojs/tailwind.svg?label=%20)](packages/integrations/tailwind/CHANGELOG.md) |
| [@astrojs/turbolinks](packages/integrations/turbolinks) | [![astro version](https://img.shields.io/npm/v/@astrojs/turbolinks.svg?label=%20)](packages/integrations/turbolinks/CHANGELOG.md) |

[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6178/badge)](https://bestpractices.coreinfrastructure.org/projects/6178)

Several official projects are maintained outside of this repo:

| Project | Repository |
Expand Down
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Astro Security

## Reporting a Vulnerability

To report a security issue, please email [email protected] with a detailed description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue.

Please remember to include everything required for us to reproduce the issue, including but not limited to a publicly accessible git repository and/or StackBlitz repository. All code samples shared with our Security team will only be used to verify and diagnose the issue and will not be publicly shared with anyone outside of Astro's teams. Astro's Security Team members may share information only within the Astro teams on a need-to-know basis to fix the related issue in Astro.

Our Security team will acknowledge receiving your email within 3 working days.

<ins>**If you think you've found a security issue, please DO NOT report, discuss, or describe it on Discord, GitHub, or any other public forum; without prior contact and acknowledgment of Astro's Security team.**<ins>

This project follows a 90 day disclosure timeline.

**_This is detrimental to the safety of all Astro users. No exceptions._**

## Embargo Policy

The information members and others receive through participation in this group must not be made public, shared, or even hinted otherwise, except with prior explicit approval (which shall be handled on a case-by-case basis). This holds true until the agreed-upon public disclosure date/time is satisfied.

As a clarifying example, this policy forbids Astro Security members from sharing list information with their employers; unless prior arrangements have been made directly with an employer.

In the unfortunate event that you share the information beyond what is allowed by this policy, you must urgently inform the Astro Security Team of exactly what information leaked and to whom, as well as the steps that will be taken to prevent future leaks.

**Repeated offenses may lead to the removal from the Security or Astro team.**
16 changes: 16 additions & 0 deletions SECURITY_CONTACTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Defined below are the security contacts for this repo.
#
# They are the contact point for triaging and handling of incoming
# Security issues.
#
# The below names agree to abide by the
# [Embargo Policy](https://github.com/withastro/astro/blob/master/SECURITY.md)
# and will be removed and replaced if they violate that agreement.
#
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://github.com/withastro/astro/blob/master/SECURITY.md

Randall T. Vasquez (@ran-dall)
Matthew Phillips (@matthewp)
Nate Moore (@natemoo-re)
Fred K. Schott (@fks)
1 change: 0 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Astro Examples Library


The easiest way to check out one of these examples on your machine is by running this command in an empty directory:

```
Expand Down
14 changes: 8 additions & 6 deletions examples/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ Any static assets, like images, can be placed in the `public/` directory.

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :---------------- | :------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| Command | Action |
| :--------------------- | :------------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `npm run astro --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Expand Down
5 changes: 3 additions & 2 deletions examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview"
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"astro": "^1.0.0-rc.5"
"astro": "^1.0.0-rc.8"
}
}
4 changes: 3 additions & 1 deletion examples/basics/src/components/Card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export interface Props {
body: string;
href: string;
}
const { href, title, body } = Astro.props;
const { href, title, body } = Astro.props as Props;
---

<li class="link-card">
Expand Down Expand Up @@ -69,6 +70,7 @@ const { href, title, body } = Astro.props;
}

.link-card:is(:hover, :focus-within) h2 span {
will-change: transform;
transform: translateX(2px);
}
</style>
1 change: 1 addition & 0 deletions examples/basics/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="astro/client" />
1 change: 1 addition & 0 deletions examples/basics/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { title } = Astro.props as Props;
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
Expand Down
5 changes: 3 additions & 2 deletions examples/basics/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Layout from "../layouts/Layout.astro";
import Card from "../components/Card.astro";
import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
---

<Layout title="Welcome to Astro.">
Expand Down Expand Up @@ -86,6 +86,7 @@ import Card from "../components/Card.astro";
border-radius: 4px;
padding: 0.15em 0.25em;
}

.link-card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
Expand Down
4 changes: 2 additions & 2 deletions examples/basics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"resolveJsonModule": true,
// Enable stricter transpilation for better output.
"isolatedModules": true,
// Add type definitions for our Astro runtime.
"types": ["astro/client"]
// Astro will directly run your TypeScript code, no transpilation needed.
"noEmit": true
}
}
Loading

0 comments on commit 06192ec

Please sign in to comment.