Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into 6646-advanced-table
Browse files Browse the repository at this point in the history
* origin/dev: (322 commits)
  chore: add ui icons package to enhancement template (#11344)
  chore(table): move workaround comment back to its usage (#11341)
  ci(actions): refine remove-issue-from-design-projects workflow (#11325)
  chore(actions): add icon leads notification for calcite-ui-icons requests (#11263)
  test(combobox): use async expect for non-throwing test case (#11332)
  fix(combobox, input-time-zone): fix initial item selection delay (#11326)
  build(deps): update dependency type-fest to v4.32.0 (#11308)
  chore(utility-network-layer, crosshair): add font codepoints (#11336)
  refactor(loadable): deprecate obsolete helpers (#11312)
  chore: release next
  feat: add crosshair (#11331)
  build(deps): update arcgis to ^4.32.0-next.81 (#11273)
  ci(actions): add action to remove issues from design projects (#11249)
  chore: release next
  fix(list-item): reflect the sortHandleOpen property (#11323)
  refactor(block): heading text color (#11314)
  chore: release next
  fix(list): only focus on row when clicking a list item (#11310)
  fix(tooltip, popover): honor prevented events (#11278)
  chore: release next
  ...
  • Loading branch information
benelan committed Jan 21, 2025
2 parents 79a988a + 7954fef commit 4d0cb2a
Show file tree
Hide file tree
Showing 2,747 changed files with 18,670 additions and 90,063 deletions.
41 changes: 41 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"dictionaries": [
"calcite-dev",
"calcite-dev-examples",
"cspell-pending-upstream",
"css",
"en-common-misspellings",
"fonts",
"fullstack",
"gis",
"html",
"html-symbol-entities",
"lorem-ipsum",
"markdown",
"node",
"npm",
"pokemon",
"scientific-terms-us",
"shell",
"software-terms",
"typescript"
Expand All @@ -19,6 +24,42 @@
{
"name": "calcite-dev",
"path": "./support/dictionaries/dict-calcite-design-system.txt"
},
{
"name": "calcite-dev-examples",
"path": "./support/dictionaries/dict-calcite-design-system-examples.txt"
},
{
"name": "cspell-pending-upstream",
"path": "./support/dictionaries/dict-cspell-pending-upstream.txt"
},
{
"name": "pokemon",
"path": "./node_modules/@cspell/dict-pokemon/dict/pokemon.txt"
}
],
"ignoreRegExpList": [
"arcade-acronym-placeholder",
"console-format-specifier",
"embedded-png-source",
"embedded-svg-source"
],
"patterns": [
{
"name": "arcade-acronym-placeholder",
"pattern": "(?<!\\$)\\{\\w+\\}"
},
{
"name": "console-format-specifier",
"pattern": "%(s|i|d|f|o|O|c)"
},
{
"name": "embedded-png-source",
"pattern": "data:image\\/png;base64,\\w+"
},
{
"name": "embedded-svg-source",
"pattern": "data:image\\/svg\\+xml;.+\\w+"
}
]
}
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE/accessibility.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Accessibility
description: Report an accessibility issue in a component
labels: ["a11y", "bug", "0 - new", "p - high", "needs triage"]
labels: ["a11y", "bug", "0 - new", "needs triage"]
body:
- type: checkboxes
id: existing-issues
Expand All @@ -9,8 +9,7 @@ body:
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 and reviewed the [Accessibility page](https://developers.arcgis.com/calcite-design-system/foundations/accessibility) for guidance.
validations:
required: true
required: true
- type: textarea
id: summary
attributes:
Expand All @@ -36,7 +35,7 @@ body:
attributes:
label: Reproduction Sample
description: |
We provide the following templates to help get started: [codepen](https://codepen.io/pen?template=RwgrjEx) (just Calcite), [React Codesandbox](https://codesandbox.io/s/calcite-template-p95kp?file=/src/App.js) (Calcite with React wrapper), [Angular Codesandbox](https://codesandbox.io/p/sandbox/little-fire-2hx4qh?file=%2Fsrc%2Fapp%2Fapp.component.html%3A16%2C51), or [jsbin](https://jsbin.com/qecewik/edit?html,output) (Calcite with ArcGIS JSAPI). You can also make your own sample using one of the those websites. Alternatively, a [documentation sample](https://developers.arcgis.com/calcite-design-system/components) can be used if the issue is reproducible. If you are experiencing build or Node related errors, please provide a GitHub repo for the sample.
We provide the following templates to help get started: [CodePen](https://codepen.io/pen?template=RwgrjEx) (just Calcite), [StackBlitz](https://stackblitz.com/github/esri/calcite-design-system/tree/dev/examples/components/react?file=README.md) (Calcite with React wrapper), or [JS Bin](https://jsbin.com/qecewik/edit?html,output) (Calcite with Maps SDK for JS). You can also click the "Open in StackBlitz" link at the top of each of [Calcite example's](https://github.com/Esri/calcite-design-system/tree/dev/examples/components) README or make your own from scratch. Alternatively, a [documentation sample](https://developers.arcgis.com/calcite-design-system/components) can be used if the issue is reproducible. If you are experiencing build or Node related errors, please provide a GitHub repo for the sample.
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -105,8 +104,6 @@ body:
- label: "@esri/calcite-components-react"
- label: "@esri/calcite-design-tokens"
- label: "@esri/eslint-plugin-calcite-components"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ body:
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
validations:
required: true
required: true
- type: textarea
id: actual
attributes:
Expand All @@ -30,7 +29,7 @@ body:
attributes:
label: Reproduction Sample
description: |
We provide the following templates to help get started: [codepen](https://codepen.io/pen?template=RwgrjEx) (just Calcite), [React Codesandbox](https://codesandbox.io/s/calcite-template-p95kp?file=/src/App.js) (Calcite with React wrapper), [Angular Codesandbox](https://codesandbox.io/p/sandbox/little-fire-2hx4qh?file=%2Fsrc%2Fapp%2Fapp.component.html%3A16%2C51), or [jsbin](https://jsbin.com/qecewik/edit?html,output) (Calcite with ArcGIS JSAPI). You can also make your own sample using one of the those websites. Alternatively, a [documentation sample](https://developers.arcgis.com/calcite-design-system/components) can be used if the issue is reproducible. If you are experiencing build or Node related errors, please provide a GitHub repo for the sample.
We provide the following templates to help get started: [CodePen](https://codepen.io/pen?template=RwgrjEx) (just Calcite), [StackBlitz](https://stackblitz.com/github/esri/calcite-design-system/tree/dev/examples/components/react?file=README.md) (Calcite with React wrapper), or [JS Bin](https://jsbin.com/qecewik/edit?html,output) (Calcite with Maps SDK for JS). You can also click the "Open in StackBlitz" link at the top of each of [Calcite example's](https://github.com/Esri/calcite-design-system/tree/dev/examples/components) README or make your own from scratch. Alternatively, a [documentation sample](https://developers.arcgis.com/calcite-design-system/components) can be used if the issue is reproducible. If you are experiencing build or Node related errors, please provide a GitHub repo for the sample.
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -100,8 +99,6 @@ body:
- label: "@esri/calcite-design-tokens"
- label: "@esri/calcite-ui-icons"
- label: "@esri/eslint-plugin-calcite-components"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ body:
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
validations:
required: true
required: true
- type: textarea
id: description
attributes:
Expand Down Expand Up @@ -67,9 +66,8 @@ body:
- label: "@esri/calcite-components"
- label: "@esri/calcite-components-react"
- label: "@esri/calcite-design-tokens"
- label: "@esri/calcite-ui-icons"
- label: "@esri/eslint-plugin-calcite-components"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ body:
- label: "@esri/calcite-design-tokens"
- label: "@esri/calcite-ui-icons"
- label: "@esri/eslint-plugin-calcite-components"
validations:
required: false
13 changes: 0 additions & 13 deletions .github/scripts/.eslintrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions .github/scripts/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const baseConfig = require("../../.lintstagedrc.js");

module.exports = {
...baseConfig,
"*.{m,c,}js": ["eslint --fix", "prettier --write"],
};
1 change: 1 addition & 0 deletions .github/scripts/addCalcitePackageLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = async ({ github, context }) => {
github,
context,
label: package,
// eslint-disable-next-line @cspell/spellchecker -- hex color
color: "BFBEAF",
description: `Issues specific to the @esri/${package} package.`,
});
Expand Down
24 changes: 24 additions & 0 deletions .github/scripts/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const globals = require("globals");
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const cspellPlugin = require("@cspell/eslint-plugin");

module.exports = tseslint.config({
files: ["**/*.{c,m,}js"],
extends: [eslint.configs.recommended, tseslint.configs.recommended],
plugins: { "@cspell": cspellPlugin },

languageOptions: {
ecmaVersion: 2021,
sourceType: "commonjs",
globals: {
...globals.node,
},
},

rules: {
"comma-dangle": "off",
"@cspell/spellchecker": ["warn", {}],
"@typescript-eslint/no-require-imports": "off",
},
});
33 changes: 33 additions & 0 deletions .github/scripts/notifyAboutIconRequest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @ts-check

// If the "calcite-ui-icons" label is added to an issue, generates a notification to the Icons team leads to review
// The secret is formatted like so: icon-team-member-1, icon-team-member-2, icon-team-member-3
// Note the script automatically adds the "@" character in to notify the icon team lead(s)

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

const payload = /** @type {import('@octokit/webhooks-types').IssuesLabeledEvent} */ (context.payload);
const {
issue: { number },
} = payload;

const { ICONS_TEAM } = process.env;

// Add a "@" character to notify the user
const icon_leads = ICONS_TEAM?.split(",").map((v) => " @" + v.trim());

if (!icon_leads?.length) {
console.error("unable to determine icon leads");
process.exit(1);
}

// Add a comment to issues with the 'calcite-ui-icons' label to notify icon team lead(s)
await github.rest.issues.createComment({
owner,
repo,
issue_number: number,
body: `cc ${icon_leads}`,
});
};
45 changes: 45 additions & 0 deletions .github/scripts/omitPrFromChangelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// @ts-check
const {
labels: { planning },
} = require("./support/resources");

/** @param {import('github-script').AsyncFunctionArguments} AsyncFunctionArguments */
module.exports = async ({ github, context }) => {
const { repo, owner } = context.repo;
const payload = /** @type {import('@octokit/webhooks-types').PullRequestLabeledEvent} */ (context.payload);
const {
label,
pull_request: { number },
} = payload;

const pullRequestBody = payload.pull_request.body;
const omitComment = `\n\nBEGIN_COMMIT_OVERRIDE\nomitted from changelog\nEND_COMMIT_OVERRIDE`;
const omitCommentRegex = /BEGIN_COMMIT_OVERRIDE/gm;

if (!pullRequestBody) {
console.log("No issue body was found, ending run.");
return;
}

if (pullRequestBody.match(omitCommentRegex)) {
console.log("This PR is already omitted from the changelog, ending run.");
return;
}

if (label?.name === planning.noChangelogEntry) {
const pullRequestProps = {
owner,
repo,
pull_number: number,
};

const newPullRequestBody = `${pullRequestBody}${omitComment}`;

await github.rest.pulls.update({
...pullRequestProps,
body: newPullRequestBody,
});
} else {
console.log(`The \`no changelog entry\` label is not present on this PR.`);
}
};
63 changes: 63 additions & 0 deletions .github/scripts/removeIssueFromDesignProjects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
const { execSync } = require("child_process");

// Environment variables from the GitHub Action
const owner = process.env.OWNER;
const repo = process.env.REPO;
const issueNumber = process.env.ISSUE_NUMBER;

// Function to execute a GitHub GraphQL command
function runQuery(query) {
const command = `gh api graphql -f query='${query}' -F owner="${owner}" -F repo="${repo}" -F issueNumber=${issueNumber}`;
return execSync(command, { encoding: "utf-8" });
}

// Function to create a comment
async function createComment(body) {
const command = `gh issue comment ${issueNumber} --body "${body}"`;
return execSync(command, { encoding: "utf-8" });
}

// GraphQL query to find the project associated with the issue
const query = `
query($owner: String!, $repo: String!, $issueNumber: Int!) {
repository(owner: $owner, name: $repo) {
id
nameWithOwner
description
issue(number: $issueNumber) {
id
title
projectItems(first: 1) {
nodes {
id
project {
id
title
url
}
}
}
}
}
}
`;

try {
const result = runQuery(query);
const parsedResult = JSON.parse(result);
const projectItem = parsedResult.data.repository.issue.projectItems.nodes[0];
console.log("Project Item:", projectItem);

if (projectItem) {
const deleteQuery = `mutation { deleteProjectV2Item(input: {projectId: "${projectItem.project.id}", itemId: "${projectItem.id}"}) { clientMutationId } }`;
runQuery(deleteQuery);
createComment(
`This issue has been removed from the [${projectItem.project.title}](${projectItem.project.url}) project.`,
);
console.log("Issue removed from project.");
} else {
console.log("No associated project found for this issue.");
}
} catch (error) {
console.error("Error:", error.message);
}
1 change: 1 addition & 0 deletions .github/scripts/support/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const resources = {
needsMilestone: "needs milestone",
spike: "spike",
spikeComplete: "spike complete",
noChangelogEntry: "no changelog entry",
},
priority: {
low: "p - low",
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
repo,
name: label,
});
} catch (e) {
} catch {
await github.rest.issues.createLabel({
owner,
repo,
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/trackMilestoneEstimates.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = async ({ github, context, core }) => {
};

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
// @ts-expect-error milestone.number is valid: https://docs.github.com/en/rest/issues/issues#list-repository-issues--parameters
milestone: milestone.number,
owner: owner,
repo: repo,
Expand Down
Loading

0 comments on commit 4d0cb2a

Please sign in to comment.