Skip to content

Commit

Permalink
Sync: 2024/05/17
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosHuKe committed May 20, 2024
2 parents 1a13b3b + 348fe05 commit 4d38317
Show file tree
Hide file tree
Showing 501 changed files with 7,845 additions and 2,868 deletions.
13 changes: 6 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
// Goal: Be able to run `./dash_site` once the devcontainer is up
// Base container includes node and pnpm
// Flutter is installed in the container
"name": "Dart & Flutter Website Development",
// The mcr base container includes node and pnpm.
// Flutter is installed in the container during creation.
"name": "Flutter documentation website development",
"image": "mcr.microsoft.com/devcontainers/javascript-node:latest",
"forwardPorts": [4000],
"remoteUser": "node",
"containerUser": "node",
"containerEnv": {
"FLUTTER_ROOT": "/home/node/flutter"
},
"remoteEnv": {
"PATH": "${containerEnv:PATH}:${containerEnv:FLUTTER_ROOT}/bin"
},
"onCreateCommand": "git clone --branch=stable https://github.com/flutter/flutter.git ${containerEnv:FLUTTER_ROOT} && ${containerEnv:FLUTTER_ROOT}/bin/flutter doctor",
"onCreateCommand": "git clone --branch=stable https://github.com/flutter/flutter.git ${FLUTTER_ROOT} && ${FLUTTER_ROOT}/bin/flutter doctor",
"postCreateCommand": "git submodule update --init --recursive && flutter pub get && corepack install && pnpm install",
"customizations": {
"vscode": {
"extensions": ["Dart-Code.dart-code","Dart-Code.flutter"]
"extensions": ["Dart-Code.dart-code", "Dart-Code.flutter"]
}
}
}
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ jobs:
- name: "Stable channel"
branch: stable
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: ${{ matrix.branch }}
- name: Fetch Dart dependencies
run: dart pub get
continue-on-error: ${{ matrix.experimental }}
- name: Check Dart code formatting
run: dart run flutter_site format-dart --check
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -53,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand All @@ -71,7 +73,7 @@ jobs:
if: |
github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- name: Enable Corepack
Expand Down Expand Up @@ -104,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand All @@ -124,7 +126,7 @@ jobs:
github.ref == 'refs/heads/main' &&
github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- name: Enable Corepack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.full_name == 'cfug/flutter.cn' }}
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- name: Enable Corepack
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
_site
.cache
.*-cache
.*-metadata
.DS_Store
Expand Down
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,22 +188,37 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
dart pub get
```

3. Install [`pnpm`][] using your preferred [installation method][pnpm-install].
`pnpm` is an alternative, efficient package manager for npm packages.
If you already have `pnpm`, verify you have the latest stable version.
We recommend using [`corepack`][] to install and manage `pnpm` versions,
since it is bundled with most installations of Node.
3. Install `pnpm`, an alternative, efficient package manager for
npm packages. If you already have `pnpm`, verify you have the
latest stable version.

```console
node --version
```

If you do not already have `pnpm` installed, we recommend
using [`corepack`][] to install and manage `pnpm` versions,
since `corepack` is bundled with most installations of
Node. If you installed `node` using Homebrew, you'll need
to install corepack separately:

```console
brew install corepack
```

If you haven't used `corepack` before, you'll need to
first enable it with `corepack enable`.
Then, to install the correct `pnpm` version, from the
root directory of the repository, run `corepack install`:

```console
corepack enable
corepack enable;
corepack install
```

To install [`pnpm`][] without using `corepack`, you
can use your preferred [installation method][pnpm-install].

4. Once you have `pnpm` installed and setup,
fetch the site's npm dependencies using `pnpm install`.
We highly recommend you use `pnpm`, but you can also use `npm`.
Expand Down
19 changes: 10 additions & 9 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function (eleventyConfig) {
eleventyConfig.setLibrary('md', markdown);

eleventyConfig.addDataExtension('yml,yaml', (contents) =>
yaml.load(contents),
yaml.load(contents),
);

eleventyConfig.setLiquidOptions({
Expand All @@ -53,7 +53,7 @@ export default function (eleventyConfig) {
let _currentTabIsActive = false;

// TODO(parlough): Replace samplecode with something easier.
eleventyConfig.addShortcode('samplecode', function(tabsTitle, tabsString) {
eleventyConfig.addShortcode('samplecode', function (tabsTitle, tabsString) {
_currentTabsTitle = tabsTitle.toLowerCase();
let tabMarkup = `<ul class="nav nav-tabs sample-code-tabs" id="${_currentTabsTitle}-language" role="tablist">`;

Expand All @@ -74,11 +74,11 @@ export default function (eleventyConfig) {
return tabMarkup;
});

eleventyConfig.addShortcode('endsamplecode', function() {
eleventyConfig.addShortcode('endsamplecode', function () {
return `</div>`
});

eleventyConfig.addPairedShortcode('sample', function(content, tabName) {
eleventyConfig.addPairedShortcode('sample', function (content, tabName) {
const tabId = `${_currentTabsTitle}-${tabName.toLowerCase().replaceAll("+", "-plus")}`;
const tabContent = `<div class="tab-pane ${_currentTabIsActive ? "active" : ""}" id="${tabId}" role="tabpanel" aria-labelledby="${tabId}-tab">
Expand Down Expand Up @@ -129,11 +129,11 @@ ${content}
});

