Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: master to alpha #2981

Merged
merged 42 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7b2b3ad
docs: update dependent-usage.json (#2973)
github-actions[bot] Dec 26, 2023
a1adfaa
chore: remove browserlist-config (#2970)
khudym Dec 27, 2023
3b3fa69
fix: center align Hyperlink with its icon (#2971)
khudym Dec 27, 2023
52d7e6e
fix: update `TableFooter` to match design spec (#2969)
khudym Dec 27, 2023
83dbcf7
chore: update browserslist DB (#2967)
edx-requirements-bot Dec 27, 2023
06f7813
docs: update dependent-usage.json (#2978)
github-actions[bot] Dec 27, 2023
4dcf111
docs: update dependent-usage.json (#2980)
github-actions[bot] Dec 28, 2023
fc90b3f
chore: added Husky configuration (#2949)
PKulkoRaccoonGang Dec 29, 2023
51d864a
docs: switch scope of the package to `openedx` in docs (#2979)
PKulkoRaccoonGang Dec 29, 2023
6927788
feat: added CLI command to migrate to using `openedx` scope (#2984)
PKulkoRaccoonGang Dec 29, 2023
35bfa7d
docs: include Algolia DocSearch ADR and crawler config (#2991)
adamstankiewicz Jan 10, 2024
b858230
fix: rely on Form.Control and controlId in Form.Group (#2931)
adamstankiewicz Jan 11, 2024
613bed0
build: specify semantic release version that is compatible with node …
brian-smith-tcril Jan 16, 2024
0274f10
feat!: release chip, searchfield, pagination, form.autosuggest (#2964)
adamstankiewicz Jan 19, 2024
4ba0b6d
Revert "feat!: release chip, searchfield, pagination, form.autosugges…
adamstankiewicz Jan 19, 2024
970b102
feat!: release updates to Chip, SearchField, Pagination, Form.Autosug…
adamstankiewicz Jan 19, 2024
163ce82
build: temporarily disable cron on failing usage insights github acti…
adamstankiewicz Feb 7, 2024
2801667
feat: allow consumers to configure ModalDialog to allow overflow (#2939)
brian-smith-tcril Feb 12, 2024
7e4a81f
fix: unrecognized prop warning in form autosuggest (#3003)
syedsajjadkazmii Feb 14, 2024
98e6313
build: ignore npm scripts when installing dependencies in dependent a…
viktorrusakov Feb 28, 2024
0983219
feat: working typings for Paragon, better types for <Icon> component …
bradenmacdonald Mar 25, 2024
1fd134a
fix: display of menu items with checkboxes (#3019)
bradenmacdonald Mar 26, 2024
95b0ce7
chore: add ci check for unbuilt updated icons
brian-smith-tcril Apr 3, 2024
d67a04f
chore: rebuild icons
brian-smith-tcril Apr 3, 2024
a381182
fix: ensure esc key does not close modals that are blocking (#3033)
adamstankiewicz Apr 17, 2024
784f604
feat: add LMS icons (#3029)
brian-smith-tcril Apr 25, 2024
c088b28
fix: remove duplicate icons
brian-smith-tcril Apr 25, 2024
2557a95
Merge pull request #3035 from brian-smith-tcril/fix-extra-icons
arbrandes Apr 26, 2024
1c8b937
chore: make icon verification more robust
brian-smith-tcril Apr 25, 2024
e7553ef
Merge pull request #3036 from brian-smith-tcril/more-robust-icon-check
arbrandes Apr 26, 2024
f41b7c6
build: update codecov action to v4 and use token (#3037)
brian-smith-tcril Apr 26, 2024
0750db7
fix: Wrong propTypes for SearchFieldAdvanced.icons (#3026)
bradenmacdonald May 1, 2024
73f3ec6
chore(deps): updated jest to v29 (#3032)
BilalQamar95 May 1, 2024
d009dce
chore(deps): bump follow-redirects from 1.15.2 to 1.15.6 (#3017)
dependabot[bot] May 1, 2024
34eef18
docs: allow-modals in playground (#2987)
brian-smith-tcril May 2, 2024
1757b71
chore(deps): bump msgpackr from 1.8.5 to 1.10.1 (#2982)
dependabot[bot] May 2, 2024
647086c
chore(deps): bump axios from 0.27.2 to 0.28.0 (#3007)
dependabot[bot] May 2, 2024
fe264d1
chore(deps): bump express from 4.18.2 to 4.19.2 (#3042)
dependabot[bot] May 2, 2024
8581d75
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (#3012)
dependabot[bot] May 2, 2024
06263ea
chore: update browserslist DB (#2985)
edx-requirements-bot May 7, 2024
2aa087f
feat: add new twitter X icon
kalebjdavenport Oct 4, 2023
9993fb3
chore(deps): update `bootstrap-icons` package and build icons
brian-smith-tcril May 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ dist/
node_modules/
www/
icons/
dependent-usage-analyzer/
build-scss.js
component-generator/
example/
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Include a direct link to your changes in this PR's deploy preview here (e.g., a
* [ ] Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
* [ ] Were your changes tested in the `example` app?
* [ ] Is there adequate test coverage for your changes?
* [ ] Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add `wittjeff` and `adamstankiewicz` as reviewers on this PR.
* [ ] Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please request an a11y review for the PR in the [#wg-paragon](https://openedx.slack.com/archives/C02NR285KV4) Open edX Slack channel.

## Post-merge Checklist

* [ ] Verify your changes were released to [NPM](https://www.npmjs.com/package/@edx/paragon) at the expected version.
* [ ] Verify your changes were released to [NPM](https://www.npmjs.com/package/@openedx/paragon) at the expected version.
* [ ] If you'd like, [share](https://github.com/openedx/paragon/discussions/new?category=show-and-tell) your contribution in [#show-and-tell](https://github.com/openedx/paragon/discussions/categories/show-and-tell).
* [ ] 🎉 🙌 Celebrate! Thanks for your contribution.
4 changes: 2 additions & 2 deletions .github/workflows/analyze-dependents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Analyze Dependents

on:
workflow_dispatch:
schedule:
- cron: "0 14 * * *" # daily at 10am EST (Github Actions works with UTC)
schedule:
- cron: "0 14 * * *" # daily at 10am EST (Github Actions works with UTC)

jobs:
# clones known dependent Git repositories from Open edX
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,21 @@ jobs:
run: npm run lint
- name: Test
run: npm run test
- name: Verify icon changes
run: |
cd icons
rm -rf jsx
rm -rf es5
npm run build
if [[ -n $(git status -s) ]]; then
echo "::error::Generated icons do not match committed icons. Please run \`npm run build\` in the icons directory."
exit 1
fi
- name: Build
run: npm run build
- name: Build Docs
run: npm run build-docs
- name: Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
run: npm run build
# NPM expects to be authenticated for publishing. This step will fail CI if NPM is not authenticated
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ jobs:
- name: Build Docs
run: npm run build-docs
- name: Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_NPM_TOKEN }}
run: npx semantic-release
run: npx semantic-release@22
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
build:
rm -rf ./dist
tsc --emitDeclarationOnly
./node_modules/.bin/babel src --config-file ./babel.config.json --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.tsx,**/__mocks__,**/__snapshots__,**/setupTest.js --copy-files --extensions ".tsx,.jsx"
tsc --project tsconfig.build.json
rm icons/es5/index.d.ts # We don't need this; not sure how to tell tsc not to generate it
./node_modules/.bin/babel src --config-file ./babel.config.json --out-dir dist --source-maps --ignore **/*.d.ts,**/*.test.jsx,**/*.test.tsx,**/__mocks__,**/__snapshots__,**/setupTest.js --copy-files --extensions ".ts,.tsx,.jsx"
# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want.
find ./dist -name "tests" -type d -prune -exec rm -rf "{}" \; # delete tests directories
find ./dist -name "*.test.*" -delete # delete other tests files that weren't in tests directories
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Paragon

[![Build Status](https://github.com/openedx/paragon/actions/workflows/release.yml/badge.svg)](https://github.com/openedx/paragon/actions/workflows/release.yml)
[![npm_version](https://img.shields.io/npm/v/@edx/paragon.svg)](@edx/paragon)
[![npm_version](https://img.shields.io/npm/v/@openedx/paragon.svg)](@openedx/paragon)
![status](https://img.shields.io/badge/status-Maintained-brightgreen)
![license](https://img.shields.io/github/license/openedx/paragon.svg)
[![codecov](https://codecov.io/gh/edx/paragon/branch/master/graph/badge.svg?token=x1tZmNduy9)](https://codecov.io/gh/edx/paragon)
[![NPM downloads](https://img.shields.io/npm/dw/@edx/paragon)](https://www.npmjs.com/package/@edx/paragon)
[![NPM downloads](https://img.shields.io/npm/dw/@openedx/paragon)](https://www.npmjs.com/package/@openedx/paragon)

## Purpose

Expand All @@ -30,13 +30,13 @@ Paragon components require React 16 or higher. To install Paragon into your proj
In terminal:

```
npm i --save @edx/paragon
npm i --save @openedx/paragon
```

In your React project:

```
import { ComponentName } from '@edx/paragon';
import { ComponentName } from '@openedx/paragon';
```

#### SCSS Foundation
Expand All @@ -47,7 +47,7 @@ Usage for Open edX and others:

```
// ... Any custom SCSS variables should be defined here
@import '~@edx/paragon/scss/core/core.scss';
@import '~@openedx/paragon/scss/core/core.scss';
```

Usage on with `@edx/brand`:
Expand All @@ -57,7 +57,7 @@ Usage on with `@edx/brand`:
```
@import '~@edx/brand/paragon/fonts.scss';
@import '~@edx/brand/paragon/variables.scss';
@import '~@edx/paragon/scss/core/core.scss';
@import '~@openedx/paragon/scss/core/core.scss';
@import '~@edx/brand/paragon/overrides.scss';
```

Expand All @@ -81,7 +81,7 @@ Due to Paragon's dependence on ``react-intl``, that means that your whole app ne

```javascript
import { IntlProvider } from 'react-intl';
import { messages as paragonMessages } from '@edx/paragon';
import { messages as paragonMessages } from '@openedx/paragon';

ReactDOM.render(
<IntlProvider locale={usersLocale} messages={paragonMessages[usersLocale]}>
Expand All @@ -96,7 +96,7 @@ Note that if you are using ``@edx/frontend-platform``'s ``AppProvider`` componen
```javascript
import { APP_READY, subscribe, initialize } from '@edx/frontend-platform';
import { AppProvider } from '@edx/frontend-platform/react';
import { messages as paragonMessages } from '@edx/paragon';
import { messages as paragonMessages } from '@openedx/paragon';
import App from './App';
// this is your app's i18n messages
import appMessages from './i18n';
Expand Down Expand Up @@ -148,17 +148,17 @@ module.exports = {
dist: The sub-directory of the source code where it puts its build artifact. Often "dist".
*/
localModules: [
{ moduleName: '@edx/paragon/scss/core', dir: '../src/paragon', dist: 'scss/core' },
{ moduleName: '@edx/paragon/icons', dir: '../src/paragon', dist: 'icons' },
{ moduleName: '@openedx/paragon/scss/core', dir: '../src/paragon', dist: 'scss/core' },
{ moduleName: '@openedx/paragon/icons', dir: '../src/paragon', dist: 'icons' },
// Note that using dist: 'dist' will require you to run 'npm build' in Paragon
// to add local changes to the 'dist' directory, so that they can be picked up by the MFE.
// To avoid doing that you can use dist: 'src' to get any local changes hot reloaded on save in the MFE.
{ moduleName: '@edx/paragon', dir: '../src/paragon', dist: 'dist' },
{ moduleName: '@openedx/paragon', dir: '../src/paragon', dist: 'dist' },
],
};
```

Then, when importing Paragon's core SCSS in your MFE the import needs to begin with a tilde `~` so that path to your local Paragon repository gets resolved correctly: `@import "~@edx/paragon/scss/core";`
Then, when importing Paragon's core SCSS in your MFE the import needs to begin with a tilde `~` so that path to your local Paragon repository gets resolved correctly: `@import "~@openedx/paragon/scss/core";`

#### Internationalization

Expand Down Expand Up @@ -227,7 +227,8 @@ When developing a new component you should generally follow three rules:
variant="primary"
/>
)

}

export default MyFunctionComponent;
```

Expand Down Expand Up @@ -475,4 +476,4 @@ The assigned maintainers for this component and other project details may be fou
## Reporting Security Issues
Please do not report security issues in public. Please email security@openedx.org.

We tend to prioritize security issues which impact the published `@edx/paragon` NPM library more so than the [documentation website](https://paragon-openedx.netlify.app/) or example React application.
We tend to prioritize security issues which impact the published `@openedx/paragon` NPM library more so than the [documentation website](https://paragon-openedx.netlify.app/) or example React application.
5 changes: 5 additions & 0 deletions algolia-docsearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Paragon | Algolia DocSearch

This module contains the Algolia DocSearch crawler configuration (i.e., ``crawler-config.js``) that controls the behavior of the Algolia site crawler responsible for indexing content from the Paragon documentation website to the Algolia index.

Any revisions to the configuration in this module must also be persisted upstream in the Algolia DocSearch crawler configuration.
136 changes: 136 additions & 0 deletions algolia-docsearch/crawler-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/* eslint-disable */

// README: When updating the Algolia DocSearch crawler configuration here, it will also need to be updated
// in the Algolia DocSearch crawler editor (https://crawler.algolia.com/). Otherwise, changes to this persisted
// configuration will not actually apply to the Paragon documentation website as intended.

// Note: there are REDACTED Algolia `appId` and `apiKey` values below; these should not be committed to the repository
// but should be included in the crawler configuration in the Algolia DocSearch crawler editor.

new Crawler({
rateLimit: 8,
startUrls: ["https://paragon-openedx.netlify.app/"],
renderJavaScript: false,
sitemaps: [],
ignoreCanonicalTo: false,
discoveryPatterns: ["https://paragon-openedx.netlify.app/**"],
schedule: "every 1 day",
actions: [
{
indexName: "paragon-openedx",
pathsToMatch: [
"https://paragon-openedx.netlify.app/**",
"!https://paragon-openedx.netlify.app/insights/",
"!https://paragon-openedx.netlify.app/status/",
"!https://paragon-openedx.netlify.app/changelog/",
],
recordExtractor: ({ helpers, url, $ }) => {
const category = url.pathname.split("/")[1] || "Documentation";
return helpers.docsearch({
recordProps: {
// lvl1: ["header h1", "article h1", "main h1", "h1", "head > title"],
lvl1: ["main h1"],
lvl0: {
selectors: "",
defaultValue:
category.charAt(0).toUpperCase() + category.slice(1),
},
lvl2: ["main h2"],
lvl3: ["article h3", "main h3", "h3"],
lvl4: ["article h4", "main h4", "h4"],
lvl5: ["article h5", "main h5", "h5"],
lvl6: ["article h6", "main h6", "h6"],
content: ["article p, article li", "main p, main li", "p, li"],
},
aggregateContent: true,
});
},
},
],
initialIndexSettings: {
"paragon-openedx": {
attributesForFaceting: ["type", "lang"],
attributesToRetrieve: [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type",
],
attributesToHighlight: ["hierarchy", "hierarchy_camel", "content"],
attributesToSnippet: ["content:10"],
camelCaseAttributes: ["hierarchy", "hierarchy_radio", "content"],
searchableAttributes: [
"unordered(hierarchy_radio_camel.lvl0)",
"unordered(hierarchy_radio.lvl0)",
"unordered(hierarchy_radio_camel.lvl1)",
"unordered(hierarchy_radio.lvl1)",
"unordered(hierarchy_radio_camel.lvl2)",
"unordered(hierarchy_radio.lvl2)",
"unordered(hierarchy_radio_camel.lvl3)",
"unordered(hierarchy_radio.lvl3)",
"unordered(hierarchy_radio_camel.lvl4)",
"unordered(hierarchy_radio.lvl4)",
"unordered(hierarchy_radio_camel.lvl5)",
"unordered(hierarchy_radio.lvl5)",
"unordered(hierarchy_radio_camel.lvl6)",
"unordered(hierarchy_radio.lvl6)",
"unordered(hierarchy_camel.lvl0)",
"unordered(hierarchy.lvl0)",
"unordered(hierarchy_camel.lvl1)",
"unordered(hierarchy.lvl1)",
"unordered(hierarchy_camel.lvl2)",
"unordered(hierarchy.lvl2)",
"unordered(hierarchy_camel.lvl3)",
"unordered(hierarchy.lvl3)",
"unordered(hierarchy_camel.lvl4)",
"unordered(hierarchy.lvl4)",
"unordered(hierarchy_camel.lvl5)",
"unordered(hierarchy.lvl5)",
"unordered(hierarchy_camel.lvl6)",
"unordered(hierarchy.lvl6)",
"content",
],
distinct: true,
attributeForDistinct: "url",
customRanking: [
"desc(weight.pageRank)",
"desc(weight.level)",
"asc(weight.position)",
],
ranking: [
"words",
"filters",
"typo",
"attribute",
"proximity",
"exact",
"custom",
],
highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
highlightPostTag: "</span>",
minWordSizefor1Typo: 3,
minWordSizefor2Typos: 7,
allowTyposOnNumericTokens: false,
minProximity: 1,
ignorePlurals: true,
advancedSyntax: true,
attributeCriteriaComputedByMinProximity: true,
removeWordsIfNoResults: "allOptional",
},
},
appId: "", // REDACTED
apiKey: "", // REDACTED
extraUrls: [
"https://paragon-openedx.netlify.app/foundations/colors",
"https://paragon-openedx.netlify.app/foundations/elevation",
"https://paragon-openedx.netlify.app/foundations/typography",
"https://paragon-openedx.netlify.app/foundations/css-utilities",
"https://paragon-openedx.netlify.app/foundations/responsive",
"https://paragon-openedx.netlify.app/foundations/brand-icons",
"https://paragon-openedx.netlify.app/guides/installation-and-usage",
"https://paragon-openedx.netlify.app/tools/component-generator",
"https://paragon-openedx.netlify.app/playground",
],
});
12 changes: 12 additions & 0 deletions bin/paragon-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const chalk = require('chalk');
const themeCommand = require('../lib/install-theme');
const helpCommand = require('../lib/help');
const versionCommand = require('../lib/version');
const migrateToOpenEdxScopeCommand = require('../lib/migrate-to-openedx-scope');

const HELP_COMMAND = 'help';
const commandAliases = {
Expand Down Expand Up @@ -48,6 +49,17 @@ const COMMANDS = {
},
],
},
'migrate-to-openedx-scope': {
executor: migrateToOpenEdxScopeCommand,
description: 'CLI for migrate from "@edx/paragon" to "@openedx/paragon".',
parameters: [
{
name: 'path',
description: 'Path to the directory where to replace Paragon package name, default to root of the repository',
required: false,
},
],
},
help: {
executor: helpCommand,
description: 'Displays help for available commands.',
Expand Down
2 changes: 1 addition & 1 deletion catalog-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ metadata:
- url: "https://github.com/openedx/paragon/releases"
title: "GitHub Releases"
icon: "Source"
- url: "https://www.npmjs.com/package/@edx/paragon"
- url: "https://www.npmjs.com/package/@openedx/paragon"
title: "NPM"
icon: "Terminal"
annotations:
Expand Down
2 changes: 1 addition & 1 deletion component-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.27.2",
"axios": "^0.28.0",
"commander": "^9.3.0",
"dotenv": "^16.0.0"
},
Expand Down
Loading
Loading