-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/docs/storybook/webpa…
…ck-5.94.0
- Loading branch information
Showing
250 changed files
with
5,523 additions
and
4,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/primitives': major | ||
--- | ||
|
||
turn into esm module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/primitives': minor | ||
--- | ||
|
||
rm peerDep & unused dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/primitives': patch | ||
--- | ||
|
||
Fixes for colorblind themes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/primitives': major | ||
--- | ||
|
||
update to SDv4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/primitives': minor | ||
--- | ||
|
||
Adds src to dist as "build" so that primer/brand can use it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+10 Bytes
(100%)
...l-color-swatches-dark-high-contrast-button-invisible-fgColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...color-swatches-dark-high-contrast-button-invisible-iconColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...ll-color-swatches-dark-high-contrast-control-checked-bgColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+15 Bytes
(100%)
...olor-swatches-dark-high-contrast-control-checked-borderColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...rybook-all-color-swatches-dark-high-contrast-control-fgColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...k-all-color-swatches-dark-high-contrast-controlTrack-bgColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+15 Bytes
(100%)
...l-color-swatches-dark-high-contrast-controlTrack-borderColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...hots/storybook-all-color-swatches-dark-high-contrast-fgColor-disabled-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Testing primitives using a feature flag | ||
|
||
## 1. Create a PR | ||
|
||
Start by creating a PR in `primer/primitives`. Once all the tests are passing you are ready to move on. | ||
|
||
You will needs the pre-release version later in the process. So copy the version number from the `Published @primer/primitives` job. This is something like `0.0.0-20241007214729`. | ||
|
||
## 2. Create the feature flag | ||
|
||
To create the feature flag, you need to log into the [DevPortal](https://devportal.githubapp.com/feature-flags) and navigate to the [feature flags](https://devportal.githubapp.com/feature-flags) section. | ||
|
||
Click on the `New feature flag` button and fill in the required information. | ||
|
||
**Important:** Make sure to choose a descriptive name that is easy to understand. You **CANNOT** change the name. | ||
|
||
Confirm with the `Save feature` button. | ||
|
||
## 3. Add yourself to the feature flag | ||
|
||
You should first add yourself to the feature flag and test that everything is working. Afterwards you can add others. | ||
|
||
To do so, open the feature flag and navigate to the `Targeting rules` tab. | ||
Now click the `Switch to another stamp` dropdown and select `ditcom`. | ||
Under `Actors` add yourself. | ||
|
||
## 4. Create a PR in `github/github` | ||
|
||
Now it is time to create a PR in `github/github` to add your feature for all users that have the feature flag active. | ||
|
||
This requires a few changes: | ||
|
||
### Preload the feature flag | ||
|
||
You need to add your feature flag to `app/controllers/application_controller/preload_feature_flags_dependency.rb`: | ||
|
||
``` | ||
:primitives_my_feature_flag # a comment describing what the feature flag does | ||
``` | ||
|
||
### Install your pre-release | ||
|
||
In `github/github` dependencies are installed in workspaces. Primitives are part of the `@npm-workspaces/primer` workspace. | ||
Additionally, since the stable version of primitives is already installed, you need to install your version with an [npm alias](https://docs.npmjs.com/cli/v8/commands/npm-install#:~:text=npm%20install%20%3Calias%3E%40npm%3A%3Cname%3E%3A). | ||
|
||
For example: | ||
|
||
```bash | ||
npm i @primer/primitives-my-feature-flag@npm:@primer/primitives@0.0.0-20241007214729 --workspace=@npm-workspaces/primer | ||
``` | ||
|
||
**NOTE:** This package needs to be checked into git. On dotcom all packages are added in git. | ||
|
||
### Create a new bundle (optional) | ||
|
||
If you want to load some new tokens you can add a new bundle and load it for users who have the feature flags enabled. | ||
|
||
To do so, first create a new bundle by creating a new folder in `app/assets/stylesheets/bundles/` for example `primer-primitives-your-bundle`. | ||
In this folder add an `index.scss` file that includes all files you want to load: | ||
|
||
```scss | ||
@import '@primer/primitives-my-feature-flag/dist/css/functional/themes/new-theme.css'; | ||
``` | ||
|
||
You now need to load your css bundle if the feature flag is active by placing the code below in all nessesary places, for example `app/views/layouts/application.html.erb`. | ||
|
||
```ruby | ||
# this bundle (index.scss in the folder) will only be loaded if the users has the primitives_my_feature_flag feature flag enabled | ||
<%= stylesheet_bundle "primer-primitives-your-bundle" if user_feature_enabled?(:primitives_my_feature_flag) %> | ||
``` | ||
Now you need to generate the `SERVICEOWNERS` and `CODEOWNERS` by running `bin/generate-service-files.rb` in the console or by running it as a task in vs code. | ||
It should add a line like this to the `SERVICEOWNERS`: | ||
``` | ||
app/assets/stylesheets/bundles/primer-primitives-your-bundle/ :primer_dotcom | ||
``` | ||
And a line like this to the `CODEOWNERS`: | ||
``` | ||
/app/assets/stylesheets/bundles/primer-primitives-your-bundle/ @github/primer-reviewers | ||
``` |
Oops, something went wrong.