Skip to content

Commit

Permalink
Merge pull request #248 from angular/main
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Jan 7, 2025
2 parents 3b631b9 + b22677d commit 6b2cbd9
Show file tree
Hide file tree
Showing 78 changed files with 3,533 additions and 1,746 deletions.
154 changes: 139 additions & 15 deletions .github/actions/deploy-docs-site/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9451,6 +9451,102 @@ var require_dist = __commonJS({
}
});

//
var require_fast_content_type_parse = __commonJS({
""(exports, module) {
"use strict";
var NullObject = function NullObject2() {
};
NullObject.prototype = /* @__PURE__ */ Object.create(null);
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
var defaultContentType = { type: "", parameters: new NullObject() };
Object.freeze(defaultContentType.parameters);
Object.freeze(defaultContentType);
function parse3(header) {
if (typeof header !== "string") {
throw new TypeError("argument header is required and must be a string");
}
let index = header.indexOf(";");
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
if (mediaTypeRE.test(type) === false) {
throw new TypeError("invalid media type");
}
const result = {
type: type.toLowerCase(),
parameters: new NullObject()
};
if (index === -1) {
return result;
}
let key;
let match;
let value;
paramRE.lastIndex = index;
while (match = paramRE.exec(header)) {
if (match.index !== index) {
throw new TypeError("invalid parameter format");
}
index += match[0].length;
key = match[1].toLowerCase();
value = match[2];
if (value[0] === '"') {
value = value.slice(1, value.length - 1);
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
}
result.parameters[key] = value;
}
if (index !== header.length) {
throw new TypeError("invalid parameter format");
}
return result;
}
function safeParse3(header) {
if (typeof header !== "string") {
return defaultContentType;
}
let index = header.indexOf(";");
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
if (mediaTypeRE.test(type) === false) {
return defaultContentType;
}
const result = {
type: type.toLowerCase(),
parameters: new NullObject()
};
if (index === -1) {
return result;
}
let key;
let match;
let value;
paramRE.lastIndex = index;
while (match = paramRE.exec(header)) {
if (match.index !== index) {
return defaultContentType;
}
index += match[0].length;
key = match[1].toLowerCase();
value = match[2];
if (value[0] === '"') {
value = value.slice(1, value.length - 1);
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
}
result.parameters[key] = value;
}
if (index !== header.length) {
return defaultContentType;
}
return result;
}
module.exports.default = { parse: parse3, safeParse: safeParse3 };
module.exports.parse = parse3;
module.exports.safeParse = safeParse3;
module.exports.defaultContentType = defaultContentType;
}
});

//
var import_core3 = __toESM(require_core(), 1);
var import_github3 = __toESM(require_github(), 1);
Expand Down Expand Up @@ -9795,10 +9891,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
return 1;
}
if ("CI" in env) {
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
return 3;
}
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
return 1;
}
return min;
Expand Down Expand Up @@ -11377,6 +11473,9 @@ function withDefaults(oldDefaults, newDefaults) {
}
var endpoint = withDefaults(null, DEFAULTS);

//
var import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);

