Skip to content

Commit c3c43e8

Browse files
authored
Merge branch 'main' into main
2 parents d539452 + 937e9eb commit c3c43e8

File tree

1,396 files changed

+39134
-23130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,396 files changed

+39134
-23130
lines changed

.github/workflows/build.yml

+23-21
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
include:
2626
- name: "Beta channel"
2727
branch: beta
28-
experimental: true
28+
experimental: false
2929
- name: "Stable channel"
3030
branch: stable
31-
experimental: false
31+
experimental: true
3232
continue-on-error: ${{ matrix.experimental }}
3333
steps:
34-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3535
with:
3636
submodules: recursive
37-
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
37+
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
3838
with:
3939
channel: ${{ matrix.branch }}
4040
- name: Fetch Dart dependencies
@@ -55,12 +55,12 @@ jobs:
5555
runs-on: ubuntu-latest
5656
if: github.repository == 'cfug/flutter.cn'
5757
steps:
58-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
58+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
5959
with:
6060
submodules: recursive
61-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
61+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
6262
with:
63-
sdk: stable
63+
sdk: beta
6464
- name: Fetch Dart dependencies
6565
run: dart pub get
6666
- name: Check if excerpts are up to date
@@ -73,22 +73,22 @@ jobs:
7373
if: |
7474
github.repository == 'cfug/flutter.cn'
7575
steps:
76-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
76+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
7777
with:
7878
submodules: recursive
7979
- name: Enable Corepack
80-
run: corepack enable
81-
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
80+
run: npm i -g corepack@latest && corepack enable
81+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
8282
with:
8383
node-version: ${{ env.NODE_VERSION }}
8484
cache: 'pnpm'
8585
- name: Setup pnpm
8686
run: corepack install
8787
- name: Install node dependencies
8888
run: pnpm install --frozen-lockfile
89-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
89+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
9090
with:
91-
sdk: stable
91+
sdk: beta
9292
- name: Fetch Dart dependencies
9393
run: dart pub get
9494
- name: Build site
@@ -106,12 +106,12 @@ jobs:
106106
runs-on: ubuntu-latest
107107
if: github.repository == 'cfug/flutter.cn'
108108
steps:
109-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
109+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
110110
with:
111111
submodules: recursive
112-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
112+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
113113
with:
114-
sdk: stable
114+
sdk: beta
115115
- name: Fetch Dart dependencies
116116
run: dart pub get
117117
- name: Validate the firebase.json file
@@ -126,26 +126,28 @@ jobs:
126126
github.ref == 'refs/heads/main' &&
127127
github.repository == 'cfug/flutter.cn'
128128
steps:
129-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
129+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
130130
with:
131131
submodules: recursive
132+
# docs.flutter.cn | https://github.com/cfug/flutter.cn/pull/1518
133+
fetch-depth: 0
132134
- name: Enable Corepack
133-
run: corepack enable
134-
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
135+
run: npm i -g corepack@latest && corepack enable
136+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
135137
with:
136138
node-version: ${{ env.NODE_VERSION }}
137139
cache: 'pnpm'
138140
- name: Setup pnpm
139141
run: corepack install
140142
- name: Install node dependencies
141143
run: pnpm install --frozen-lockfile
142-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
144+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
143145
with:
144-
sdk: stable
146+
sdk: beta
145147
- name: Fetch Dart dependencies
146148
run: dart pub get
147149
- name: Build site
148-
run: dart run flutter_site build
150+
run: dart run flutter_site build --release
149151
- name: Translated (docs.flutter.cn)
150152
run: bash tool/translator/build.sh
151153
shell: bash