const dependencies = result.loadedUrls
.filter(
(loadedUrl) =>
loadedUrl.protocol === 'file:' && loadedUrl.pathname !== '',
)
.map((url) => path.relative('.', url.pathname));
.filter(
(loadedUrl) =>
loadedUrl.protocol === 'file:' && loadedUrl.pathname !== '',
)
.map((url) => path.relative('.', url.pathname));

this.addDependencies(inputPath, dependencies);

Expand All @@ -147,6 +147,7 @@ ${content}
eleventyConfig.addPassthroughCopy('src/content/assets/images', { expand: true });
// docs.flutter.cn - translator
eleventyConfig.addPassthroughCopy('src/content/assets/translator');
eleventyConfig.addPassthroughCopy('src/content/cookbook/img-files', { expand: true });
eleventyConfig.addPassthroughCopy('src/content/f', {
expand: true,
filter: /^(?!_).+/,
Expand Down
2 changes: 1 addition & 1 deletion examples/_animation/basic_hero_animation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: >-
Shows how to create a simple or Hero animation using the Hero class directly.
environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
as it animates to the new route.
environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/_animation/basic_staggered_animation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none
description: An introductory example to staggered animations.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/_animation/hero_animation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none
description: Shows how to create a simple Hero transition.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/_animation/radial_hero_animation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
as it animates to the new route.
environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
as it animates to the new route.
environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/_animation/staggered_pic_selection/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none
description: A more complex staggered animation example.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate0/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate1/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate3/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate4/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/animate5/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/implicit/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: none
version: 1.0.0+1

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions examples/basics/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

// #docregion MyApp
// #docregion my-app
class MyApp extends StatelessWidget {
const MyApp({super.key});

Expand All @@ -35,4 +35,4 @@ class MyApp extends StatelessWidget {
);
}
}
// #enddocregion MyApp
// #enddocregion my-app
2 changes: 1 addition & 1 deletion examples/basics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Some code to demonstrate null safety.
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/codelabs
Submodule codelabs updated 1603 files
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: animated_container
description: Sample code for cookbook.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/cookbook/animation/opacity_animation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: opacity_animation
description: Sample code for cookbook.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: page_route_animation
description: Sample code for cookbook.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: physics_simulation
description: Sample code for cookbook.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
flutter:
Expand Down
Loading

0 comments on commit 4d38317

Please sign in to comment.