//
var RequestError = class extends Error {
name;
Expand Down Expand Up @@ -11523,14 +11622,25 @@ async function fetchWrapper(requestOptions) {
return octokitResponse;
}
async function getResponseData(response) {
var _a;
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
if (!contentType) {
return response.text().catch(() => "");
}
const mimetype = (0, import_fast_content_type_parse.safeParse)(contentType);
if (mimetype.type === "application/json") {
let text = "";
try {
text = await response.text();
return JSON.parse(text);
} catch (err) {
return text;
}
} else if (mimetype.type.startsWith("text/") || ((_a = mimetype.parameters.charset) == null ? void 0 : _a.toLowerCase()) === "utf-8") {
return response.text().catch(() => "");
} else {
return response.arrayBuffer().catch(() => new ArrayBuffer(0));
}
return response.arrayBuffer();
}
function toErrorMessage(data) {
if (typeof data === "string") {
Expand Down Expand Up @@ -11901,6 +12011,9 @@ function withDefaults3(oldDefaults, newDefaults) {
}
var endpoint2 = withDefaults3(null, DEFAULTS2);

//
var import_fast_content_type_parse2 = __toESM(require_fast_content_type_parse(), 1);

//
var RequestError2 = class extends Error {
name;
Expand Down Expand Up @@ -12047,14 +12160,25 @@ async function fetchWrapper2(requestOptions) {
return octokitResponse;
}
async function getResponseData2(response) {
var _a;
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
if (!contentType) {
return response.text().catch(() => "");
}
const mimetype = (0, import_fast_content_type_parse2.safeParse)(contentType);
if (mimetype.type === "application/json") {
let text = "";
try {
text = await response.text();
return JSON.parse(text);
} catch (err) {
return text;
}
} else if (mimetype.type.startsWith("text/") || ((_a = mimetype.parameters.charset) == null ? void 0 : _a.toLowerCase()) === "utf-8") {
return response.text().catch(() => "");
} else {
return response.arrayBuffer().catch(() => new ArrayBuffer(0));
}
return response.arrayBuffer();
}
function toErrorMessage2(data) {
if (typeof data === "string") {
Expand Down Expand Up @@ -12246,7 +12370,7 @@ var createTokenAuth = function createTokenAuth2(token) {
};

//
var VERSION6 = "6.1.2";
var VERSION6 = "6.1.3";

//
var noop = () => {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Run CI tests for framework
run: yarn tsx ./scripts/build/build-packages-dist.mts
- name: Archive build artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: pr-artifacts-${{ github.event.number }}
path: dist/packages-dist/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:

# Upload the results as artifacts.
- name: 'Upload artifact'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
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@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -952,10 +952,6 @@ Blog post: https://blog.angular.dev/meet-angular-v19-7b29dfd05b84
### compiler-cli
- * Angular no longer supports TypeScript versions older than 5.4.
### core
- `OnPush` views at the root of the application need to
be marked dirty for their host bindings to refresh. Previously, the host
bindings were refreshed for all root views without respecting the
`OnPush` change detection strategy.
- `OnPush` views at the root of the application need to
be marked dirty for their host bindings to refresh. Previously, the host
bindings were refreshed for all root views without respecting the
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo

* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**.
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at **100 characters**.
* We follow [Google's TypeScript Style Guide][ts-style-guide], but wrap all code at **100 characters**.
An automated formatter is available, see [DEVELOPER.md](contributing-docs/building-and-testing-angular.md#formatting-your-source-code).
Expand Down Expand Up @@ -396,4 +396,4 @@ The following documents can help you sort out issues with GitHub accounts and mu
[github]: https://github.com/angular/angular
[discord]: https://discord.gg/angular
[individual-cla]: https://cla.developers.google.com/about/google-individual
[js-style-guide]: https://google.github.io/styleguide/jsguide.html
[ts-style-guide]: https://google.github.io/styleguide/tsguide.html
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2010-2024 Google LLC. https://angular.dev/license
Copyright (c) 2010-2025 Google LLC. https://angular.dev/license

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ cldr_xml_data_repository(
# sass rules
http_archive(
name = "io_bazel_rules_sass",
sha256 = "1b11ce2e7ced21522c83e6c64e9256eb18cd8d89afb8a69e18e6f3e2d3a138a8",
strip_prefix = "rules_sass-df7d2a95e1fa6e15bdb8a796756e276b2289f29a",
sha256 = "0eae9a0c840e1e0d0b9ace056f8bde06384315315c4e2ebdb5cec722d1d4134b",
strip_prefix = "rules_sass-aff53ca13ff2af82d323adb02a83c45a301e9ae8",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/df7d2a95e1fa6e15bdb8a796756e276b2289f29a.zip",
"https://github.com/bazelbuild/rules_sass/archive/aff53ca13ff2af82d323adb02a83c45a301e9ae8.zip",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ export function HeaderApi(props: {entry: DocEntryRenderable; showFullDescription
<div className={HEADER_ENTRY_TITLE}>
<div>
<h1>{entry.name}</h1>
<div
className={HEADER_ENTRY_LABEL}
data-mode={'full'}
data-type={entry.entryType.toLowerCase()}
>
<div className={`${HEADER_ENTRY_LABEL} type-${entry.entryType.toLowerCase()} full`}>
{getEntryTypeDisplayName(entry.entryType)}
</div>
{entry.isDeprecated && (
Expand Down
36 changes: 18 additions & 18 deletions adev/shared-docs/styles/_api-item-label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
background-color 0.3s ease;
text-transform: capitalize;

&[data-mode='short'] {
&:not(.full) {
height: 22px;
width: 22px;
}

&[data-mode='full'] {
&.full {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
}
Expand All @@ -44,58 +44,58 @@
background: color-mix(in srgb, var(--label-theme) 10%, white);
}

&[data-type='undecorated_class'],
&[data-type='class'] {
&.type-undecorated_class,
&.type-class {
--label-theme: var(--symbolic-purple);
}

&[data-type='constant'],
&[data-type='const'] {
&.type-constant,
&.type-const {
--label-theme: var(--symbolic-gray);
}

&[data-type='decorator'] {
&.type-decorator {
--label-theme: var(--symbolic-blue);
}

&[data-type='directive'] {
&.type-directive {
--label-theme: var(--symbolic-pink);
}

&[data-type='element'] {
&.type-element {
--label-theme: var(--symbolic-orange);
}

&[data-type='enum'] {
&.type-enum {
--label-theme: var(--symbolic-yellow);
}

&[data-type='function'] {
&.type-function {
--label-theme: var(--symbolic-green);
}

&[data-type='interface'] {
&.type-interface {
--label-theme: var(--symbolic-cyan);
}

&[data-type='pipe'] {
&.type-pipe {
--label-theme: var(--symbolic-teal);
}

&[data-type='ng_module'] {
&.type-ng_module {
--label-theme: var(--symbolic-brown);
}

&[data-type='type_alias'] {
&.type-type_alias {
--label-theme: var(--symbolic-lime);
}

&[data-type='block'] {
&.type-block {
--label-theme: var(--vivid-pink);
}

&[data-type='developer_preview'],
&[data-type='deprecated'] {
&.type-developer_preview,
&.type-deprecated {
--label-theme: var(--hot-red);
}
}
Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/styles/docs/_mermaid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
fill: var(--page-background) !important;
}

.nodeLabel {
.nodeLabel:not(.node:has(polygon) .nodeLabel) {
fill: var(--primary-contrast) !important;
color: var(--primary-contrast) !important;
}
Expand Down
Loading

0 comments on commit 6b2cbd9

Please sign in to comment.