.github/workflows/stage.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,28 @@ jobs:
2020
runs-on: ubuntu-latest
2121
if: ${{ github.event.pull_request.head.repo.full_name == 'cfug/flutter.cn' }}
2222
steps:
23-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2424
with:
2525
submodules: recursive
26+
# docs.flutter.cn | https://github.com/cfug/flutter.cn/pull/1518
27+
fetch-depth: 0
2628
- name: Enable Corepack
27-
run: corepack enable
28-
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
29+
run: npm i -g corepack@latest && corepack enable
30+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
2931
with:
3032
node-version: ${{ env.NODE_VERSION }}
3133
cache: 'pnpm'
3234
- name: Setup pnpm
3335
run: corepack install
3436
- name: Install node dependencies
3537
run: pnpm install --frozen-lockfile
36-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
38+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
3739
with:
38-
sdk: stable
40+
sdk: beta
3941
- name: Fetch Dart dependencies
4042
run: dart pub get
4143
- name: Build site
42-
run: dart run flutter_site build
44+
run: dart run flutter_site build --release
4345
- name: Translated (docs.flutter.cn)
4446
run: bash tool/translator/build.sh
4547
shell: bash

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ node_modules
2121
package-lock.json
2222
pubspec.lock
2323
tmp/
24+
25+
# Temporary as codelabs used to be a submodule
26+
examples/codelabs

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
path = site-shared
33
url = https://github.com/dart-lang/site-shared
44
branch = main
5-
[submodule "examples/codelabs"]
6-
path = examples/codelabs
7-
url = https://github.com/flutter/codelabs

.idx/dev.nix

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# To learn more about how to use Nix to configure your environment
2+
# see: https://developers.google.com/idx/guides/customize-idx-env
3+
{ pkgs, ... }: {
4+
# Which nixpkgs channel to use.
5+
channel = "stable-24.11"; # or "unstable"
6+
7+
# Use https://search.nixos.org/packages to find packages
8+
packages = [
9+
pkgs.nodejs_22
10+
pkgs.pnpm
11+
];
12+
13+
# Sets environment variables in the workspace
14+
env = {};
15+
idx = {
16+
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
17+
extensions = [
18+
"Dart-Code.flutter"
19+
"Dart-Code.dart-code"
20+
];
21+
22+
# Enable previews
23+
previews = {
24+
enable = true;
25+
previews = {
26+
web = {
27+
command = ["./dash_site" "serve"];
28+
manager = "web";
29+
env = {
30+
# Environment variables to set for your server
31+
PORT = "$PORT";
32+
};
33+
};
34+
};
35+
};
36+
37+
# Workspace lifecycle hooks
38+
workspace = {
39+
# Runs when a workspace is first created
40+
onCreate = {
41+
get-submodule = "git submodule update --init --recursive";
42+
pnpm-install = "pnpm install";
43+
};
44+
# Runs when the workspace is (re)started
45+
onStart = {
46+
# Example: start a background task to watch and re-build backend code
47+
# watch-backend = "npm run watch-backend";
48+
};
49+
};
50+
};
51+
}

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ Happy Fluttering!
6060
[doc-PRs]: https://github.com/flutter/website/pulls
6161
[so]: https://stackoverflow.com/tags/flutter
6262
[mailinglist]: https://groups.google.com/d/forum/flutter-dev
63-
[chat]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
63+
[chat]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
6464
[reddit]: https://www.reddit.com/r/FlutterDev

README.md

+24-12
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
The [documentation site][Flutter] for the [Flutter framework][],
88
built with [Eleventy][] and hosted on [Firebase][].
99

