Skip to content

Commit

Permalink
fix(api): distribution (#1582)
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <48618675+amrbashir@users.noreply.github.com>
  • Loading branch information
lucasfernog and amrbashir authored Apr 22, 2021
1 parent 7506a52 commit 7f998d0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changes/api-package-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"api": patch
---

Fixes distribution of the `@tauri-apps/api` package for older bundlers.
File renamed without changes.
File renamed without changes.
75 changes: 58 additions & 17 deletions tooling/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,71 @@
"name": "@tauri-apps/api",
"version": "1.0.0-beta-rc.2",
"description": "Tauri API definitions",
"main": "./index.js",
"typings": "./index.d.ts",
"type": "module",
"exports": {
".": "./index.js",
"./app": "./app.js",
"./cli": "./cli.js",
"./dialog": "./dialog.js",
"./event": "./event.js",
"./updater": "./updater.js",
"./fs": "./fs.js",
"./path": "./path.js",
"./http": "./http.js",
"./notification": "./notification.js",
"./tauri": "./tauri.js",
"./window": "./window.js",
"./shell": "./shell.js",
"./globalShortcut": "./globalShortcut.js"
".": {
"import": "./index.js",
"require": "./index.cjs"
},
"./app": {
"import": "./app.js",
"require": "./app.cjs"
},
"./cli": {
"import": "./cli.js",
"require": "./cli.cjs"
},
"./dialog": {
"import": "./dialog.js",
"require": "./dialog.cjs"
},
"./event": {
"import": "./event.js",
"require": "./event.cjs"
},
"./updater": {
"import": "./updater.js",
"require": "./updater.cjs"
},
"./fs": {
"import": "./fs.js",
"require": "./fs.cjs"
},
"./path": {
"import": "./path.js",
"require": "./path.cjs"
},
"./http": {
"import": "./http.js",
"require": "./http.cjs"
},
"./notification": {
"import": "./notification.js",
"require": "./notification.cjs"
},
"./window": {
"import": "./window.js",
"require": "./window.cjs"
},
"./shell": {
"import": "./shell.js",
"require": "./shell.cjs"
},
"./globalShortcut": {
"import": "./globalShortcut.js",
"require": "./globalShortcut.cjs"
},
"./tauri": {
"import": "./tauri.js",
"require": "./tauri.cjs"
}
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/tauri"
},
"scripts": {
"build": "rimraf ./dist && rollup -c --silent && copyfiles package.json LICENSE* CHANGELOG.md dist",
"build": "rimraf ./dist && rollup -c --silent && copyfiles -f package.json LICENSE* CHANGELOG.md src/*.ts dist && copyfiles -f src/helpers/*.ts dist/helpers",
"npm-pack": "yarn build && cd ./dist && npm pack",
"npm-publish": "yarn build && cd ./dist && yarn publish --access public --loglevel silly",
"lint": "eslint --ext ts \"./src/**/*.ts\"",
Expand Down
4 changes: 2 additions & 2 deletions tooling/api/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export default [
output: [
{
dir: 'dist/',
entryFileNames: '[name].js',
entryFileNames: '[name].cjs',
format: 'cjs',
exports: 'named',
globals: {}
},
{
dir: 'dist/',
entryFileNames: '[name].mjs',
entryFileNames: '[name].js',
format: 'esm',
exports: 'named',
globals: {}
Expand Down

0 comments on commit 7f998d0

Please sign in to comment.