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

Migrate to dts-cli, type components better and export types #18

Merged
merged 1 commit into from Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Expand Up @@ -7,20 +7,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]
node: ['12.x', '14.x', '16.x']
os: [ubuntu-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Install deps
run: yarn install --ignore-engine

- name: Lint
run: yarn lint
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,48 @@
name: 'release'
on:
push:
tags-ignore:
- '*.*'
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint

- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Build
run: yarn build

- name: Publish to NPM
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
npm version patch
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
tags: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
2 changes: 1 addition & 1 deletion .github/workflows/size.yml
Expand Up @@ -6,7 +6,7 @@ jobs:
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions example/index.html
Expand Up @@ -9,6 +9,6 @@

<body>
<div id="root"></div>
<script src="./index.tsx"></script>
<script type="module" src="./index.tsx"></script>
</body>
</html>
</html>
7 changes: 3 additions & 4 deletions example/index.tsx
@@ -1,7 +1,7 @@
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Flex, Item } from '../.';
import { Flex, Item, Range } from '../.';
import myList from './example';

const App = () => (
Expand All @@ -12,8 +12,8 @@ const App = () => (
}}
>
<h1>Example</h1>
<Flex col={4} total={myList.length}>
{myList.map(({ columns }, i: number) => (
<Flex col={4}>
{myList.map(({ columns }: { columns: Range }, i: number) => (
<Item
key={i}
col={columns}
Expand All @@ -36,7 +36,6 @@ const App = () => (
</Item>
))}
</Flex>
<h2>Hello</h2>
</div>
);

Expand Down
9 changes: 5 additions & 4 deletions example/package.json
Expand Up @@ -4,8 +4,8 @@
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
"start": "vite",
"build": "vite build"
},
"dependencies": {
"react-app-polyfill": "^1.0.0"
Expand All @@ -18,7 +18,8 @@
"devDependencies": {
"@types/react": "^16.9.11",
"@types/react-dom": "^16.8.4",
"parcel": "^1.12.3",
"typescript": "^3.4.5"
"typescript": "^4",
"vite": "latest",
"vite-preset-react": "latest"
}
}
11 changes: 11 additions & 0 deletions example/vite.config.js
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import ReactPlugin from 'vite-preset-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
ReactPlugin({
injectReact: false,
}),
],
});