10-
[![Build Status][]][Repo on GitHub Actions]
11-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/flutter/website/badge)](https://deps.dev/project/github/flutter%2Fwebsite)
12-
1310
[Flutter framework]: https://flutter.dev
1411
[Eleventy]: https://11ty.dev/
1512
[Firebase]: https://firebase.google.com/
@@ -18,6 +15,21 @@ built with [Eleventy][] and hosted on [Firebase][].
1815
[Flutter]: https://docs.flutter.dev/
1916
[Repo on GitHub Actions]: https://github.com/flutter/website/actions?query=workflow%3Abuild+branch%3Amain
2017

18+
<a href="https://idx.google.com/import?url=https%3A%2F%2Fgithub.com%2Fflutter%2Fwebsite">
19+
<picture>
20+
<source
21+
media="(prefers-color-scheme: dark)"
22+
srcset="https://cdn.idx.dev/btn/open_dark_32.svg">
23+
<source
24+
media="(prefers-color-scheme: light)"
25+
srcset="https://cdn.idx.dev/btn/open_light_32.svg">
26+
<img
27+
height="32"
28+
alt="Open in IDX"
29+
src="https://cdn.idx.dev/btn/open_purple_32.svg">
30+
</picture>
31+
</a>
32+
2133
## Issues, bugs, and requests
2234

2335
We welcome contributions and feedback on our website.
@@ -30,8 +42,8 @@ it's easiest to make changes using the GitHub UI.
3042
If you have an issue with the
3143
API docs on [api.flutter.dev](https://api.flutter.dev),
3244
please file those issues on
33-
the [flutter/flutter](https://github.com/flutter/flutter/issues) repo,
34-
not on this (flutter/website) repo.
45+
the [`flutter/flutter`](https://github.com/flutter/flutter/issues) repo,
46+
not on this (`flutter/website`) repo.
3547
The API docs are embedded in Flutter's source code,
3648
so the engineering team handles those.
3749

@@ -117,7 +129,7 @@ If you prefer, you can use a version manager such as [nvm][],
117129
and run `nvm install` from the repository's root directory.
118130

119131
If you already have Node installed, verify it's available on your path
120-
and already the latest stable version _(currently `20.12` or later)_:
132+
and already the latest stable version _(currently `22.12` or later)_:
121133

122134
```console
123135
node --version
@@ -188,7 +200,7 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
188200
dart pub get
189201
```
190202

191-
3. (optional - We highly recommend you use `pnpm`, but you can also use `npm`.)
203+
3. _Optional:_ We recommend you use `pnpm`, but you can also use `npm`.
192204
Install `pnpm`, an alternative, efficient package manager for
193205
npm packages. If you already have `pnpm`, verify you have the
194206
latest stable version.
@@ -197,7 +209,7 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
197209
node --version
198210
```
199211

200-
If you do not already have `pnpm` installed, we recommend
212+
If you don't already have `pnpm` installed, we recommend
201213
using [`corepack`][] to install and manage `pnpm` versions,
202214
since `corepack` is bundled with most installations of
203215
Node. If you installed `node` using Homebrew, you'll need
@@ -220,7 +232,7 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
220232
To install [`pnpm`][] without using `corepack`, you
221233
can use your preferred [installation method][pnpm-install].
222234

223-
5. (optional) Once you have `pnpm` installed and setup,
235+
5. _(optional)_ Once you have `pnpm` installed and setup,
224236
fetch the site's npm dependencies using `pnpm install`.
225237
We highly recommend you use `pnpm`, but you can also use `npm`.
226238

@@ -294,7 +306,7 @@ and we'll try our best to help you.
294306
You can also chat with us on the `#hackers-devrel` channel
295307
on the [Flutter contributors Discord][]!
296308

297-
[Flutter contributors Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
309+
[Flutter contributors Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
298310

299311
### Refresh code excerpts
300312

@@ -315,7 +327,7 @@ run `./dash_site refresh-excerpts`.
315327
To learn more about creating, editing, and using code excerpts,
316328
check out the [excerpt updater package documentation][].
317329

318-
[excerpt updater package documentation]: https://github.com/dart-lang/site-shared/tree/main/packages/excerpter#readme
330+
[excerpt updater package documentation]: https://github.com/dart-lang/site-shared/tree/main/pkgs/excerpter#readme
319331

320332
## [Optional] Deploy to a staging site
321333

@@ -348,7 +360,7 @@ you can build a full version and upload it to Firebase.
348360
./dash_site build
349361
```
350362

351-
This will build the site and copy it to your local `_site` directory.
363+
This builds the site and copies it to your local `_site` directory.
352364
If that directory previously existed, it will be replaced.
353365

354366
3. Deploy to your activated Firebase project's default hosting site:

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
analyzer:
2-
exclude: [flutter, site-shared, src, tmp, 'examples/codelabs']
2+
exclude: [_site, flutter, site-shared, src, tmp]

dash_site

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
REQUIRED_DART_VERSION="3.5"
4-
REQUIRED_NODE_VERSION="20.12"
5-
REQUIRED_PNPM_VERSION="9.0"
3+
REQUIRED_DART_VERSION="3.6"
4+
REQUIRED_NODE_VERSION="22.11"
5+
REQUIRED_PNPM_VERSION="9.12"
66

77
# Check that the 'dart' command is available on the user's path.
88
if ! command -v dart &> /dev/null; then
@@ -79,6 +79,10 @@ if command -v pnpm &> /dev/null; then
7979
echo "pnpm version $pnpm_version is too low. Version $REQUIRED_PNPM_VERSION or later is required."
8080
exit 1
8181
fi
82+
83+
# If using pnpm, update the dependencies silently as it is quick.
84+
echo "Verifying npm dependencies are up to date..."
85+
pnpm install --silent
8286
fi
8387

8488
# Verify that Node packages have been installed.
Binary file not shown.

0 commit comments

Comments
 (0)