-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from storybookjs/norbert/to-esm-tsup
upgrades & build using tsup
- Loading branch information
Showing
9 changed files
with
4,640 additions
and
2,947 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,28 @@ | ||
name: Release | ||
|
||
on: [push] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip release')" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare repository | ||
run: git fetch --unshallow --tags | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn release |
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 @@ | ||
v18 |
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
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import React from 'react'; | ||
|
||
interface ReactDecoratorProps { | ||
story: React.ReactNode; | ||
onMount: Function; | ||
onUnMount: Function; | ||
} | ||
|
||
class ReactDecorator extends React.Component<ReactDecoratorProps> { | ||
constructor(props: ReactDecoratorProps) { | ||
super(props); | ||
this.props.onMount(); | ||
} | ||
componentWillUnmount() { | ||
this.props.onUnMount(); | ||
} | ||
render() { | ||
return this.props.story; | ||
} | ||
} | ||
export default ReactDecorator; | ||
|
||
export function reactStory( | ||
story: ReactDecoratorProps['story'], | ||
onMount: ReactDecoratorProps['onMount'], | ||
onUnMount: ReactDecoratorProps['onUnMount'] | ||
) { | ||
return <ReactDecorator story={story} onMount={onMount} onUnMount={onUnMount} />; | ||
} |
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,22 @@ | ||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"esModuleInterop": true, | ||
"declaration": true, | ||
"moduleResolution": "Bundler", | ||
"importHelpers": true, | ||
"target": "ES2022", | ||
"module": "ES2022", | ||
"jsx": "react", | ||
"noImplicitAny": false, | ||
"useDefineForClassFields": false, | ||
"lib": [ | ||
"ES2022", | ||
"dom" | ||
] | ||
}, | ||
} |
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,13 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { defineConfig } from 'tsup'; | ||
|
||
export default defineConfig({ | ||
entry: ['./src/index.tsx'], | ||
format: ['cjs', 'esm'], | ||
sourcemap: false, | ||
target: 'chrome100', | ||
clean: true, | ||
// dts: false, | ||
dts: true, | ||
platform: 'neutral', | ||
}); |
Oops, something went wrong.