@hanzogui/metro-plugin 8.3.1 → 8.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +47 -43
- package/dist/cjs/index.js.map +1 -6
- package/dist/cjs/package.json +1 -0
- package/dist/esm/index.js +45 -24
- package/dist/esm/index.js.map +1 -1
- package/package.json +23 -5
- package/dist/esm/index.mjs +0 -25
- package/dist/esm/index.mjs.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
module.exports =
|
|
23
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withGui = withGui;
|
|
4
|
+
const static_1 = require("@hanzogui/static");
|
|
5
|
+
/**
|
|
6
|
+
* Configure Metro for Gui.
|
|
7
|
+
*
|
|
8
|
+
* This is now a simplified wrapper that just ensures CSS is enabled and
|
|
9
|
+
* loads your Gui config. For CSS generation, use the CLI:
|
|
10
|
+
*
|
|
11
|
+
* 1. Create a `hanzogui.build.ts` with `outputCSS` option
|
|
12
|
+
* 2. Run `hanzogui generate` before your build
|
|
13
|
+
* 3. Import the generated CSS in your app's layout
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```js
|
|
17
|
+
* // metro.config.js
|
|
18
|
+
* const { getDefaultConfig } = require('expo/metro-config')
|
|
19
|
+
* const { withGui } = require('@hanzogui/metro-plugin')
|
|
20
|
+
*
|
|
21
|
+
* const config = getDefaultConfig(__dirname, { isCSSEnabled: true })
|
|
22
|
+
* module.exports = withGui(config, {
|
|
23
|
+
* components: ['@hanzo/gui'],
|
|
24
|
+
* config: './hanzogui.config.ts',
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
24
28
|
function withGui(metroConfig, optionsIn) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
const { cssInterop, ...hanzoguiOptionsIn } = optionsIn || {};
|
|
30
|
+
if (cssInterop) {
|
|
31
|
+
console.warn('[@hanzogui/metro-plugin] cssInterop option is deprecated. Use `hanzogui generate` to pre-generate CSS instead.');
|
|
32
|
+
}
|
|
33
|
+
const options = {
|
|
34
|
+
...hanzoguiOptionsIn,
|
|
35
|
+
...(0, static_1.loadGuiBuildConfigSync)(hanzoguiOptionsIn),
|
|
36
|
+
};
|
|
37
|
+
// Ensure CSS files can be resolved
|
|
38
|
+
metroConfig.resolver = {
|
|
39
|
+
...metroConfig.resolver,
|
|
40
|
+
sourceExts: [...new Set([...(metroConfig.resolver?.sourceExts || []), 'css'])],
|
|
41
|
+
};
|
|
42
|
+
// Store hanzogui options for potential use by other tools
|
|
43
|
+
metroConfig.transformer = {
|
|
44
|
+
...metroConfig.transformer,
|
|
45
|
+
hanzogui: options,
|
|
46
|
+
};
|
|
47
|
+
return metroConfig;
|
|
44
48
|
}
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;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CAAA;IAED,0DAA0D;IAC1D,WAAW,CAAC,WAAW,GAAG;QACxB,GAAG,WAAW,CAAC,WAAW;QAC1B,QAAQ,EAAE,OAAO;KAClB,CAAA;IAED,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
package/dist/esm/index.js
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
import { loadGuiBuildConfigSync } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { loadGuiBuildConfigSync } from '@hanzogui/static';
|
|
2
|
+
/**
|
|
3
|
+
* Configure Metro for Gui.
|
|
4
|
+
*
|
|
5
|
+
* This is now a simplified wrapper that just ensures CSS is enabled and
|
|
6
|
+
* loads your Gui config. For CSS generation, use the CLI:
|
|
7
|
+
*
|
|
8
|
+
* 1. Create a `hanzogui.build.ts` with `outputCSS` option
|
|
9
|
+
* 2. Run `hanzogui generate` before your build
|
|
10
|
+
* 3. Import the generated CSS in your app's layout
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```js
|
|
14
|
+
* // metro.config.js
|
|
15
|
+
* const { getDefaultConfig } = require('expo/metro-config')
|
|
16
|
+
* const { withGui } = require('@hanzogui/metro-plugin')
|
|
17
|
+
*
|
|
18
|
+
* const config = getDefaultConfig(__dirname, { isCSSEnabled: true })
|
|
19
|
+
* module.exports = withGui(config, {
|
|
20
|
+
* components: ['@hanzo/gui'],
|
|
21
|
+
* config: './hanzogui.config.ts',
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function withGui(metroConfig, optionsIn) {
|
|
26
|
+
const { cssInterop, ...hanzoguiOptionsIn } = optionsIn || {};
|
|
27
|
+
if (cssInterop) {
|
|
28
|
+
console.warn('[@hanzogui/metro-plugin] cssInterop option is deprecated. Use `hanzogui generate` to pre-generate CSS instead.');
|
|
29
|
+
}
|
|
30
|
+
const options = {
|
|
31
|
+
...hanzoguiOptionsIn,
|
|
32
|
+
...loadGuiBuildConfigSync(hanzoguiOptionsIn),
|
|
33
|
+
};
|
|
34
|
+
// Ensure CSS files can be resolved
|
|
35
|
+
metroConfig.resolver = {
|
|
36
|
+
...metroConfig.resolver,
|
|
37
|
+
sourceExts: [...new Set([...(metroConfig.resolver?.sourceExts || []), 'css'])],
|
|
38
|
+
};
|
|
39
|
+
// Store hanzogui options for potential use by other tools
|
|
40
|
+
metroConfig.transformer = {
|
|
41
|
+
...metroConfig.transformer,
|
|
42
|
+
hanzogui: options,
|
|
43
|
+
};
|
|
44
|
+
return metroConfig;
|
|
23
45
|
}
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAmB,MAAM,kBAAkB,CAAA;AAiB1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,OAAO,CACrB,WAA6B,EAC7B,SAA2B;IAE3B,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,EAAE,GAAG,SAAS,IAAI,EAAE,CAAA;IAE5D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CACV,gHAAgH,CACjH,CAAA;IACH,CAAC;IAED,MAAM,OAAO,GAAG;QACd,GAAG,iBAAiB;QACpB,GAAG,sBAAsB,CAAC,iBAAiB,CAAC;KAC7C,CAAA;IAED,mCAAmC;IACnC,WAAW,CAAC,QAAQ,GAAG;QACrB,GAAI,WAAW,CAAC,QAAgB;QAChC,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;KAC/E,CAAA;IAED,0DAA0D;IAC1D,WAAW,CAAC,WAAW,GAAG;QACxB,GAAG,WAAW,CAAC,WAAW;QAC1B,QAAQ,EAAE,OAAO;KAClB,CAAA;IAED,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/metro-plugin",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -8,9 +8,22 @@
|
|
|
8
8
|
"types",
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/cjs/index.js",
|
|
13
|
+
"module": "./dist/esm/index.js",
|
|
13
14
|
"types": "./types/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"react-native": "./dist/esm/index.js",
|
|
20
|
+
"browser": "./dist/esm/index.js",
|
|
21
|
+
"module": "./dist/esm/index.js",
|
|
22
|
+
"import": "./dist/esm/index.js",
|
|
23
|
+
"require": "./dist/cjs/index.js",
|
|
24
|
+
"default": "./dist/esm/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
14
27
|
"publishConfig": {
|
|
15
28
|
"access": "public"
|
|
16
29
|
},
|
|
@@ -21,9 +34,14 @@
|
|
|
21
34
|
"clean:build": "hanzogui-build clean:build"
|
|
22
35
|
},
|
|
23
36
|
"dependencies": {
|
|
24
|
-
"@hanzogui/static": "8.3.
|
|
37
|
+
"@hanzogui/static": "8.3.2"
|
|
25
38
|
},
|
|
26
39
|
"devDependencies": {
|
|
27
|
-
"@hanzogui/build": "8.3.
|
|
40
|
+
"@hanzogui/build": "8.3.2"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/hanzoai/gui.git",
|
|
45
|
+
"directory": "pkgs/compiler/metro-plugin"
|
|
28
46
|
}
|
|
29
47
|
}
|
package/dist/esm/index.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { loadGuiBuildConfigSync } from "@hanzogui/static";
|
|
2
|
-
function withGui(metroConfig, optionsIn) {
|
|
3
|
-
const {
|
|
4
|
-
cssInterop,
|
|
5
|
-
...hanzoguiOptionsIn
|
|
6
|
-
} = optionsIn || {};
|
|
7
|
-
if (cssInterop) {
|
|
8
|
-
console.warn("[@hanzogui/metro-plugin] cssInterop option is deprecated. Use `hanzogui generate` to pre-generate CSS instead.");
|
|
9
|
-
}
|
|
10
|
-
const options = {
|
|
11
|
-
...hanzoguiOptionsIn,
|
|
12
|
-
...loadGuiBuildConfigSync(hanzoguiOptionsIn)
|
|
13
|
-
};
|
|
14
|
-
metroConfig.resolver = {
|
|
15
|
-
...metroConfig.resolver,
|
|
16
|
-
sourceExts: [... /* @__PURE__ */new Set([...(metroConfig.resolver?.sourceExts || []), "css"])]
|
|
17
|
-
};
|
|
18
|
-
metroConfig.transformer = {
|
|
19
|
-
...metroConfig.transformer,
|
|
20
|
-
hanzogui: options
|
|
21
|
-
};
|
|
22
|
-
return metroConfig;
|
|
23
|
-
}
|
|
24
|
-
export { withGui };
|
|
25
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["loadGuiBuildConfigSync","withGui","metroConfig","optionsIn","cssInterop","hanzoguiOptionsIn","console","warn","options","resolver","sourceExts","Set","transformer","hanzogui"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,sBAAA,QAA+C;AAwCjD,SAASC,QACdC,WAAA,EACAC,SAAA,EACkB;EAClB,MAAM;IAAEC,UAAA;IAAY,GAAGC;EAAkB,IAAIF,SAAA,IAAa,CAAC;EAE3D,IAAIC,UAAA,EAAY;IACdE,OAAA,CAAQC,IAAA,CACN,gHACF;EACF;EAEA,MAAMC,OAAA,GAAU;IACd,GAAGH,iBAAA;IACH,GAAGL,sBAAA,CAAuBK,iBAAiB;EAC7C;EAGAH,WAAA,CAAYO,QAAA,GAAW;IACrB,GAAIP,WAAA,CAAYO,QAAA;IAChBC,UAAA,EAAY,CAAC,IAAG,mBAAIC,GAAA,CAAI,CAAC,IAAIT,WAAA,CAAYO,QAAA,EAAUC,UAAA,IAAc,EAAC,GAAI,KAAK,CAAC,CAAC;EAC/E;EAGAR,WAAA,CAAYU,WAAA,GAAc;IACxB,GAAGV,WAAA,CAAYU,WAAA;IACfC,QAAA,EAAUL;EACZ;EAEA,OAAON,WAAA;AACT","ignoreList":[]}
|