@tamagui/static 1.0.0-alpha.51 → 1.0.0-alpha.52

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.
@@ -33,12 +33,15 @@ function loadTamagui(props) {
33
33
  return loadedTamagui;
34
34
  }
35
35
  process.env.IS_STATIC = "is_static";
36
- const proxyWorm = require("react-native-web");
36
+ const rnw = require("react-native-web");
37
37
  const Mod = require("module");
38
38
  const og = Mod.prototype.require;
39
39
  Mod.prototype.require = function(path) {
40
+ if (path === "@gorhom/bottom-sheet") {
41
+ return {};
42
+ }
40
43
  if (path.startsWith("react-native") && !path.startsWith("react-native-web/dist/cjs/exports")) {
41
- return proxyWorm;
44
+ return rnw;
42
45
  }
43
46
  return og.apply(this, arguments);
44
47
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/extractor/loadTamagui.ts"],
4
- "sourcesContent": ["import { join } from 'path'\n\nimport type { StaticComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, StaticComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const proxyWorm = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return proxyWorm\n }\n return og.apply(this, arguments)\n }\n\n // import config\n const configPath = join(process.cwd(), props.config)\n const tamaguiConfigExport = require(configPath)\n const tamaguiConfig = (tamaguiConfigExport['default'] ||\n tamaguiConfigExport) as TamaguiInternalConfig\n\n // import components\n const components = {}\n for (const module of props.components) {\n const exported = require(module)\n Object.assign(components, exported)\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n return loadedTamagui\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAGrB,uBAA8B;AAE9B,IAAI,gBAAqB;AAElB,qBAAqB,OAG1B;AACA,MAAI,eAAe;AACjB,WAAO;AAAA;AAKT,UAAQ,IAAI,YAAY;AACxB,QAAM,YAAY,QAAQ;AAC1B,QAAM,MAAM,QAAQ;AACpB,QAAM,KAAK,IAAI,UAAU;AACzB,MAAI,UAAU,UAAU,SAAU,MAAc;AAC9C,QACE,KAAK,WAAW,mBAEhB,CAAC,KAAK,WAAW,sCACjB;AACA,aAAO;AAAA;AAET,WAAO,GAAG,MAAM,MAAM;AAAA;AAIxB,QAAM,aAAa,sBAAK,QAAQ,OAAO,MAAM;AAC7C,QAAM,sBAAsB,QAAQ;AACpC,QAAM,gBAAiB,oBAAoB,cACzC;AAGF,QAAM,aAAa;AACnB,aAAW,WAAU,MAAM,YAAY;AACrC,UAAM,WAAW,QAAQ;AACzB,WAAO,OAAO,YAAY;AAAA;AAI5B,UAAQ,IAAI,YAAY;AACxB,MAAI,UAAU,UAAU;AAGxB,sCAAc;AAEd,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA;AAGF,SAAO;AAAA;AAlDO;",
4
+ "sourcesContent": ["import { join } from 'path'\n\nimport type { StaticComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, StaticComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const rnw = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (path === '@gorhom/bottom-sheet') {\n return {}\n }\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return rnw\n }\n return og.apply(this, arguments)\n }\n\n // import config\n const configPath = join(process.cwd(), props.config)\n const tamaguiConfigExport = require(configPath)\n const tamaguiConfig = (tamaguiConfigExport['default'] ||\n tamaguiConfigExport) as TamaguiInternalConfig\n\n // import components\n const components = {}\n for (const module of props.components) {\n const exported = require(module)\n Object.assign(components, exported)\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n return loadedTamagui\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAGrB,uBAA8B;AAE9B,IAAI,gBAAqB;AAElB,qBAAqB,OAG1B;AACA,MAAI,eAAe;AACjB,WAAO;AAAA;AAKT,UAAQ,IAAI,YAAY;AACxB,QAAM,MAAM,QAAQ;AACpB,QAAM,MAAM,QAAQ;AACpB,QAAM,KAAK,IAAI,UAAU;AACzB,MAAI,UAAU,UAAU,SAAU,MAAc;AAC9C,QAAI,SAAS,wBAAwB;AACnC,aAAO;AAAA;AAET,QACE,KAAK,WAAW,mBAEhB,CAAC,KAAK,WAAW,sCACjB;AACA,aAAO;AAAA;AAET,WAAO,GAAG,MAAM,MAAM;AAAA;AAIxB,QAAM,aAAa,sBAAK,QAAQ,OAAO,MAAM;AAC7C,QAAM,sBAAsB,QAAQ;AACpC,QAAM,gBAAiB,oBAAoB,cACzC;AAGF,QAAM,aAAa;AACnB,aAAW,WAAU,MAAM,YAAY;AACrC,UAAM,WAAW,QAAQ;AACzB,WAAO,OAAO,YAAY;AAAA;AAI5B,UAAQ,IAAI,YAAY;AACxB,MAAI,UAAU,UAAU;AAGxB,sCAAc;AAEd,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA;AAGF,SAAO;AAAA;AArDO;",
6
6
  "names": []
7
7
  }
@@ -8,12 +8,15 @@ function loadTamagui(props) {
8
8
  return loadedTamagui;
9
9
  }
10
10
  process.env.IS_STATIC = "is_static";
11
- const proxyWorm = require("react-native-web");
11
+ const rnw = require("react-native-web");
12
12
  const Mod = require("module");
13
13
  const og = Mod.prototype.require;
14
14
  Mod.prototype.require = function(path) {
15
+ if (path === "@gorhom/bottom-sheet") {
16
+ return {};
17
+ }
15
18
  if (path.startsWith("react-native") && !path.startsWith("react-native-web/dist/cjs/exports")) {
16
- return proxyWorm;
19
+ return rnw;
17
20
  }
18
21
  return og.apply(this, arguments);
19
22
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/extractor/loadTamagui.ts"],
4
- "sourcesContent": ["import { join } from 'path'\n\nimport type { StaticComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, StaticComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const proxyWorm = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return proxyWorm\n }\n return og.apply(this, arguments)\n }\n\n // import config\n const configPath = join(process.cwd(), props.config)\n const tamaguiConfigExport = require(configPath)\n const tamaguiConfig = (tamaguiConfigExport['default'] ||\n tamaguiConfigExport) as TamaguiInternalConfig\n\n // import components\n const components = {}\n for (const module of props.components) {\n const exported = require(module)\n Object.assign(components, exported)\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n return loadedTamagui\n}\n"],
5
- "mappings": ";;AAAA;AAGA;AAEA,IAAI,gBAAqB;AAElB,qBAAqB,OAG1B;AACA,MAAI,eAAe;AACjB,WAAO;AAAA;AAKT,UAAQ,IAAI,YAAY;AACxB,QAAM,YAAY,QAAQ;AAC1B,QAAM,MAAM,QAAQ;AACpB,QAAM,KAAK,IAAI,UAAU;AACzB,MAAI,UAAU,UAAU,SAAU,MAAc;AAC9C,QACE,KAAK,WAAW,mBAEhB,CAAC,KAAK,WAAW,sCACjB;AACA,aAAO;AAAA;AAET,WAAO,GAAG,MAAM,MAAM;AAAA;AAIxB,QAAM,aAAa,KAAK,QAAQ,OAAO,MAAM;AAC7C,QAAM,sBAAsB,QAAQ;AACpC,QAAM,gBAAiB,oBAAoB,cACzC;AAGF,QAAM,aAAa;AACnB,aAAW,UAAU,MAAM,YAAY;AACrC,UAAM,WAAW,QAAQ;AACzB,WAAO,OAAO,YAAY;AAAA;AAI5B,UAAQ,IAAI,YAAY;AACxB,MAAI,UAAU,UAAU;AAGxB,gBAAc;AAEd,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA;AAGF,SAAO;AAAA;AAlDO;",
4
+ "sourcesContent": ["import { join } from 'path'\n\nimport type { StaticComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, StaticComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const rnw = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (path === '@gorhom/bottom-sheet') {\n return {}\n }\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return rnw\n }\n return og.apply(this, arguments)\n }\n\n // import config\n const configPath = join(process.cwd(), props.config)\n const tamaguiConfigExport = require(configPath)\n const tamaguiConfig = (tamaguiConfigExport['default'] ||\n tamaguiConfigExport) as TamaguiInternalConfig\n\n // import components\n const components = {}\n for (const module of props.components) {\n const exported = require(module)\n Object.assign(components, exported)\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n return loadedTamagui\n}\n"],
5
+ "mappings": ";;AAAA;AAGA;AAEA,IAAI,gBAAqB;AAElB,qBAAqB,OAG1B;AACA,MAAI,eAAe;AACjB,WAAO;AAAA;AAKT,UAAQ,IAAI,YAAY;AACxB,QAAM,MAAM,QAAQ;AACpB,QAAM,MAAM,QAAQ;AACpB,QAAM,KAAK,IAAI,UAAU;AACzB,MAAI,UAAU,UAAU,SAAU,MAAc;AAC9C,QAAI,SAAS,wBAAwB;AACnC,aAAO;AAAA;AAET,QACE,KAAK,WAAW,mBAEhB,CAAC,KAAK,WAAW,sCACjB;AACA,aAAO;AAAA;AAET,WAAO,GAAG,MAAM,MAAM;AAAA;AAIxB,QAAM,aAAa,KAAK,QAAQ,OAAO,MAAM;AAC7C,QAAM,sBAAsB,QAAQ;AACpC,QAAM,gBAAiB,oBAAoB,cACzC;AAGF,QAAM,aAAa;AACnB,aAAW,UAAU,MAAM,YAAY;AACrC,UAAM,WAAW,QAAQ;AACzB,WAAO,OAAO,YAAY;AAAA;AAI5B,UAAQ,IAAI,YAAY;AACxB,MAAI,UAAU,UAAU;AAGxB,gBAAc;AAEd,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA;AAGF,SAAO;AAAA;AArDO;",
6
6
  "names": []
7
7
  }
@@ -8,12 +8,15 @@ function loadTamagui(props) {
8
8
  return loadedTamagui;
9
9
  }
10
10
  process.env.IS_STATIC = "is_static";
11
- const proxyWorm = require("react-native-web");
11
+ const rnw = require("react-native-web");
12
12
  const Mod = require("module");
13
13
  const og = Mod.prototype.require;
14
14
  Mod.prototype.require = function(path) {
15
+ if (path === "@gorhom/bottom-sheet") {
16
+ return {};
17
+ }
15
18
  if (path.startsWith("react-native") && !path.startsWith("react-native-web/dist/cjs/exports")) {
16
- return proxyWorm;
19
+ return rnw;
17
20
  }
18
21
  return og.apply(this, arguments);
19
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/static",
3
- "version": "1.0.0-alpha.51",
3
+ "version": "1.0.0-alpha.52",
4
4
  "source": "src/index.ts",
5
5
  "typings": "types",
6
6
  "main": "dist/cjs",
@@ -47,7 +47,7 @@
47
47
  "react-test-renderer": "18.0.0-beta-149b420f6-20211119",
48
48
  "style-loader": "^3.3.0",
49
49
  "typescript": "^4.5.2",
50
- "webpack": "^5.58.1"
50
+ "webpack": "^5.68.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "@babel/core": "^7.15.5",
@@ -70,10 +70,10 @@
70
70
  "invariant": "^2.2.4",
71
71
  "loader-utils": "^2.0.0",
72
72
  "lodash": "^4.17.21",
73
- "tamagui": "^1.0.0-alpha.51"
73
+ "tamagui": "^1.0.0-alpha.52"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react-native-web": "*"
77
77
  },
78
- "gitHead": "21b642e56d647505a0205cb86a7f510a928c8bcc"
78
+ "gitHead": "ef6a6ef60d230fab7196e25745e5e695113bb046"
79
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAK3E,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC3C,aAAa,EAAE,qBAAqB,CAAA;CACrC,CAgDA"}
1
+ {"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAK3E,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC3C,aAAa,EAAE,qBAAqB,CAAA;CACrC,CAmDA"}