diff --git a/.gitpod.Dockerfile b/.Dockerfile similarity index 100% rename from .gitpod.Dockerfile rename to .Dockerfile diff --git a/.changeset/curvy-donuts-build.md b/.changeset/curvy-donuts-build.md deleted file mode 100644 index a9a7c44d0986..000000000000 --- a/.changeset/curvy-donuts-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes SSR CSS ordering to match static mode diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..49993bfc769b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" +} diff --git a/.github/ISSUE_TEMPLATE/---01-bug-report.yml b/.github/ISSUE_TEMPLATE/---01-bug-report.yml index 99594a832d3b..9da01a3346e8 100644 --- a/.github/ISSUE_TEMPLATE/---01-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/---01-bug-report.yml @@ -1,6 +1,5 @@ name: "\U0001F41B Bug Report" description: Report an issue or possible bug -title: "\U0001F41B BUG:" labels: [] assignees: [] body: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db76aefbd543..286e99dc7f71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ env: FORCE_COLOR: true ASTRO_TELEMETRY_DISABLED: true + jobs: lint: name: Lint @@ -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 @@ -89,10 +90,10 @@ jobs: - name: Setup PNPM uses: pnpm/action-setup@v2.2.1 - - 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 @@ -102,19 +103,20 @@ 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 @@ -122,10 +124,10 @@ jobs: - name: Setup PNPM uses: pnpm/action-setup@v2.2.1 - - 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 @@ -143,15 +145,17 @@ 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 @@ -159,10 +163,10 @@ jobs: - name: Setup PNPM uses: pnpm/action-setup@v2.2.1 - - 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 @@ -175,13 +179,15 @@ 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 @@ -189,10 +195,10 @@ jobs: - name: Setup PNPM uses: pnpm/action-setup@v2.2.1 - - 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 diff --git a/.gitpod.yml b/.gitpod.yml index 97ce81997b5e..3bca56d1d0a6 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,6 @@ --- image: - file: .gitpod.Dockerfile + file: .Dockerfile # Commands to start on workspace startup tasks: - init: | diff --git a/.prettierignore b/.prettierignore index 7b6398b3e22d..9075aae8482a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -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 diff --git a/.prettierrc.json b/.prettierrc.json index b0a1a2a0757f..4048bb8232ac 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -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"] + ] } diff --git a/README.md b/README.md index 743d48779aa8..f446442abe23 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000000..aab168c72469 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,25 @@ +# Astro Security + +## Reporting a Vulnerability + +To report a security issue, please email security@astro.build 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. + +**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.** + +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.** diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS new file mode 100644 index 000000000000..8e1903d86d2f --- /dev/null +++ b/SECURITY_CONTACTS @@ -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) diff --git a/examples/README.md b/examples/README.md index e3e295b6d71c..50caa7f1801b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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: ``` diff --git a/examples/basics/README.md b/examples/basics/README.md index ccbd39d5d8a8..9013757b7e78 100644 --- a/examples/basics/README.md +++ b/examples/basics/README.md @@ -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? diff --git a/examples/basics/package.json b/examples/basics/package.json index d1e841d1e0b3..b61df5774ceb 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -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" } } diff --git a/examples/basics/src/components/Card.astro b/examples/basics/src/components/Card.astro index 4039d4f4f84a..aea28c83f88e 100644 --- a/examples/basics/src/components/Card.astro +++ b/examples/basics/src/components/Card.astro @@ -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; ---