@expo/metro-config 0.3.17 → 0.3.20

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.
@@ -1,9 +1,42 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createExoticTransformer = void 0;
4
- const createMatcher_1 = require("./createMatcher");
5
- const createMultiRuleTransformer_1 = require("./createMultiRuleTransformer");
6
- const getCacheKey_1 = require("./getCacheKey");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createExoticTransformer = createExoticTransformer;
7
+
8
+ function _createMatcher() {
9
+ const data = require("./createMatcher");
10
+
11
+ _createMatcher = function () {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _createMultiRuleTransformer() {
19
+ const data = require("./createMultiRuleTransformer");
20
+
21
+ _createMultiRuleTransformer = function () {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _getCacheKey() {
29
+ const data = require("./getCacheKey");
30
+
31
+ _getCacheKey = function () {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ // Copyright 2021-present 650 Industries (Expo). All rights reserved.
39
+
7
40
  /**
8
41
  * Create an experimental multi-rule transformer for a React Native app.
9
42
  *
@@ -19,96 +52,99 @@ const getCacheKey_1 = require("./getCacheKey");
19
52
  * @param props.transpileModules matchers for module names that should be transpiled using the project Babel configuration. Example: `['@stripe/stripe-react-native']`
20
53
  * @returns a Metro `transformer` function and default `getCacheKey` function.
21
54
  */
22
- function createExoticTransformer({ nodeModulesPaths, transpileModules, }) {
23
- if (!nodeModulesPaths) {
24
- nodeModulesPaths = ['node_modules'];
25
- }
26
- // Match any node modules, or monorepo module.
27
- const nodeModuleMatcher = (0, createMatcher_1.createModuleMatcher)({ folders: nodeModulesPaths, moduleIds: [] });
28
- // Match node modules which are so oddly written that we must
29
- // transpile them with every possible option (most expensive).
30
- const impossibleNodeModuleMatcher = (0, createMatcher_1.createModuleMatcher)({
31
- moduleIds: [
32
- // victory is too wild
33
- // SyntaxError in ../../node_modules/victory-native/lib/components/victory-primitives/bar.js: Missing semicolon. (9:1)
34
- 'victory',
35
- // vector icons has some hidden issues that break NCL
36
- '@expo/vector-icons',
37
- ...(transpileModules || []),
38
- ],
39
- folders: nodeModulesPaths,
40
- });
41
- const transform = (0, createMultiRuleTransformer_1.createMultiRuleTransformer)({
42
- // Specify which rules to use on a per-file basis, basically
43
- // this is used to determine which modules are node modules, and which are application code.
44
- getRuleType({ filename }) {
45
- // Is a node module, and is not one of the impossible modules.
46
- return nodeModuleMatcher.test(filename) && !impossibleNodeModuleMatcher.test(filename)
47
- ? 'module'
48
- : 'app';
49
- },
50
- // Order is very important, we use wild card matchers to transpile
51
- // "every unhandled node module" and "every unhandled application module".
52
- rules: [
53
- // Match bob compiler modules, use the passthrough loader.
54
- {
55
- name: 'bob',
56
- type: 'module',
57
- test: (0, createMatcher_1.createModuleMatcher)({ moduleIds: ['.*/lib/commonjs/'], folders: nodeModulesPaths }),
58
- transform: createMultiRuleTransformer_1.loaders.passthroughModule,
59
- warn: true,
60
- },
61
- // Match React Native modules, convert them statically using sucrase.
62
- {
63
- name: 'react-native',
64
- type: 'module',
65
- test: (0, createMatcher_1.createReactNativeMatcher)({ folders: nodeModulesPaths }),
66
- transform: createMultiRuleTransformer_1.loaders.reactNativeModule,
67
- warn: true,
68
- },
69
- // Match Expo SDK modules, convert them statically using sucrase.
70
- {
71
- name: 'expo-module',
72
- type: 'module',
73
- test: (0, createMatcher_1.createExpoMatcher)({ folders: nodeModulesPaths }),
74
- transform: createMultiRuleTransformer_1.loaders.expoModule,
75
- warn: true,
76
- },
77
- // Match known problematic modules, convert them statically using an expensive, dynamic sucrase.
78
- {
79
- name: 'sucrase',
80
- type: 'module',
81
- test: (0, createMatcher_1.createKnownCommunityMatcher)({
82
- folders: nodeModulesPaths,
83
- }),
84
- transform: createMultiRuleTransformer_1.loaders.untranspiledModule,
85
- warn: true,
86
- },
87
- // Pass through any unhandled node modules as passthrough, this is where the most savings occur.
88
- // Ideally, you want your project to pass all node modules through this loader.
89
- // This should be the last "module" rule.
90
- // Message library authors and ask them to ship their modules as pre-transpiled
91
- // commonjs, to improve the development speed of your project.
92
- {
93
- name: 'skip-module',
94
- type: 'module',
95
- test: () => true,
96
- transform: createMultiRuleTransformer_1.loaders.passthroughModule,
97
- },
98
- // All application code should be transpiled with the user's babel preset,
99
- // this is the most expensive operation but provides the most customization to the user.
100
- // The goal is to use this as sparingly as possible.
101
- {
102
- name: 'babel',
103
- test: () => true,
104
- transform: createMultiRuleTransformer_1.loaders.app,
105
- },
106
- ],
107
- });
108
- return {
109
- transform,
110
- getCacheKey: getCacheKey_1.getCacheKey,
111
- };
55
+ function createExoticTransformer({
56
+ nodeModulesPaths,
57
+ transpileModules
58
+ }) {
59
+ if (!nodeModulesPaths) {
60
+ nodeModulesPaths = ['node_modules'];
61
+ } // Match any node modules, or monorepo module.
62
+
63
+
64
+ const nodeModuleMatcher = (0, _createMatcher().createModuleMatcher)({
65
+ folders: nodeModulesPaths,
66
+ moduleIds: []
67
+ }); // Match node modules which are so oddly written that we must
68
+ // transpile them with every possible option (most expensive).
69
+
70
+ const impossibleNodeModuleMatcher = (0, _createMatcher().createModuleMatcher)({
71
+ moduleIds: [// victory is too wild
72
+ // SyntaxError in ../../node_modules/victory-native/lib/components/victory-primitives/bar.js: Missing semicolon. (9:1)
73
+ 'victory', // vector icons has some hidden issues that break NCL
74
+ '@expo/vector-icons', ...(transpileModules || [])],
75
+ folders: nodeModulesPaths
76
+ });
77
+ const transform = (0, _createMultiRuleTransformer().createMultiRuleTransformer)({
78
+ // Specify which rules to use on a per-file basis, basically
79
+ // this is used to determine which modules are node modules, and which are application code.
80
+ getRuleType({
81
+ filename
82
+ }) {
83
+ // Is a node module, and is not one of the impossible modules.
84
+ return nodeModuleMatcher.test(filename) && !impossibleNodeModuleMatcher.test(filename) ? 'module' : 'app';
85
+ },
86
+
87
+ // Order is very important, we use wild card matchers to transpile
88
+ // "every unhandled node module" and "every unhandled application module".
89
+ rules: [// Match bob compiler modules, use the passthrough loader.
90
+ {
91
+ name: 'bob',
92
+ type: 'module',
93
+ test: (0, _createMatcher().createModuleMatcher)({
94
+ moduleIds: ['.*/lib/commonjs/'],
95
+ folders: nodeModulesPaths
96
+ }),
97
+ transform: _createMultiRuleTransformer().loaders.passthroughModule,
98
+ warn: true
99
+ }, // Match React Native modules, convert them statically using sucrase.
100
+ {
101
+ name: 'react-native',
102
+ type: 'module',
103
+ test: (0, _createMatcher().createReactNativeMatcher)({
104
+ folders: nodeModulesPaths
105
+ }),
106
+ transform: _createMultiRuleTransformer().loaders.reactNativeModule,
107
+ warn: true
108
+ }, // Match Expo SDK modules, convert them statically using sucrase.
109
+ {
110
+ name: 'expo-module',
111
+ type: 'module',
112
+ test: (0, _createMatcher().createExpoMatcher)({
113
+ folders: nodeModulesPaths
114
+ }),
115
+ transform: _createMultiRuleTransformer().loaders.expoModule,
116
+ warn: true
117
+ }, // Match known problematic modules, convert them statically using an expensive, dynamic sucrase.
118
+ {
119
+ name: 'sucrase',
120
+ type: 'module',
121
+ test: (0, _createMatcher().createKnownCommunityMatcher)({
122
+ folders: nodeModulesPaths
123
+ }),
124
+ transform: _createMultiRuleTransformer().loaders.untranspiledModule,
125
+ warn: true
126
+ }, // Pass through any unhandled node modules as passthrough, this is where the most savings occur.
127
+ // Ideally, you want your project to pass all node modules through this loader.
128
+ // This should be the last "module" rule.
129
+ // Message library authors and ask them to ship their modules as pre-transpiled
130
+ // commonjs, to improve the development speed of your project.
131
+ {
132
+ name: 'skip-module',
133
+ type: 'module',
134
+ test: () => true,
135
+ transform: _createMultiRuleTransformer().loaders.passthroughModule
136
+ }, // All application code should be transpiled with the user's babel preset,
137
+ // this is the most expensive operation but provides the most customization to the user.
138
+ // The goal is to use this as sparingly as possible.
139
+ {
140
+ name: 'babel',
141
+ test: () => true,
142
+ transform: _createMultiRuleTransformer().loaders.app
143
+ }]
144
+ });
145
+ return {
146
+ transform,
147
+ getCacheKey: _getCacheKey().getCacheKey
148
+ };
112
149
  }
113
- exports.createExoticTransformer = createExoticTransformer;
114
150
  //# sourceMappingURL=createExoticTransformer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createExoticTransformer.js","sourceRoot":"","sources":["../../src/transformer/createExoticTransformer.ts"],"names":[],"mappings":";;;AAGA,mDAKyB;AACzB,6EAAmF;AACnF,+CAA4C;AAE5C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,uBAAuB,CAAC,EACtC,gBAAgB,EAChB,gBAAgB,GAIjB;IACC,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,CAAC,cAAc,CAAC,CAAC;KACrC;IACD,8CAA8C;IAC9C,MAAM,iBAAiB,GAAG,IAAA,mCAAmB,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAE5F,6DAA6D;IAC7D,8DAA8D;IAC9D,MAAM,2BAA2B,GAAG,IAAA,mCAAmB,EAAC;QACtD,SAAS,EAAE;YACT,sBAAsB;YACtB,sHAAsH;YACtH,SAAS;YACT,qDAAqD;YACrD,oBAAoB;YACpB,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;SAC5B;QACD,OAAO,EAAE,gBAAgB;KAC1B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAA,uDAA0B,EAAC;QAC3C,4DAA4D;QAC5D,4FAA4F;QAC5F,WAAW,CAAC,EAAE,QAAQ,EAAE;YACtB,8DAA8D;YAC9D,OAAO,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACpF,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,KAAK,CAAC;QACZ,CAAC;QAED,kEAAkE;QAClE,0EAA0E;QAC1E,KAAK,EAAE;YACL,0DAA0D;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;gBAChB,SAAS,EAAE,oCAAO,CAAC,GAAG;aACvB;SACF;KACF,CAAC,CAAC;IAEH,OAAO;QACL,SAAS;QACT,WAAW,EAAX,yBAAW;KACZ,CAAC;AACJ,CAAC;AApGD,0DAoGC","sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\nimport { BabelTransformer } from 'metro-babel-transformer';\n\nimport {\n createExpoMatcher,\n createKnownCommunityMatcher,\n createModuleMatcher,\n createReactNativeMatcher,\n} from './createMatcher';\nimport { createMultiRuleTransformer, loaders } from './createMultiRuleTransformer';\nimport { getCacheKey } from './getCacheKey';\n\n/**\n * Create an experimental multi-rule transformer for a React Native app.\n *\n * @example\n * ```\n * module.exports = createExoticTransformer({\n * nodeModulesPaths: ['react-native'],\n * transpileModules: ['@stripe/stripe-react-native'],\n * });\n * ```\n *\n * @param props.nodeModulesPaths paths to node_modules folders, relative to project root. Default: `['node_modules']`\n * @param props.transpileModules matchers for module names that should be transpiled using the project Babel configuration. Example: `['@stripe/stripe-react-native']`\n * @returns a Metro `transformer` function and default `getCacheKey` function.\n */\nexport function createExoticTransformer({\n nodeModulesPaths,\n transpileModules,\n}: {\n nodeModulesPaths?: string[];\n transpileModules?: string[];\n}): BabelTransformer {\n if (!nodeModulesPaths) {\n nodeModulesPaths = ['node_modules'];\n }\n // Match any node modules, or monorepo module.\n const nodeModuleMatcher = createModuleMatcher({ folders: nodeModulesPaths, moduleIds: [] });\n\n // Match node modules which are so oddly written that we must\n // transpile them with every possible option (most expensive).\n const impossibleNodeModuleMatcher = createModuleMatcher({\n moduleIds: [\n // victory is too wild\n // SyntaxError in ../../node_modules/victory-native/lib/components/victory-primitives/bar.js: Missing semicolon. (9:1)\n 'victory',\n // vector icons has some hidden issues that break NCL\n '@expo/vector-icons',\n ...(transpileModules || []),\n ],\n folders: nodeModulesPaths,\n });\n\n const transform = createMultiRuleTransformer({\n // Specify which rules to use on a per-file basis, basically\n // this is used to determine which modules are node modules, and which are application code.\n getRuleType({ filename }) {\n // Is a node module, and is not one of the impossible modules.\n return nodeModuleMatcher.test(filename) && !impossibleNodeModuleMatcher.test(filename)\n ? 'module'\n : 'app';\n },\n\n // Order is very important, we use wild card matchers to transpile\n // \"every unhandled node module\" and \"every unhandled application module\".\n rules: [\n // Match bob compiler modules, use the passthrough loader.\n {\n name: 'bob',\n type: 'module',\n test: createModuleMatcher({ moduleIds: ['.*/lib/commonjs/'], folders: nodeModulesPaths }),\n transform: loaders.passthroughModule,\n warn: true,\n },\n // Match React Native modules, convert them statically using sucrase.\n {\n name: 'react-native',\n type: 'module',\n test: createReactNativeMatcher({ folders: nodeModulesPaths }),\n transform: loaders.reactNativeModule,\n warn: true,\n },\n // Match Expo SDK modules, convert them statically using sucrase.\n {\n name: 'expo-module',\n type: 'module',\n test: createExpoMatcher({ folders: nodeModulesPaths }),\n transform: loaders.expoModule,\n warn: true,\n },\n // Match known problematic modules, convert them statically using an expensive, dynamic sucrase.\n {\n name: 'sucrase',\n type: 'module',\n test: createKnownCommunityMatcher({\n folders: nodeModulesPaths,\n }),\n transform: loaders.untranspiledModule,\n warn: true,\n },\n // Pass through any unhandled node modules as passthrough, this is where the most savings occur.\n // Ideally, you want your project to pass all node modules through this loader.\n // This should be the last \"module\" rule.\n // Message library authors and ask them to ship their modules as pre-transpiled\n // commonjs, to improve the development speed of your project.\n {\n name: 'skip-module',\n type: 'module',\n test: () => true,\n transform: loaders.passthroughModule,\n },\n // All application code should be transpiled with the user's babel preset,\n // this is the most expensive operation but provides the most customization to the user.\n // The goal is to use this as sparingly as possible.\n {\n name: 'babel',\n test: () => true,\n transform: loaders.app,\n },\n ],\n });\n\n return {\n transform,\n getCacheKey,\n };\n}\n"]}
1
+ {"version":3,"file":"createExoticTransformer.js","names":["createExoticTransformer","nodeModulesPaths","transpileModules","nodeModuleMatcher","createModuleMatcher","folders","moduleIds","impossibleNodeModuleMatcher","transform","createMultiRuleTransformer","getRuleType","filename","test","rules","name","type","loaders","passthroughModule","warn","createReactNativeMatcher","reactNativeModule","createExpoMatcher","expoModule","createKnownCommunityMatcher","untranspiledModule","app","getCacheKey"],"sources":["../../src/transformer/createExoticTransformer.ts"],"sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\nimport { BabelTransformer } from 'metro-babel-transformer';\n\nimport {\n createExpoMatcher,\n createKnownCommunityMatcher,\n createModuleMatcher,\n createReactNativeMatcher,\n} from './createMatcher';\nimport { createMultiRuleTransformer, loaders } from './createMultiRuleTransformer';\nimport { getCacheKey } from './getCacheKey';\n\n/**\n * Create an experimental multi-rule transformer for a React Native app.\n *\n * @example\n * ```\n * module.exports = createExoticTransformer({\n * nodeModulesPaths: ['react-native'],\n * transpileModules: ['@stripe/stripe-react-native'],\n * });\n * ```\n *\n * @param props.nodeModulesPaths paths to node_modules folders, relative to project root. Default: `['node_modules']`\n * @param props.transpileModules matchers for module names that should be transpiled using the project Babel configuration. Example: `['@stripe/stripe-react-native']`\n * @returns a Metro `transformer` function and default `getCacheKey` function.\n */\nexport function createExoticTransformer({\n nodeModulesPaths,\n transpileModules,\n}: {\n nodeModulesPaths?: string[];\n transpileModules?: string[];\n}): BabelTransformer {\n if (!nodeModulesPaths) {\n nodeModulesPaths = ['node_modules'];\n }\n // Match any node modules, or monorepo module.\n const nodeModuleMatcher = createModuleMatcher({ folders: nodeModulesPaths, moduleIds: [] });\n\n // Match node modules which are so oddly written that we must\n // transpile them with every possible option (most expensive).\n const impossibleNodeModuleMatcher = createModuleMatcher({\n moduleIds: [\n // victory is too wild\n // SyntaxError in ../../node_modules/victory-native/lib/components/victory-primitives/bar.js: Missing semicolon. (9:1)\n 'victory',\n // vector icons has some hidden issues that break NCL\n '@expo/vector-icons',\n ...(transpileModules || []),\n ],\n folders: nodeModulesPaths,\n });\n\n const transform = createMultiRuleTransformer({\n // Specify which rules to use on a per-file basis, basically\n // this is used to determine which modules are node modules, and which are application code.\n getRuleType({ filename }) {\n // Is a node module, and is not one of the impossible modules.\n return nodeModuleMatcher.test(filename) && !impossibleNodeModuleMatcher.test(filename)\n ? 'module'\n : 'app';\n },\n\n // Order is very important, we use wild card matchers to transpile\n // \"every unhandled node module\" and \"every unhandled application module\".\n rules: [\n // Match bob compiler modules, use the passthrough loader.\n {\n name: 'bob',\n type: 'module',\n test: createModuleMatcher({ moduleIds: ['.*/lib/commonjs/'], folders: nodeModulesPaths }),\n transform: loaders.passthroughModule,\n warn: true,\n },\n // Match React Native modules, convert them statically using sucrase.\n {\n name: 'react-native',\n type: 'module',\n test: createReactNativeMatcher({ folders: nodeModulesPaths }),\n transform: loaders.reactNativeModule,\n warn: true,\n },\n // Match Expo SDK modules, convert them statically using sucrase.\n {\n name: 'expo-module',\n type: 'module',\n test: createExpoMatcher({ folders: nodeModulesPaths }),\n transform: loaders.expoModule,\n warn: true,\n },\n // Match known problematic modules, convert them statically using an expensive, dynamic sucrase.\n {\n name: 'sucrase',\n type: 'module',\n test: createKnownCommunityMatcher({\n folders: nodeModulesPaths,\n }),\n transform: loaders.untranspiledModule,\n warn: true,\n },\n // Pass through any unhandled node modules as passthrough, this is where the most savings occur.\n // Ideally, you want your project to pass all node modules through this loader.\n // This should be the last \"module\" rule.\n // Message library authors and ask them to ship their modules as pre-transpiled\n // commonjs, to improve the development speed of your project.\n {\n name: 'skip-module',\n type: 'module',\n test: () => true,\n transform: loaders.passthroughModule,\n },\n // All application code should be transpiled with the user's babel preset,\n // this is the most expensive operation but provides the most customization to the user.\n // The goal is to use this as sparingly as possible.\n {\n name: 'babel',\n test: () => true,\n transform: loaders.app,\n },\n ],\n });\n\n return {\n transform,\n getCacheKey,\n };\n}\n"],"mappings":";;;;;;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAVA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SA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AVK,EAiBL;IACA;MACEJ,IAAI,EAAE,aADR;MAEEC,IAAI,EAAE,QAFR;MAGEH,IAAI,EAAE,IAAAS,kCAAA,EAAkB;QAAEhB,OAAO,EAAEJ;MAAX,CAAlB,CAHR;MAIEO,SAAS,EAAEQ,qCAAA,CAAQM,UAJrB;MAKEJ,IAAI,EAAE;IALR,CAlBK,EAyBL;IACA;MACEJ,IAAI,EAAE,SADR;MAEEC,IAAI,EAAE,QAFR;MAGEH,IAAI,EAAE,IAAAW,4CAAA,EAA4B;QAChClB,OAAO,EAAEJ;MADuB,CAA5B,CAHR;MAMEO,SAAS,EAAEQ,qCAAA,CAAQQ,kBANrB;MAOEN,IAAI,EAAE;IAPR,CA1BK,EAmCL;IACA;IACA;IACA;IACA;IACA;MACEJ,IAAI,EAAE,aADR;MAEEC,IAAI,EAAE,QAFR;MAGEH,IAAI,EAAE,MAAM,IAHd;MAIEJ,SAAS,EAAEQ,qCAAA,CAAQC;IAJrB,CAxCK,EA8CL;IACA;IACA;IACA;MACEH,IAAI,EAAE,OADR;MAEEF,IAAI,EAAE,MAAM,IAFd;MAGEJ,SAAS,EAAEQ,qCAAA,CAAQS;IAHrB,CAjDK;EAZoC,CAA3B,CAAlB;EAqEA,OAAO;IACLjB,SADK;IAELkB,WAAW,EAAXA;EAFK,CAAP;AAID"}
@@ -1,48 +1,57 @@
1
1
  "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createKnownCommunityMatcher = exports.createExpoMatcher = void 0;
7
+ exports.createModuleMatcher = createModuleMatcher;
8
+ exports.createReactNativeMatcher = void 0;
9
+
2
10
  // Copyright 2021-present 650 Industries (Expo). All rights reserved.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.createKnownCommunityMatcher = exports.createExpoMatcher = exports.createReactNativeMatcher = exports.createModuleMatcher = void 0;
5
- function createModuleMatcher({ folders = ['node_modules'], moduleIds, }) {
6
- const modulePathsGroup = folders.join('|');
7
- const moduleMatchersGroup = moduleIds.join('|');
8
- const moduleMatcherId = '^' + [modulePathsGroup, moduleMatchersGroup].map(value => `(?:${value})`).join('/');
9
- return new RegExp(moduleMatcherId);
11
+ function createModuleMatcher({
12
+ folders = ['node_modules'],
13
+ moduleIds
14
+ }) {
15
+ const modulePathsGroup = folders.join('|');
16
+ const moduleMatchersGroup = moduleIds.join('|');
17
+ const moduleMatcherId = '^' + [modulePathsGroup, moduleMatchersGroup].map(value => `(?:${value})`).join('/');
18
+ return new RegExp(moduleMatcherId);
10
19
  }
11
- exports.createModuleMatcher = createModuleMatcher;
12
- const createReactNativeMatcher = ({ folders }) => createModuleMatcher({
13
- folders,
14
- moduleIds: ['react-native/'],
20
+
21
+ const createReactNativeMatcher = ({
22
+ folders
23
+ }) => createModuleMatcher({
24
+ folders,
25
+ moduleIds: ['react-native/']
15
26
  });
27
+
16
28
  exports.createReactNativeMatcher = createReactNativeMatcher;
17
- const createExpoMatcher = ({ folders }) => createModuleMatcher({
18
- folders,
19
- // We'll work to start reducing this.
20
- moduleIds: ['expo', '@expo', '@unimodules', '@use-expo'],
21
- });
22
- exports.createExpoMatcher = createExpoMatcher;
23
- // TODO: Make this list as short as possible before releasing.
29
+
30
+ const createExpoMatcher = ({
31
+ folders
32
+ }) => createModuleMatcher({
33
+ folders,
34
+ // We'll work to start reducing this.
35
+ moduleIds: ['expo', '@expo', '@unimodules', '@use-expo']
36
+ }); // TODO: Make this list as short as possible before releasing.
24
37
  // TODO: Add SDK version compat list.
25
- const createKnownCommunityMatcher = ({ folders, moduleIds = [], } = {}) => createModuleMatcher({
26
- folders,
27
- moduleIds: [
28
- ...moduleIds,
29
- // The more complex, the longer the entire project takes...
30
- // react-native-community, react-native-masked-view, react-native-picker, react-native-segmented-control, react-native
31
- '@react-',
32
- // @sentry/react-native
33
- '@(?:[\\w|-]+)/react-native',
34
- 'react-native-',
35
- 'victory-',
36
- 'native-base',
37
- 'styled-components',
38
- // three.js
39
- 'three/build/three.module.js',
40
- 'three/examples/jsm',
41
- // Special case for testing expo/expo repo
42
- 'html-elements/',
43
- // shared-element
44
- 'react-navigation-',
45
- ],
38
+
39
+
40
+ exports.createExpoMatcher = createExpoMatcher;
41
+
42
+ const createKnownCommunityMatcher = ({
43
+ folders,
44
+ moduleIds = []
45
+ } = {}) => createModuleMatcher({
46
+ folders,
47
+ moduleIds: [...moduleIds, // The more complex, the longer the entire project takes...
48
+ // react-native-community, react-native-masked-view, react-native-picker, react-native-segmented-control, react-native
49
+ '@react-', // @sentry/react-native
50
+ '@(?:[\\w|-]+)/react-native', 'react-native-', 'victory-', 'native-base', 'styled-components', // three.js
51
+ 'three/build/three.module.js', 'three/examples/jsm', // Special case for testing expo/expo repo
52
+ 'html-elements/', // shared-element
53
+ 'react-navigation-']
46
54
  });
55
+
47
56
  exports.createKnownCommunityMatcher = createKnownCommunityMatcher;
48
57
  //# sourceMappingURL=createMatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createMatcher.js","sourceRoot":"","sources":["../../src/transformer/createMatcher.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAErE,SAAgB,mBAAmB,CAAC,EAClC,OAAO,GAAG,CAAC,cAAc,CAAC,EAC1B,SAAS,GAIV;IACC,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE3C,MAAM,mBAAmB,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEhD,MAAM,eAAe,GACnB,GAAG,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEvF,OAAO,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC;AAfD,kDAeC;AAEM,MAAM,wBAAwB,GAAG,CAAC,EAAE,OAAO,EAA0B,EAAE,EAAE,CAC9E,mBAAmB,CAAC;IAClB,OAAO;IACP,SAAS,EAAE,CAAC,eAAe,CAAC;CAC7B,CAAC,CAAC;AAJQ,QAAA,wBAAwB,4BAIhC;AAEE,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAA0B,EAAE,EAAE,CACvE,mBAAmB,CAAC;IAClB,OAAO;IACP,qCAAqC;IACrC,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC;CACzD,CAAC,CAAC;AALQ,QAAA,iBAAiB,qBAKzB;AAEL,8DAA8D;AAC9D,qCAAqC;AAC9B,MAAM,2BAA2B,GAAG,CAAC,EAC1C,OAAO,EACP,SAAS,GAAG,EAAE,MAIZ,EAAE,EAAE,EAAE,CACR,mBAAmB,CAAC;IAClB,OAAO;IACP,SAAS,EAAE;QACT,GAAG,SAAS;QACZ,2DAA2D;QAC3D,sHAAsH;QACtH,SAAS;QACT,uBAAuB;QACvB,4BAA4B;QAC5B,eAAe;QACf,UAAU;QACV,aAAa;QACb,mBAAmB;QACnB,WAAW;QACX,6BAA6B;QAC7B,oBAAoB;QACpB,0CAA0C;QAC1C,gBAAgB;QAChB,iBAAiB;QACjB,mBAAmB;KACpB;CACF,CAAC,CAAC;AA5BQ,QAAA,2BAA2B,+BA4BnC","sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\n\nexport function createModuleMatcher({\n folders = ['node_modules'],\n moduleIds,\n}: {\n folders?: string[];\n moduleIds: string[];\n}) {\n const modulePathsGroup = folders.join('|');\n\n const moduleMatchersGroup = moduleIds.join('|');\n\n const moduleMatcherId =\n '^' + [modulePathsGroup, moduleMatchersGroup].map(value => `(?:${value})`).join('/');\n\n return new RegExp(moduleMatcherId);\n}\n\nexport const createReactNativeMatcher = ({ folders }: { folders?: string[] }) =>\n createModuleMatcher({\n folders,\n moduleIds: ['react-native/'],\n });\n\nexport const createExpoMatcher = ({ folders }: { folders?: string[] }) =>\n createModuleMatcher({\n folders,\n // We'll work to start reducing this.\n moduleIds: ['expo', '@expo', '@unimodules', '@use-expo'],\n });\n\n// TODO: Make this list as short as possible before releasing.\n// TODO: Add SDK version compat list.\nexport const createKnownCommunityMatcher = ({\n folders,\n moduleIds = [],\n}: {\n folders?: string[];\n moduleIds?: string[];\n} = {}) =>\n createModuleMatcher({\n folders,\n moduleIds: [\n ...moduleIds,\n // The more complex, the longer the entire project takes...\n // react-native-community, react-native-masked-view, react-native-picker, react-native-segmented-control, react-native\n '@react-',\n // @sentry/react-native\n '@(?:[\\\\w|-]+)/react-native',\n 'react-native-',\n 'victory-',\n 'native-base',\n 'styled-components',\n // three.js\n 'three/build/three.module.js',\n 'three/examples/jsm',\n // Special case for testing expo/expo repo\n 'html-elements/',\n // shared-element\n 'react-navigation-',\n ],\n });\n"]}
1
+ {"version":3,"file":"createMatcher.js","names":["createModuleMatcher","folders","moduleIds","modulePathsGroup","join","moduleMatchersGroup","moduleMatcherId","map","value","RegExp","createReactNativeMatcher","createExpoMatcher","createKnownCommunityMatcher"],"sources":["../../src/transformer/createMatcher.ts"],"sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\n\nexport function createModuleMatcher({\n folders = ['node_modules'],\n moduleIds,\n}: {\n folders?: string[];\n moduleIds: string[];\n}) {\n const modulePathsGroup = folders.join('|');\n\n const moduleMatchersGroup = moduleIds.join('|');\n\n const moduleMatcherId =\n '^' + [modulePathsGroup, moduleMatchersGroup].map(value => `(?:${value})`).join('/');\n\n return new RegExp(moduleMatcherId);\n}\n\nexport const createReactNativeMatcher = ({ folders }: { folders?: string[] }) =>\n createModuleMatcher({\n folders,\n moduleIds: ['react-native/'],\n });\n\nexport const createExpoMatcher = ({ folders }: { folders?: string[] }) =>\n createModuleMatcher({\n folders,\n // We'll work to start reducing this.\n moduleIds: ['expo', '@expo', '@unimodules', '@use-expo'],\n });\n\n// TODO: Make this list as short as possible before releasing.\n// TODO: Add SDK version compat list.\nexport const createKnownCommunityMatcher = ({\n folders,\n moduleIds = [],\n}: {\n folders?: string[];\n moduleIds?: string[];\n} = {}) =>\n createModuleMatcher({\n folders,\n moduleIds: [\n ...moduleIds,\n // The more complex, the longer the entire project takes...\n // react-native-community, react-native-masked-view, react-native-picker, react-native-segmented-control, react-native\n '@react-',\n // @sentry/react-native\n '@(?:[\\\\w|-]+)/react-native',\n 'react-native-',\n 'victory-',\n 'native-base',\n 'styled-components',\n // three.js\n 'three/build/three.module.js',\n 'three/examples/jsm',\n // Special case for testing expo/expo repo\n 'html-elements/',\n // shared-element\n 'react-navigation-',\n ],\n });\n"],"mappings":";;;;;;;;;AAAA;AAEO,SAASA,mBAAT,CAA6B;EAClCC,OAAO,GAAG,CAAC,cAAD,CADwB;EAElCC;AAFkC,CAA7B,EAMJ;EACD,MAAMC,gBAAgB,GAAGF,OAAO,CAACG,IAAR,CAAa,GAAb,CAAzB;EAEA,MAAMC,mBAAmB,GAAGH,SAAS,CAACE,IAAV,CAAe,GAAf,CAA5B;EAEA,MAAME,eAAe,GACnB,MAAM,CAACH,gBAAD,EAAmBE,mBAAnB,EAAwCE,GAAxC,CAA4CC,KAAK,IAAK,MAAKA,KAAM,GAAjE,EAAqEJ,IAArE,CAA0E,GAA1E,CADR;EAGA,OAAO,IAAIK,MAAJ,CAAWH,eAAX,CAAP;AACD;;AAEM,MAAMI,wBAAwB,GAAG,CAAC;EAAET;AAAF,CAAD,KACtCD,mBAAmB,CAAC;EAClBC,OADkB;EAElBC,SAAS,EAAE,CAAC,eAAD;AAFO,CAAD,CADd;;;;AAMA,MAAMS,iBAAiB,GAAG,CAAC;EAAEV;AAAF,CAAD,KAC/BD,mBAAmB,CAAC;EAClBC,OADkB;EAElB;EACAC,SAAS,EAAE,CAAC,MAAD,EAAS,OAAT,EAAkB,aAAlB,EAAiC,WAAjC;AAHO,CAAD,CADd,C,CAOP;AACA;;;;;AACO,MAAMU,2BAA2B,GAAG,CAAC;EAC1CX,OAD0C;EAE1CC,SAAS,GAAG;AAF8B,IAMxC,EANuC,KAOzCF,mBAAmB,CAAC;EAClBC,OADkB;EAElBC,SAAS,EAAE,CACT,GAAGA,SADM,EAET;EACA;EACA,SAJS,EAKT;EACA,4BANS,EAOT,eAPS,EAQT,UARS,EAST,aATS,EAUT,mBAVS,EAWT;EACA,6BAZS,EAaT,oBAbS,EAcT;EACA,gBAfS,EAgBT;EACA,mBAjBS;AAFO,CAAD,CAPd"}