Skip to content

Commit

Permalink
upgrade yoga-layout to latest version (#2105)
Browse files Browse the repository at this point in the history
* upgrade yoga-layout

* move fork to dev dependency

* remove duplicate

* use `yoga-wasm-web` pkg

* add changeset
  • Loading branch information
jeetiss authored Jan 28, 2023
1 parent 8724412 commit a14ca9e
Show file tree
Hide file tree
Showing 49 changed files with 87 additions and 21,170 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-horses-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/yoga': major
---

migrate from yoga-layout-prebuilt to yoga-wasm-web
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
],
"scripts": {
"prepare": "husky install",
"build": "lerna run build --ignore @react-pdf/yoga",
"build": "lerna run build",
"watch": "lerna run watch --parallel",
"bootstrap": "lerna bootstrap",
"prepublish": "lerna run build --ignore @react-pdf/yoga",
"prepublish": "lerna run build",
"lint": "eslint packages",
"test": "jest",
"examples": "lerna run start --scope @react-pdf/examples",
Expand Down
1 change: 0 additions & 1 deletion packages/yoga/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/yoga/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!dist
dist
1 change: 0 additions & 1 deletion packages/yoga/.npmrc

This file was deleted.

28 changes: 0 additions & 28 deletions packages/yoga/build.sh

This file was deleted.

4 changes: 2 additions & 2 deletions packages/yoga/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as yoga from 'yoga-layout';
import { YogaStatic } from 'yoga-wasm-web';

export = yoga;
export default YogaStatic;
4 changes: 4 additions & 0 deletions packages/yoga/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line import/no-unresolved
import initYoga from 'yoga-wasm-web/asm';

export default initYoga();
14 changes: 7 additions & 7 deletions packages/yoga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"author": "Diego Muracciole <[email protected]>",
"homepage": "https://github.com/diegomura/react-pdf#readme",
"main": "./src/dist/entry-browser.js",
"module": "./src/dist/entry-browser.es.js",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "index.d.ts",
"repository": {
"type": "git",
Expand All @@ -15,14 +15,14 @@
},
"scripts": {
"test": "jest",
"build": "./build.sh && rollup -c",
"postbuild": "node ./postbuild.js"
"build": "rollup -c"
},
"files": [
"src",
"dist",
"index.d.ts"
],
"dependencies": {
"@types/yoga-layout": "^1.9.3"
"dependencies": {},
"devDependencies": {
"yoga-wasm-web": "~0.3.0"
}
}
41 changes: 0 additions & 41 deletions packages/yoga/postbuild.js

This file was deleted.

30 changes: 16 additions & 14 deletions packages/yoga/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import commonjs from '@rollup/plugin-commonjs'

const input = './src/dist/entry-browser.js';

const getPlugins = () => [
commonjs(),
];
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';

export default {
input,
output: {
file: 'src/dist/entry-browser.es.js',
format: 'es',
},
plugins: getPlugins(),
}
input: 'index.js',
output: [
{
file: 'dist/index.js',
exports: 'auto',
format: 'cjs',
},
{
file: 'dist/index.esm.js',
format: 'esm',
},
],
plugins: [commonjs(), nodeResolve()],
};
Loading

0 comments on commit a14ca9e

Please sign in to comment.