Skip to content

Commit

Permalink
[sync] 2024/08/06 (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglu authored Aug 7, 2024
2 parents 3bea538 + 1b16d08 commit 7ea348f
Show file tree
Hide file tree
Showing 77 changed files with 2,737 additions and 1,439 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# name: Scorecards supply-chain security
# on:
# # Only the default branch is supported.
# branch_protection_rule:
# push:
# branches: [ main ]

# # Declare default permissions as read only.
# permissions: read-all

# jobs:
# analysis:
# name: Scorecards analysis
# runs-on: ubuntu-latest
# permissions:
# # Needed to upload the results to code-scanning dashboard.
# security-events: write
# actions: read
# contents: read
# id-token: write

# steps:
# - name: "Checkout code"
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# with:
# persist-credentials: false

# - name: "Run analysis"
# uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46
# with:
# results_file: results.sarif
# results_format: sarif
# # Read-only PAT token. To create it,
# # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
# repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
# # Publish the results to enable scorecard badges. For more details, see
# # https://github.com/ossf/scorecard-action#publishing-results.
# # For private repositories, `publish_results` will automatically be set to `false`,
# # regardless of the value entered here.
# publish_results: true

# # Upload the results as artifacts (optional).
# - name: "Upload artifact"
# uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029
# with:
# name: SARIF file
# path: results.sarif
# retention-days: 5

# # Upload the results to GitHub's code scanning dashboard.
# - name: "Upload to code-scanning"
# uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
# with:
# sarif_file: results.sarif
19 changes: 19 additions & 0 deletions cloud_build/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# steps:
# - name: gcr.io/cloud-builders/git
# args: ['submodule', 'update', '--init', '--recursive']
# - name: gcr.io/cloud-builders/git
# args: [ 'fetch', '--unshallow' ]
# - name: gcr.io/flutter-dev-230821/firebase-ghcli
# # Set up, build, then deploy site to production
# entrypoint: '/bin/bash'
# args:
# - '-c'
# - |-
# set -e

# npm install
# npm run build-site-for-production

# firebase deploy --project=dart-dev --only=hosting
# options:
# logging: CLOUD_LOGGING_ONLY
2 changes: 1 addition & 1 deletion dash_site
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

REQUIRED_DART_VERSION="3.4"
REQUIRED_DART_VERSION="3.5"
REQUIRED_NODE_VERSION="20.12"
REQUIRED_PNPM_VERSION="9.1"

Expand Down
65 changes: 5 additions & 60 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
// It configures the core 11ty behavior and registers
// plugins and customization that live in `/src/_11ty`.

import {
activeNavEntryIndexArray,
arrayToSentenceString,
breadcrumbsForPage,
generateToc,
regexReplace,
toISOString,
underscoreBreaker,
} from './src/_11ty/filters.js';
import { registerFilters } from './src/_11ty/filters.js';
import { registerShortcodes } from './src/_11ty/shortcodes.js';
import { markdown } from './src/_11ty/plugins/markdown.js';
import { configureHighlighting } from './src/_11ty/plugins/highlight.js';

Expand All @@ -19,7 +12,6 @@ import yaml from 'js-yaml';

import * as path from 'node:path';
import * as sass from 'sass';
import {eleventyImageTransformPlugin} from '@11ty/eleventy-img';

// noinspection JSUnusedGlobalSymbols
/**
Expand Down Expand Up @@ -47,20 +39,10 @@ export default function (eleventyConfig) {
strictFilters: true,
lenientIf: true,
});
eleventyConfig.setLiquidParameterParsing('builtin');

eleventyConfig.addFilter('regex_replace', regexReplace);
eleventyConfig.addFilter('toISOString', toISOString);
eleventyConfig.addFilter(
'active_nav_entry_index_array',
activeNavEntryIndexArray,
);
eleventyConfig.addFilter('array_to_sentence_string', arrayToSentenceString);
eleventyConfig.addFilter('underscore_breaker', underscoreBreaker);
eleventyConfig.addFilter('throw_error', function (error) {
throw new Error(error);
});
eleventyConfig.addFilter('generate_toc', generateToc);
eleventyConfig.addFilter('breadcrumbsForPage', breadcrumbsForPage);
registerFilters(eleventyConfig);
registerShortcodes(eleventyConfig);

eleventyConfig.addTemplateFormats('scss');
eleventyConfig.addWatchTarget('src/_sass');
Expand Down Expand Up @@ -121,43 +103,6 @@ export default function (eleventyConfig) {

return content;
});

// Optimize all images, generate an avif, webp, and png version,
// and indicate they should be lazily loaded.
// Save in `_site/assets/img` and update links to there.
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
extensions: 'html',
formats: ['webp', 'png', 'svg'],
svgShortCircuit: true,
widths: ['auto'],
defaultAttributes: {
loading: 'lazy',
decoding: 'async',
},
urlPath: '/assets/img/',
outputDir: '_site/assets/img/',
sharpOptions: {
animated: true,
},
});
} else {
// To be more consistent with the production build,
// don't optimize images but still indicate they should be lazily loaded.
// Then save in `_site/assets/img` and update links to there.
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
extensions: 'html',
formats: ['auto'],
widths: ['auto'],
defaultAttributes: {
loading: 'lazy',
decoding: 'async',
},
urlPath: '/assets/img/',
outputDir: '_site/assets/img/',
sharpOptions: {
animated: true,
},
});
}

eleventyConfig.setQuietMode(true);
Expand Down
2 changes: 1 addition & 1 deletion examples/analysis/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
examples_util: {path: ../util}
Expand Down
2 changes: 1 addition & 1 deletion examples/analysis_alt/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/async_await/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: async_await
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/build_runner_usage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: build_runner_usage
description: dart.dev build_runner example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
args: ^2.4.0
build_runner: ^2.4.8
build_runner: ^2.4.10
build_test: ^2.2.2
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: cli_examples
description: Examples for CLI tutorials on dart.dev

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
args: ^2.4.2

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/concurrency/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version: 0.0.1
publish_to: none

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
http: any

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/create_libraries/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: dart.dev example code.
version: 1.0.0

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/extension_methods/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: dart.dev example code.
version: 1.0.0

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
2 changes: 1 addition & 1 deletion examples/fetch_data/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Fetch data example
version: 0.0.1

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
http: ^1.2.0
Expand Down
4 changes: 2 additions & 2 deletions examples/futures/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version: 0.0.1
publish_to: none

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/html/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ description: dart.dev example code.
version: 0.0.1

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
examples_util: {path: ../util}
4 changes: 2 additions & 2 deletions examples/iterables/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: iterables_examples
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
examples_util: {path: ../util}
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/language/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
examples_util: { path: ../util }

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/misc/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
args: ^2.4.2
Expand All @@ -12,4 +12,4 @@ dependencies:

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
2 changes: 1 addition & 1 deletion examples/non_promotion/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: dart.dev non-promotion examples.
version: 0.0.1

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
mockito: ^5.4.4
Expand Down
4 changes: 2 additions & 2 deletions examples/null_safety_codelab/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: null_safety_codelab_examples
description: dart.dev example code for null safety codelab

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dev_dependencies:
examples_util: {path: ../util}
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/type_system/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: type_system_examples
description: dart.dev type system examples.

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^4.0.0
test: ^1.25.2
test: ^1.25.8
4 changes: 2 additions & 2 deletions examples/util/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ description: dart.dev example utilities.
version: 0.0.2

environment:
sdk: ^3.4.0
sdk: ^3.5.0

dependencies:
test: ^1.25.2
test: ^1.25.8

dev_dependencies:
lints: ^4.0.0
Loading

0 comments on commit 7ea348f

Please sign in to comment.