Skip to content

Commit 6f62ada

Browse files
committed
x
1 parent 663d5dc commit 6f62ada

13 files changed

Lines changed: 2353 additions & 131 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
type: choice
8+
description: Semantic Version Type
9+
options:
10+
- major
11+
- minor
12+
- patch
13+
- no-version-update
14+
15+
pre_release:
16+
type: choice
17+
description: Pre Release?
18+
options:
19+
- stable
20+
- alpha
21+
- beta
22+
- rc
23+
24+
jobs:
25+
release-it:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: tibdex/github-app-token@v2
29+
id: generate-token
30+
with:
31+
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
32+
private_key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
33+
34+
- name: checkout
35+
uses: actions/checkout@v4
36+
with:
37+
token: ${{ steps.generate-token.outputs.token }}
38+
# we need everything so release-it can compare the current version with the latest tag
39+
fetch-depth: 0
40+
41+
- name: initialize mandatory git config
42+
run: |
43+
git config user.name "GitHub Release Bot"
44+
git config user.email release-bot@neolution.ch
45+
46+
- name: install yarn packages
47+
run: |
48+
yarn --frozen-lockfile
49+
50+
- name: set NPM Token
51+
run: |
52+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
53+
env:
54+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_NEOLUTION }}
55+
56+
- name: build
57+
run: yarn build
58+
59+
- name: run release-it
60+
run: |
61+
params=()
62+
63+
if [[ ${{ github.event.inputs.version_type }} != "no-version-update" ]]; then
64+
params+=(${{ github.event.inputs.version_type }})
65+
fi
66+
67+
if [[ ${{ github.event.inputs.pre_release }} != "stable" ]]; then
68+
params+=(--preRelease=${{ github.event.inputs.pre_release }})
69+
params+=(--plugins.@release-it/keep-a-changelog.keepUnreleased)
70+
params+=(--no-plugins.@release-it/keep-a-changelog.strictLatest)
71+
fi
72+
73+
params+=(--ci)
74+
75+
yarn release-it "${params[@]}"
76+
env:
77+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

.github/workflows/release-please.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.release-it.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"git": {
3+
"push": true
4+
},
5+
"npm": {
6+
"publish": true,
7+
"skipChecks": true
8+
},
9+
"github": {
10+
"release": true
11+
},
12+
"plugins": {
13+
"@release-it/keep-a-changelog": {
14+
"filename": "CHANGELOG.md",
15+
"addVersionUrl": true,
16+
"addUnreleased": true,
17+
"strictLatest": false
18+
}
19+
},
20+
"hooks": {
21+
"before:git:release": "yarn prettier --write CHANGELOG.md && git add CHANGELOG.md"
22+
}
23+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
export function Manager({ children }) {
3+
return (children);
4+
}
5+
6+
export const Popper = jest.fn(({ children, placement }) => {
7+
return children({
8+
ref: () => {},
9+
placement,
10+
style: {},
11+
arrowProps: { ref: () => {}, style: {} } });
12+
})
13+
14+
export function Reference({ children }) {
15+
return children({ ref: () => {} });
16+
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@
263263
"@popperjs/core": "^2.6.0",
264264
"classnames": "^2.2.3",
265265
"prop-types": "^15.5.8",
266-
"react-popper": "https://pkg.pr.new/manni497/react-popper@e2e836b",
266+
"@neolution-ch/react-popper": "3.0.1",
267267
"react-transition-group": "^4.4.5"
268268
},
269269
"peerDependencies": {
270-
"react": ">=16.8.0",
271-
"react-dom": ">=16.8.0"
270+
"react": "^18 || ^19",
271+
"react-dom": "^18 || ^19"
272272
},
273273
"devDependencies": {
274274
"@babel/cli": "^7.21.0",
@@ -280,6 +280,7 @@
280280
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
281281
"@babel/preset-env": "^7.20.2",
282282
"@babel/preset-react": "^7.12.10",
283+
"@release-it/keep-a-changelog": "^3.1.0",
283284
"@storybook/addon-essentials": "8.6.17",
284285
"@storybook/addon-links": "8.6.17",
285286
"@storybook/addon-mdx-gfm": "8.6.17",
@@ -323,6 +324,7 @@
323324
"react": "^19.2.4",
324325
"react-dom": "^19.2.4",
325326
"react-test-renderer": "^19.2.4",
327+
"release-it": "^15.10.3",
326328
"typescript": "^4.0.3",
327329
"webpack": "^4.43.0"
328330
}

src/Dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import React from 'react';
55
import PropTypes from 'prop-types';
6-
import { Manager } from 'react-popper';
6+
import { Manager } from '@neolution-ch/react-popper';
77
import classNames from 'classnames';
88
import { DropdownContext } from './DropdownContext';
99
import { mapToCssModules, omit, tagPropType } from './utils';

src/DropdownMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import ReactDOM from 'react-dom';
44
import classNames from 'classnames';
5-
import { Popper } from 'react-popper';
5+
import { Popper } from '@neolution-ch/react-popper';
66
import { DropdownContext } from './DropdownContext';
77
import {
88
mapToCssModules,
@@ -109,7 +109,7 @@ class DropdownMenu extends React.Component {
109109
};
110110

111111
const handleRef = (tagRef) => {
112-
// Send the ref to `react-popper`
112+
// Send the ref to `@neolution-ch/react-popper`
113113
ref(tagRef);
114114
// Send the ref to the parent Dropdown so that clicks outside
115115
// it will cause it to close

src/DropdownToggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4-
import { Reference } from 'react-popper';
4+
import { Reference } from '@neolution-ch/react-popper';
55
import { DropdownContext } from './DropdownContext';
66
import { mapToCssModules, tagPropType } from './utils';
77
import Button from './Button';

src/PopperContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import ReactDOM from 'react-dom';
44
import classNames from 'classnames';
5-
import { Popper as ReactPopper } from 'react-popper';
5+
import { Popper as ReactPopper } from '@neolution-ch/react-popper';
66
import {
77
getTarget,
88
targetPropType,

src/__tests__/DropdownMenu.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { screen } from '@testing-library/react';
3-
import { Popper } from 'react-popper';
3+
import { Popper } from '@neolution-ch/react-popper';
44
import '@testing-library/jest-dom';
55
import { DropdownMenu } from '..';
66
import { customDropdownRender } from '../testUtils';

0 commit comments

Comments
 (0)