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

upgrade yoga-layout to latest version #2105

Merged
merged 6 commits into from
Jan 28, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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