@usemotif/compiler-metro 1.2.3 → 1.4.0
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/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["motifBabelPlugin"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["motifBabelPlugin"],"mappings":";;;;;;;;;;;AAqCA,IAAM,UAAA,GAAa,CAAC,OAAA,GAA6B,EAAC,KAA6C;AAC7F,EAAA,MAAM,EAAE,MAAA,GAAS,QAAA,EAAU,GAAG,MAAK,GAAI,OAAA;AACvC,EAAA,OAAO,CAACA,iCAAA,EAAkB,EAAE,GAAG,IAAA,EAAM,QAAoC,CAAA;AAC3E,CAAA;AAEA,IAAO,aAAA,GAAQ;AACR,IAAM,YAAA,GAAe","file":"index.cjs","sourcesContent":["import motifBabelPlugin, { type MotifBabelOptions } from '@usemotif/compiler-babel';\n\n/**\n * The shape of a Babel plugin entry the way Metro / babel-preset-expo\n * expect: a tuple of `[plugin, options]`. Metro consumes this from the\n * project's `babel.config.js` so the motif transform layers into the\n * existing JS pipeline (no separate Metro transformer needed; Metro\n * already runs Babel for every file).\n *\n * Usage in a React Native / Expo project's `babel.config.js`:\n *\n * ```js\n * const motif = require('@usemotif/compiler-metro').default;\n * module.exports = function (api) {\n * api.cache(true);\n * return {\n * presets: ['babel-preset-expo'],\n * plugins: [motif({ target: 'native' })],\n * };\n * };\n * ```\n *\n * Conceptually this is just a renamed re-export of\n * `@usemotif/compiler-babel` with the `target` defaulted to `'native'`,\n * since that's what RN consumers always want. Keeping it as its own\n * package gives us a place to add Metro-specific configuration plumbing\n * later (CSS extraction is a no-op on native, but a per-file\n * `StyleSheet.create({...})` hoister will land here).\n */\n// `cssLayer` is omitted alongside `target`: cascade layers are a CSS-only\n// mechanism and this plugin always compiles for native, which has no cascade\n// for a layer to order against.\nexport interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target' | 'cssLayer'> {\n /** Target. Defaults to `'native'`. Override only when sharing config. */\n readonly target?: 'web' | 'native';\n}\n\nconst motifMetro = (options: MotifMetroOptions = {}): readonly [unknown, MotifBabelOptions] => {\n const { target = 'native', ...rest } = options;\n return [motifBabelPlugin, { ...rest, target } satisfies MotifBabelOptions];\n};\n\nexport default motifMetro;\nexport const PACKAGE_NAME = '@usemotif/compiler-metro';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -27,7 +27,7 @@ import { MotifBabelOptions } from '@usemotif/compiler-babel';
|
|
|
27
27
|
* later (CSS extraction is a no-op on native, but a per-file
|
|
28
28
|
* `StyleSheet.create({...})` hoister will land here).
|
|
29
29
|
*/
|
|
30
|
-
interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target'> {
|
|
30
|
+
interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target' | 'cssLayer'> {
|
|
31
31
|
/** Target. Defaults to `'native'`. Override only when sharing config. */
|
|
32
32
|
readonly target?: 'web' | 'native';
|
|
33
33
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { MotifBabelOptions } from '@usemotif/compiler-babel';
|
|
|
27
27
|
* later (CSS extraction is a no-op on native, but a per-file
|
|
28
28
|
* `StyleSheet.create({...})` hoister will land here).
|
|
29
29
|
*/
|
|
30
|
-
interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target'> {
|
|
30
|
+
interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target' | 'cssLayer'> {
|
|
31
31
|
/** Target. Defaults to `'native'`. Override only when sharing config. */
|
|
32
32
|
readonly target?: 'web' | 'native';
|
|
33
33
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAqCA,IAAM,UAAA,GAAa,CAAC,OAAA,GAA6B,EAAC,KAA6C;AAC7F,EAAA,MAAM,EAAE,MAAA,GAAS,QAAA,EAAU,GAAG,MAAK,GAAI,OAAA;AACvC,EAAA,OAAO,CAAC,gBAAA,EAAkB,EAAE,GAAG,IAAA,EAAM,QAAoC,CAAA;AAC3E,CAAA;AAEA,IAAO,aAAA,GAAQ;AACR,IAAM,YAAA,GAAe","file":"index.js","sourcesContent":["import motifBabelPlugin, { type MotifBabelOptions } from '@usemotif/compiler-babel';\n\n/**\n * The shape of a Babel plugin entry the way Metro / babel-preset-expo\n * expect: a tuple of `[plugin, options]`. Metro consumes this from the\n * project's `babel.config.js` so the motif transform layers into the\n * existing JS pipeline (no separate Metro transformer needed; Metro\n * already runs Babel for every file).\n *\n * Usage in a React Native / Expo project's `babel.config.js`:\n *\n * ```js\n * const motif = require('@usemotif/compiler-metro').default;\n * module.exports = function (api) {\n * api.cache(true);\n * return {\n * presets: ['babel-preset-expo'],\n * plugins: [motif({ target: 'native' })],\n * };\n * };\n * ```\n *\n * Conceptually this is just a renamed re-export of\n * `@usemotif/compiler-babel` with the `target` defaulted to `'native'`,\n * since that's what RN consumers always want. Keeping it as its own\n * package gives us a place to add Metro-specific configuration plumbing\n * later (CSS extraction is a no-op on native, but a per-file\n * `StyleSheet.create({...})` hoister will land here).\n */\n// `cssLayer` is omitted alongside `target`: cascade layers are a CSS-only\n// mechanism and this plugin always compiles for native, which has no cascade\n// for a layer to order against.\nexport interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target' | 'cssLayer'> {\n /** Target. Defaults to `'native'`. Override only when sharing config. */\n readonly target?: 'web' | 'native';\n}\n\nconst motifMetro = (options: MotifMetroOptions = {}): readonly [unknown, MotifBabelOptions] => {\n const { target = 'native', ...rest } = options;\n return [motifBabelPlugin, { ...rest, target } satisfies MotifBabelOptions];\n};\n\nexport default motifMetro;\nexport const PACKAGE_NAME = '@usemotif/compiler-metro';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usemotif/compiler-metro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Metro transformer for motif-js static style extraction in React Native.",
|
|
5
5
|
"homepage": "https://github.com/foo-stack/usemotif/tree/main/packages/compiler-metro#readme",
|
|
6
6
|
"bugs": "https://github.com/foo-stack/usemotif/issues",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/core": "^7.29.0",
|
|
44
|
-
"@usemotif/compiler-babel": "
|
|
44
|
+
"@usemotif/compiler-babel": "1.4.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/babel__core": "^7.20.5",
|
package/src/index.ts
CHANGED
|
@@ -27,7 +27,10 @@ import motifBabelPlugin, { type MotifBabelOptions } from '@usemotif/compiler-bab
|
|
|
27
27
|
* later (CSS extraction is a no-op on native, but a per-file
|
|
28
28
|
* `StyleSheet.create({...})` hoister will land here).
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
// `cssLayer` is omitted alongside `target`: cascade layers are a CSS-only
|
|
31
|
+
// mechanism and this plugin always compiles for native, which has no cascade
|
|
32
|
+
// for a layer to order against.
|
|
33
|
+
export interface MotifMetroOptions extends Omit<MotifBabelOptions, 'target' | 'cssLayer'> {
|
|
31
34
|
/** Target. Defaults to `'native'`. Override only when sharing config. */
|
|
32
35
|
readonly target?: 'web' | 'native';
|
|
33
36
|
}
|