Move to 4 flavor build and tests

This commit is contained in:
Nick Gerleman
2022-12-23 00:43:57 -08:00
parent 4f233df064
commit 3352385fb0
15 changed files with 174 additions and 181 deletions

View File

@@ -8,7 +8,6 @@
* @format
*/
const CONSTANTS = require('./YGEnums');
import type {
Yoga$Edge,
@@ -238,7 +237,7 @@ type Yoga = {
...typeof CONSTANTS,
};
function wrapLib(lib: any): Yoga {
module.exports = function wrapLib(lib: any): Yoga {
function patch(prototype, name, fn) {
let original = prototype[name];
@@ -378,7 +377,3 @@ function wrapLib(lib: any): Yoga {
...CONSTANTS,
};
};
module.exports = (libPromise: any) => ({
initialize: () => libPromise.then(wrapLib)
}: YogaConstructor);

View File

@@ -0,0 +1,21 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
const wrapLib = require('./entry');
const loadYoga = require('./asmjs-async');
module.exports = {
load: () => {
return loadYoga().then(wrapLib);
}
}
export type * from './YGEnums.js';
export type * from './entry';

View File

@@ -8,10 +8,14 @@
* @format
*/
const entry = require('./entry');
const yoga = require('./wasm');
const wrapLib = require('./entry');
const loadYoga = require('./wasm-async');
module.exports = entry(yoga());
module.exports = {
load: () => {
return loadYoga().then(wrapLib);
}
}
export type * from './YGEnums.js';
export type * from './entry';

View File

@@ -0,0 +1,17 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
const wrapLib = require('./entry');
const loadYoga = require('./asmjs-sync');
module.exports = wrapLib(loadYoga());
export type * from './YGEnums.js';
export type * from './entry';

View File

@@ -8,10 +8,10 @@
* @format
*/
const entry = require('./entry');
const yoga = require('./asm');
const wrapLib = require('./entry');
const loadYoga = require('./wasm-sync');
module.exports = entry(yoga());
module.exports = wrapLib(loadYoga());
export type * from './YGEnums.js';
export type * from './entry';