Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into benelan/element-internals
Browse files Browse the repository at this point in the history
* origin/dev: (230 commits)
  chore: release next
  chore(sort-handle): add messages (#10474)
  feat(accordion-item): stretch slotted actions to fill its height (#9250)
  chore: release next
  feat(dialog, modal, popover, input-date-picker,  input-time-picker, sheet): support stacked component sequential closing with escape (#9231)
  chore: remove commented-out code (#10478)
  chore: add cssrem VSCode extension recommendation (#10300)
  docs(accordion-item): fix deprecation tag (#10479)
  chore: release next
  feat(stepper-item): update component's active state background color. (#10475)
  refactor: use `requestAnimationFrame` to replace `readTask` (#10432)
  chore: release next
  fix(tip): fix rendering tied to named-slot content (#10470)
  ci: compile estimate totals per milestone (#10442)
  chore: release next
  fix(modal): fix rendering tied to named-slot content (#10469)
  chore: release next
  fix(shell-center-row): fix rendering tied to named-slot content (#10451)
  fix(inline-editable): fix rendering tied to default slot content (#10456)
  fix(input, input-number, input-text): should not set slotted actions to be disabled (#10458)
  ...
  • Loading branch information
benelan committed Oct 7, 2024
2 parents 306de29 + aef57dd commit 8e29dea
Show file tree
Hide file tree
Showing 626 changed files with 21,374 additions and 6,495 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/accessibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
label: Check existing issues
description: If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one. For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
options:
- label: I have [checked for existing issues](https://github.com/Esri/calcite-design-system/issues) to avoid duplicates
- label: I have [checked for existing issues](https://github.com/Esri/calcite-design-system/issues) to avoid duplicates and reviewed the [Accessibility page](https://developers.arcgis.com/calcite-design-system/foundations/accessibility) for guidance.
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -124,6 +124,7 @@ body:
- ArcGIS Business/Community Analyst
- ArcGIS Charts
- ArcGIS Dashboards
- ArcGIS Data Pipelines
- ArcGIS Developer Experience
- ArcGIS Enterprise
- ArcGIS Excalibur
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ body:
- ArcGIS Business/Community Analyst
- ArcGIS Charts
- ArcGIS Dashboards
- ArcGIS Data Pipelines
- ArcGIS Developer Experience
- ArcGIS Enterprise
- ArcGIS Excalibur
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ body:
- ArcGIS Business/Community Analyst
- ArcGIS Charts
- ArcGIS Dashboards
- ArcGIS Data Pipelines
- ArcGIS Developer Experience
- ArcGIS Enterprise
- ArcGIS Excalibur
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ body:
- ArcGIS Business/Community Analyst
- ArcGIS Charts
- ArcGIS Dashboards
- ArcGIS Data Pipelines
- ArcGIS Developer Experience
- ArcGIS Enterprise
- ArcGIS Excalibur
Expand Down
39 changes: 22 additions & 17 deletions .github/scripts/addEsriProductLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,27 @@ module.exports = async ({ github, context }) => {

const productRegexMatch = body.match(productRegex);

const product = (productRegexMatch && productRegexMatch[0] ? productRegexMatch[0] : "").trim();

if (product !== "N/A") {
await createLabelIfMissing({
github,
context,
label: product,
color: "006B75",
description: `Issues logged by ${product} team members.`,
});

await github.rest.issues.addLabels({
issue_number,
owner,
repo,
labels: [product],
});
// If issue includes "Esri team" line then create label, otherwise log message.
if (productRegexMatch) {
const product = (productRegexMatch && productRegexMatch[0] ? productRegexMatch[0] : "").trim();

if (product !== "N/A") {
await createLabelIfMissing({
github,
context,
label: product,
color: "006B75",
description: `Issues logged by ${product} team members.`,
});

await github.rest.issues.addLabels({
issue_number,
owner,
repo,
labels: [product],
});
}
} else {
console.log(`No Esri team listed on issue #${issue_number}`);
}
};
23 changes: 16 additions & 7 deletions .github/scripts/addUnblockedComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = async ({ github, context }) => {
const payload = /** @type {import('@octokit/webhooks-types').IssuesLabeledEvent} */ (context.payload);
const { ISSUE_VERIFIERS } = process.env;
const issueBody = payload.issue.body;
const blockedIssuesRegex = /(?!Blocked issues:\s)(#\d+)/gi;
const blockedIssuesRegex = /Blocked issues:\s*(#\d+(?:,\s*#\d+)*)/i;

if (!issueBody) {
console.log("No issue body was found");
console.log("No issue body was found.");
return;
}

Expand All @@ -23,7 +23,7 @@ module.exports = async ({ github, context }) => {

// If "Blocked issues" line is matched in the body then create a comment on each issue listed
if (blockedIssues) {
const issueNumbers = blockedIssues.map((number) => number.slice(1));
const issueNumbers = blockedIssues[1].split(",").map((num) => num.trim().slice(1));

for (const issueNumber of issueNumbers) {
const issueProps = {
Expand All @@ -32,10 +32,19 @@ module.exports = async ({ github, context }) => {
issue_number: Number(issueNumber),
};

await github.rest.issues.createComment({
...issueProps,
body: `Issue #${context.issue.number} has been closed, this issue is ready for re-evaluation. \n\ncc ${verifiers}`,
});
try {
await github.rest.issues.createComment({
...issueProps,
body: `Issue #${context.issue.number} has been closed, this issue is ready for re-evaluation. \n\ncc ${verifiers}`,
});
} catch (error) {
if (error.status === 404) {
console.log(`Issue #${issueNumber} does not exist.`);
continue;
} else {
throw error;
}
}

try {
await github.rest.issues.removeLabel({
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/notifyWhenReadyForDev.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ module.exports = async ({ github, context }) => {
label: issueWorkflow.assigned,
});

await removeLabel({
github,
context,
label: planning.needsTriage,
});

await github.rest.issues.addLabels({
...issueProps,
labels: [issueWorkflow.new, planning.needsMilestone],
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/support/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const resources = {
verified: "4 - verified",
},
planning: {
needsTriage: "needs triage",
needsMilestone: "needs milestone",
spike: "spike",
spikeComplete: "spike complete",
Expand Down
6 changes: 5 additions & 1 deletion .github/scripts/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ module.exports = {
name: label,
});
} catch (err) {
console.log(`The '${label}' label is not associated with the issue`, err);
if (err.status === 404) {
console.log(`The label '${label}' is not associated with issue #${issue_number}.`, err);
} else {
console.log("Error while attempting to remove issue label.", err);
}
}
},

Expand Down
78 changes: 78 additions & 0 deletions .github/scripts/trackMilestoneEstimates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// @ts-check
const { writeFile } = require("fs/promises");

/** @param {import('github-script').AsyncFunctionArguments} AsyncFunctionArguments */
module.exports = async ({ github, context, core }) => {
const { repo, owner } = context.repo;

const outputJson = {};
let outputCsv = "id,title,due_on,open_issues,closed_issues,remaining_estimate,completed_estimate";

try {
const milestones = await github.rest.issues.listMilestones({
owner: owner,
repo: repo,
state: "all",
sort: "due_on",
per_page: 100,
direction: "desc",
});

if (milestones.data.length === 0) {
console.error("No milestones found.");
process.exit(1);
}

for (const milestone of milestones.data) {
outputJson[milestone.number] = {
title: milestone.title,
due_on: milestone.due_on,
open_issues: milestone.open_issues,
closed_issues: milestone.closed_issues,
remaining_estimate: 0,
completed_estimate: 0,
};

const issues = await github.paginate(github.rest.issues.listForRepo, {
// @ts-ignore milestone.number is valid: https://docs.github.com/en/rest/issues/issues#list-repository-issues--parameters
milestone: milestone.number,
owner: owner,
repo: repo,
state: "all",
per_page: 100,
});

for (const issue of issues) {
if (issue.pull_request) {
continue;
}

for (const label of issue.labels) {
const estimateLabelMatch = (typeof label === "string" ? label : label?.name)?.match(/estimate - (\d+)/);

if (estimateLabelMatch?.length > 1) {
outputJson[milestone.number][issue.state === "open" ? "remaining_estimate" : "completed_estimate"] +=
Number.parseInt(estimateLabelMatch[1]);

break; // assumes an issue will only have one estimate label
}
}
}

outputCsv = `${outputCsv}\n${milestone.number},${Object.values(outputJson[milestone.number]).join(",")}`;
}

const stringifiedOutputJson = JSON.stringify(outputJson, null, 2);

core.debug(`JSON Output:\n${stringifiedOutputJson}`);
core.debug(`CSV Output:\n${outputCsv}`);

await writeFile("./milestone-estimates.csv", outputCsv);
await writeFile("./milestone-estimates.json", stringifiedOutputJson);

process.exit(0);
} catch (error) {
console.error(error);
process.exit(1);
}
};
5 changes: 2 additions & 3 deletions .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- name: Build Packages and Publish to NPM
if: steps.release.outputs.releases_created == 'true'
env:
RELEASED_PATHS: ${{ toJSON(steps.release.outputs.paths_released) }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
Expand Down Expand Up @@ -92,7 +91,7 @@ jobs:
git commit -m "build: update types and package-lock" || true
npm run publish:latest
npm run util:upload-release-assets -- "$RELEASED_PATHS"
npm run util:upload-release-assets -- "${{toJSON(steps.release.outputs.paths_released)}}"
git checkout -b ci/cherry-pick-release-commit origin/dev
Expand All @@ -101,7 +100,7 @@ jobs:
${{github.workspace}}/packages/*/CHANGELOG.md \
${{github.workspace}}/packages/calcite-components-angular/projects/component-library/CHANGELOG.md
git checkout --theirs
git checkout --theirs \
${{github.workspace}}/packages/*/package.json \
${{github.workspace}}/packages/calcite-components-angular/projects/component-library/package.json
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/pr-semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,20 @@ jobs:
- uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
# default https://github.com/commitizen/conventional-commit-types/blob/master/index.json
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
# custom
deprecate
21 changes: 21 additions & 0 deletions .github/workflows/track-milestone-estimates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Track Milestone Estimates
on:
workflow_dispatch:
issues:
types: [closed]
jobs:
estimates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create estimates data
uses: actions/github-script@v7
with:
script: |
const action = require('${{ github.workspace }}/.github/scripts/trackMilestoneEstimates.js')
await action({github, context, core})
- name: Upload estimates data
uses: actions/upload-artifact@v4
with:
name: milestone-estimates
path: milestone-estimates.*
70 changes: 63 additions & 7 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,11 +1,67 @@
#!/usr/bin/env sh

lint-staged

types_path="packages/calcite-components/src/components.d.ts"
ensure_types_are_up_to_date() {
types_path="packages/calcite-components/src/components.d.ts"

# make sure the types are always up to date
if [ -n "$(git diff --name-only -- "$types_path")" ]; then
if [ -n "$(git diff --name-only -- "$types_path")" ]; then
echo "Automatically staging changes to \"$types_path\""
git add "$types_path"
fi
git add "$types_path" >/dev/null 2>&1 || true
fi
}

update_stylelint_config_if_sass_file_edited() {
staged_files="$(
git diff --cached --name-only --diff-filter=ACM -- packages/**/*.scss
)"

if [ -n "$staged_files" ]; then
npm run util:update-stylelint-custom-sass-functions
git add "packages/calcite-components/.stylelintrc.cjs" >/dev/null 2>&1 || true
fi

unset staged_files
}

check_ui_icon_name_consistency() {
# this pattern checks for `<iconName>-<size>.svg` or `<iconName>-<size>-f.svg` for filled icons
# where `<iconName>` is kebab-case, `<size>` is 16, 24, or 32
valid_pattern="^[a-z0-9-]+-(16|24|32)(-f)?\\.svg$"

# this pattern will check for invalid use of "-f-" anywhere except right before the size
invalid_pattern="-[a-z0-9]+-f-"

staged_files="$(
git diff --cached --name-only --diff-filter=ACM -- packages/calcite-ui-icons/icons/*.svg
)"

if [ -n "$staged_files" ]; then
for file in $staged_files; do
filename="$(basename "$file")"

# first, ensure the filename follows the valid pattern
if ! echo "$filename" | grep -qE "$valid_pattern"; then
printf "%s\n%s" \
"error: file '$file' does not follow the naming convention:" \
"(<iconname>-<size>.svg | <iconname>-<size>-f.svg)"
exit 1
fi

# then, ensure there's no invalid use of "-f-" anywhere except right before the size
if echo "$filename" | grep -qE "$invalid_pattern"; then
printf '%s\n%s' \
"error: file '$file' has an invalid '-f-' and does not follow the naming convention:" \
"(<iconname>-<size>.svg | <iconname>-<size>-f.svg)"
exit 1
fi
done
fi

unset staged_files
}

lint-staged
check_ui_icon_name_consistency
ensure_types_are_up_to_date
update_stylelint_config_if_sass_file_edited

exit 0
Loading

0 comments on commit 8e29dea

Please sign in to comment.