Skip to content

Commit

Permalink
fix: type module (#333)
Browse files Browse the repository at this point in the history
* fix: add `type: module` field to the package.json to fix custom esm imports

* chore: readme typo

* chore: simplify shipjs configs

* chore(readme): add index.js ending to the imports
  • Loading branch information
nd0ut authored Jul 8, 2022
1 parent 60137e2 commit a0bce27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 63 deletions.
32 changes: 1 addition & 31 deletions .github/workflows/shipjs-manual-prepare.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@

name: Ship js Manual Prepare
on:
issue_comment:
types: [created]
on: workflow_dispatch
jobs:
manual_prepare:
if: |
github.event_name == 'issue_comment' &&
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
startsWith(github.event.comment.body, '@shipjs prepare')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -26,26 +19,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

create_done_comment:
if: success()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment "@${{ github.actor }} `shipjs prepare` done"

create_fail_comment:
if: cancelled() || failure()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment "@${{ github.actor }} `shipjs prepare` fail"

24 changes: 0 additions & 24 deletions .github/workflows/shipjs-schedule-prepare.yml

This file was deleted.

11 changes: 6 additions & 5 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

name: Ship js trigger
on:
push:
branches:
- master
pull_request:
types:
- closed
jobs:
build:
name: Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: "https://registry.npmjs.org"
node-version: '16'
- run: npm ci
- run: npm test
- run: npm run release:trigger
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ You can refer to our [integration guide][react-guide] for more details.
By default, npm and other package managers import the full (all locales) CommonJS or ESM bundle.

To reduce your bundle size, you can also import one of the following:
* The english-only bundle (saves ~27% in bundle size) as `@uploadcare/react-widget/en`
* The minified all-locales bundle (saves ~44% in bundle size) as `@uploadcare/react-widget/min`
* The minified english-only bundle (saves ~60% in bundle size) as `@uploadcare/react-widget/en-min/`
* The english-only bundle (saves ~27% in bundle size) as `@uploadcare/react-widget/en/index.js`
* The minified all-locales bundle (saves ~44% in bundle size) as `@uploadcare/react-widget/min/index.js`
* The minified english-only bundle (saves ~60% in bundle size) as `@uploadcare/react-widget/en-min/index.js`

## Configuration

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@uploadcare/react-widget",
"version": "2.1.2",
"description": "React component for Uploadcare Widget",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit a0bce27

Please sign in to comment.