react-native-builder-bob 0.38.1 → 0.38.3

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.
Files changed (39) hide show
  1. package/lib/__fixtures__/project/MyNativeComponent.js +2 -0
  2. package/lib/__fixtures__/project/MyNativeComponent.js.map +1 -0
  3. package/lib/__fixtures__/project/NativeMyLib.js +2 -0
  4. package/lib/__fixtures__/project/NativeMyLib.js.map +1 -0
  5. package/lib/__fixtures__/project/code/$exports-input.js +10 -10
  6. package/lib/__fixtures__/project/code/$exports-input.js.map +1 -1
  7. package/lib/__fixtures__/project/code/$exports-output.js +10 -10
  8. package/lib/__fixtures__/project/code/$exports-output.js.map +1 -1
  9. package/lib/__fixtures__/project/code/$imports-input.js +10 -10
  10. package/lib/__fixtures__/project/code/$imports-input.js.map +1 -1
  11. package/lib/__fixtures__/project/code/$imports-output.js +10 -10
  12. package/lib/__fixtures__/project/code/$imports-output.js.map +1 -1
  13. package/lib/__fixtures__/project/code/MyNativeComponent.js +2 -0
  14. package/lib/__fixtures__/project/code/MyNativeComponent.js.map +1 -0
  15. package/lib/__fixtures__/project/code/NativeMyLib.js +2 -0
  16. package/lib/__fixtures__/project/code/NativeMyLib.js.map +1 -0
  17. package/lib/__tests__/{index.test.js → babel.test.js} +8 -1
  18. package/lib/__tests__/babel.test.js.map +1 -0
  19. package/lib/__tests__/init.test.js +82 -0
  20. package/lib/__tests__/init.test.js.map +1 -0
  21. package/lib/build.js +163 -0
  22. package/lib/build.js.map +1 -0
  23. package/lib/index.js +3 -433
  24. package/lib/index.js.map +1 -1
  25. package/lib/init.js +371 -0
  26. package/lib/init.js.map +1 -0
  27. package/lib/targets/commonjs.js +2 -0
  28. package/lib/targets/commonjs.js.map +1 -1
  29. package/lib/targets/module.js +2 -0
  30. package/lib/targets/module.js.map +1 -1
  31. package/lib/targets/typescript.js +48 -25
  32. package/lib/targets/typescript.js.map +1 -1
  33. package/lib/types.js.map +1 -1
  34. package/lib/utils/compile.js +50 -25
  35. package/lib/utils/compile.js.map +1 -1
  36. package/lib/utils/loadConfig.js +21 -0
  37. package/lib/utils/loadConfig.js.map +1 -0
  38. package/package.json +4 -3
  39. package/lib/__tests__/index.test.js.map +0 -1
package/lib/index.js CHANGED
@@ -1,21 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _path = _interopRequireDefault(require("path"));
4
- var _fsExtra = _interopRequireDefault(require("fs-extra"));
5
- var _kleur = _interopRequireDefault(require("kleur"));
6
- var _dedent = _interopRequireDefault(require("dedent"));
7
3
  var _yargs = _interopRequireDefault(require("yargs"));
8
- var _cosmiconfig = require("cosmiconfig");
9
- var _isGitDirty = _interopRequireDefault(require("is-git-dirty"));
10
- var _prompts = _interopRequireDefault(require("./utils/prompts"));
11
- var logger = _interopRequireWildcard(require("./utils/logger"));
12
- var _commonjs = _interopRequireDefault(require("./targets/commonjs"));
13
- var _module = _interopRequireDefault(require("./targets/module"));
14
- var _typescript = _interopRequireDefault(require("./targets/typescript"));
15
- var _codegen = _interopRequireDefault(require("./targets/codegen"));
16
- var _custom = _interopRequireDefault(require("./targets/custom"));
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
4
+ var _build = require("./build");
5
+ var _init = require("./init");
19
6
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
7
  const args = {
21
8
  target: {
@@ -24,422 +11,5 @@ const args = {
24
11
  choices: ['commonjs', 'module', 'typescript', 'codegen']
25
12
  }
26
13
  };
27
-
28
- // eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-var-requires
29
- const {
30
- name,
31
- version
32
- } = require('../package.json');
33
- const root = process.cwd();
34
- const explorer = (0, _cosmiconfig.cosmiconfig)(name, {
35
- stopDir: root,
36
- searchPlaces: ['package.json', 'bob.config.mjs', 'bob.config.cjs', 'bob.config.js']
37
- });
38
- const projectPackagePath = _path.default.resolve(root, 'package.json');
39
- const FLOW_PRGAMA_REGEX = /\*?\s*@(flow)\b/m;
40
- _yargs.default.command('init', 'configure the package to use bob', {}, async () => {
41
- if ((0, _isGitDirty.default)()) {
42
- const {
43
- shouldContinue
44
- } = await (0, _prompts.default)({
45
- type: 'confirm',
46
- name: 'shouldContinue',
47
- message: `The working directory is not clean.\n You should commit or stash your changes before configuring bob.\n Continue anyway?`,
48
- initial: false
49
- });
50
- if (!shouldContinue) {
51
- process.exit(0);
52
- }
53
- }
54
- if (!(await _fsExtra.default.pathExists(projectPackagePath))) {
55
- logger.error(`Couldn't find a 'package.json' file in '${root}'.\n Are you in a project folder?`);
56
- process.exit(1);
57
- }
58
- const pkg = JSON.parse(await _fsExtra.default.readFile(projectPackagePath, 'utf-8'));
59
- const result = await explorer.search();
60
- if (result?.config && pkg.devDependencies && name in pkg.devDependencies) {
61
- const {
62
- shouldContinue
63
- } = await (0, _prompts.default)({
64
- type: 'confirm',
65
- name: 'shouldContinue',
66
- message: `The project seems to be already configured with bob.\n Do you want to overwrite the existing configuration?`,
67
- initial: false
68
- });
69
- if (!shouldContinue) {
70
- process.exit(0);
71
- }
72
- }
73
- const {
74
- source
75
- } = await (0, _prompts.default)({
76
- type: 'text',
77
- name: 'source',
78
- message: 'Where are your source files?',
79
- initial: 'src',
80
- validate: input => Boolean(input)
81
- });
82
- let entryFile;
83
- if (await _fsExtra.default.pathExists(_path.default.join(root, source, 'index.js'))) {
84
- entryFile = 'index.js';
85
- } else if (await _fsExtra.default.pathExists(_path.default.join(root, source, 'index.ts'))) {
86
- entryFile = 'index.ts';
87
- } else if (await _fsExtra.default.pathExists(_path.default.join(root, source, 'index.tsx'))) {
88
- entryFile = 'index.tsx';
89
- }
90
- if (!entryFile) {
91
- logger.error(`Couldn't find a 'index.js'. 'index.ts' or 'index.tsx' file under '${source}'.\n Please re-run the CLI after creating it.`);
92
- process.exit(1);
93
- }
94
- pkg.devDependencies = Object.fromEntries([...Object.entries(pkg.devDependencies || {}), [name, `^${version}`]].sort(([a], [b]) => a.localeCompare(b)));
95
- const questions = [{
96
- type: 'text',
97
- name: 'output',
98
- message: 'Where do you want to generate the output files?',
99
- initial: 'lib',
100
- validate: input => Boolean(input)
101
- }, {
102
- type: 'multiselect',
103
- name: 'targets',
104
- message: 'Which targets do you want to build?',
105
- choices: [{
106
- title: 'commonjs - for running in Node (tests, SSR etc.)',
107
- value: 'commonjs',
108
- selected: true
109
- }, {
110
- title: 'module - for bundlers (metro, webpack etc.)',
111
- value: 'module',
112
- selected: true
113
- }, {
114
- title: 'typescript - declaration files for typechecking',
115
- value: 'typescript',
116
- selected: /\.tsx?$/.test(entryFile)
117
- }],
118
- validate: input => Boolean(input.length)
119
- }];
120
- if (entryFile.endsWith('.js') && FLOW_PRGAMA_REGEX.test(await _fsExtra.default.readFile(_path.default.join(root, source, entryFile), 'utf-8'))) {
121
- questions.push({
122
- type: 'confirm',
123
- name: 'flow',
124
- message: 'Do you want to publish definitions for flow?',
125
- initial: Object.keys(pkg.devDependencies || {}).includes('flow-bin')
126
- });
127
- }
128
- const {
129
- output,
130
- targets,
131
- flow
132
- } = await (0, _prompts.default)(questions);
133
- const target = targets[0] === 'commonjs' || targets[0] === 'module' ? targets[0] : undefined;
134
- const entries = {
135
- source: `./${_path.default.join(source, entryFile)}`
136
- };
137
- let esm = false;
138
- if (targets.includes('module')) {
139
- esm = true;
140
- if (targets.includes('commonjs')) {
141
- entries.main = `./${_path.default.join(output, 'commonjs', 'index.js')}`;
142
- }
143
- entries.module = `./${_path.default.join(output, 'module', 'index.js')}`;
144
- } else if (targets.includes('commonjs')) {
145
- entries.main = `./${_path.default.join(output, 'commonjs', 'index.js')}`;
146
- } else {
147
- entries.main = entries.source;
148
- }
149
- const types = {};
150
- if (targets.includes('typescript')) {
151
- types.require = `./${_path.default.join(output, 'typescript', 'commonjs', source, 'index.d.ts')}`;
152
- types.import = `./${_path.default.join(output, 'typescript', 'module', source, 'index.d.ts')}`;
153
- entries.types = types.require;
154
- if (!(await _fsExtra.default.pathExists(_path.default.join(root, 'tsconfig.json')))) {
155
- const {
156
- tsconfig
157
- } = await (0, _prompts.default)({
158
- type: 'confirm',
159
- name: 'tsconfig',
160
- message: `You have enabled 'typescript' compilation, but we couldn't find a 'tsconfig.json' in project root.\n Generate one?`,
161
- initial: true
162
- });
163
- if (tsconfig) {
164
- await _fsExtra.default.writeJSON(_path.default.join(root, 'tsconfig.json'), {
165
- compilerOptions: {
166
- rootDir: '.',
167
- allowUnreachableCode: false,
168
- allowUnusedLabels: false,
169
- esModuleInterop: true,
170
- forceConsistentCasingInFileNames: true,
171
- jsx: 'react-jsx',
172
- lib: ['ESNext'],
173
- module: 'ESNext',
174
- moduleResolution: 'Bundler',
175
- noFallthroughCasesInSwitch: true,
176
- noImplicitReturns: true,
177
- noImplicitUseStrict: false,
178
- noStrictGenericChecks: false,
179
- noUncheckedIndexedAccess: true,
180
- noUnusedLocals: true,
181
- noUnusedParameters: true,
182
- resolveJsonModule: true,
183
- skipLibCheck: true,
184
- strict: true,
185
- target: 'ESNext',
186
- verbatimModuleSyntax: true
187
- }
188
- }, {
189
- spaces: 2
190
- });
191
- }
192
- }
193
- }
194
- const prepare = 'bob build';
195
- const files = [source, output, '!**/__tests__', '!**/__fixtures__', '!**/__mocks__'];
196
- for (const key in entries) {
197
- const entry = entries[key];
198
- if (pkg[key] && pkg[key] !== entry) {
199
- const {
200
- replace
201
- } = await (0, _prompts.default)({
202
- type: 'confirm',
203
- name: 'replace',
204
- message: `Your package.json has the '${key}' field set to '${pkg[key]}'.\n Do you want to replace it with '${entry}'?`,
205
- initial: true
206
- });
207
- if (replace) {
208
- pkg[key] = entry;
209
- }
210
- } else {
211
- pkg[key] = entry;
212
- }
213
- }
214
- if (esm) {
215
- let replace = false;
216
- const exportsField = {
217
- '.': {
218
- import: {
219
- ...(types.import ? {
220
- types: types.import
221
- } : null),
222
- ...(entries.module ? {
223
- default: entries.module
224
- } : null)
225
- },
226
- require: {
227
- ...(types.require ? {
228
- types: types.require
229
- } : null),
230
- ...(entries.main ? {
231
- default: entries.main
232
- } : null)
233
- }
234
- }
235
- };
236
- if (pkg.codegenConfig && !pkg.codegenConfig.includesGeneratedCode) {
237
- // @ts-expect-error The exports is not strictly types therefore it doesn't know about the package.json property
238
- exportsField['./package.json'] = './package.json';
239
- }
240
- if (pkg.exports && JSON.stringify(pkg.exports) !== JSON.stringify(exportsField)) {
241
- replace = (await (0, _prompts.default)({
242
- type: 'confirm',
243
- name: 'replace',
244
- message: `Your package.json has 'exports' field set.\n Do you want to replace it?`,
245
- initial: true
246
- })).replace;
247
- } else {
248
- replace = true;
249
- }
250
- if (replace) {
251
- pkg.exports = exportsField;
252
- }
253
- }
254
- if (pkg['react-native'] && (pkg['react-native'].startsWith(source) || pkg['react-native'].startsWith(`./${source}`))) {
255
- const {
256
- remove
257
- } = await (0, _prompts.default)({
258
- type: 'confirm',
259
- name: 'remove',
260
- message: `Your package.json has the 'react-native' field pointing to source code.\n This can cause problems when customizing babel configuration.\n Do you want to remove it?`,
261
- initial: true
262
- });
263
- if (remove) {
264
- delete pkg['react-native'];
265
- }
266
- }
267
- if (pkg.scripts?.prepare && pkg.scripts.prepare !== prepare) {
268
- const {
269
- replace
270
- } = await (0, _prompts.default)({
271
- type: 'confirm',
272
- name: 'replace',
273
- message: `Your package.json has the 'scripts.prepare' field set to '${pkg.scripts.prepare}'.\n Do you want to replace it with '${prepare}'?`,
274
- initial: true
275
- });
276
- if (replace) {
277
- pkg.scripts.prepare = prepare;
278
- }
279
- } else {
280
- pkg.scripts = pkg.scripts || {};
281
- pkg.scripts.prepare = prepare;
282
- }
283
- if (pkg.files) {
284
- const pkgFiles = pkg.files;
285
- if (files?.some(file => !pkgFiles.includes(file))) {
286
- const {
287
- update
288
- } = await (0, _prompts.default)({
289
- type: 'confirm',
290
- name: 'update',
291
- message: `Your package.json already has a 'files' field.\n Do you want to update it?`,
292
- initial: true
293
- });
294
- if (update) {
295
- pkg.files = [...files, ...pkg.files.filter(file => !files.includes(file))];
296
- }
297
- }
298
- } else {
299
- pkg.files = files;
300
- }
301
- pkg[name] = {
302
- source,
303
- output,
304
- targets: targets.map(t => {
305
- if (t === target && flow) {
306
- return [t, {
307
- copyFlow: true
308
- }];
309
- }
310
- if (t === 'commonjs' || t === 'module' || t === 'typescript') {
311
- return [t, {
312
- esm
313
- }];
314
- }
315
- return t;
316
- })
317
- };
318
- if (pkg.jest) {
319
- const entry = `<rootDir>/${output}/`;
320
- if (pkg.jest.modulePathIgnorePatterns) {
321
- const {
322
- modulePathIgnorePatterns
323
- } = pkg.jest;
324
- if (!modulePathIgnorePatterns.includes(entry)) {
325
- modulePathIgnorePatterns.push(entry);
326
- }
327
- } else {
328
- pkg.jest.modulePathIgnorePatterns = [entry];
329
- }
330
- }
331
- pkg.eslintIgnore = pkg.eslintIgnore || ['node_modules/'];
332
- if (!pkg.eslintIgnore.includes(`${output}/`)) {
333
- pkg.eslintIgnore.push(`${output}/`);
334
- }
335
- await _fsExtra.default.writeJSON(projectPackagePath, pkg, {
336
- spaces: 2
337
- });
338
- const ignorefiles = [_path.default.join(root, '.gitignore'), _path.default.join(root, '.eslintignore')];
339
- for (const ignorefile of ignorefiles) {
340
- if (await _fsExtra.default.pathExists(ignorefile)) {
341
- const content = await _fsExtra.default.readFile(ignorefile, 'utf-8');
342
- if (!content.split('\n').includes(`${output}/`)) {
343
- await _fsExtra.default.writeFile(ignorefile, `${content}\n# generated by bob\n${output}/\n`);
344
- }
345
- }
346
- }
347
- const packageManager = (await _fsExtra.default.pathExists(_path.default.join(root, 'yarn.lock'))) ? 'yarn' : 'npm';
348
- console.log((0, _dedent.default)(`
349
- Project ${_kleur.default.yellow(pkg.name)} configured successfully!
350
-
351
- ${_kleur.default.magenta(`${_kleur.default.bold('Perform last steps')} by running`)}${_kleur.default.gray(':')}
352
-
353
- ${_kleur.default.gray('$')} ${packageManager} install
354
-
355
- ${_kleur.default.yellow('Good luck!')}
356
- `));
357
- }).command('build', 'build files for publishing', args, async argv => {
358
- if (!(await _fsExtra.default.pathExists(projectPackagePath))) {
359
- throw new Error(`Couldn't find a 'package.json' file in '${root}'. Are you in a project folder?`);
360
- }
361
- const result = await explorer.search();
362
- if (!result?.config) {
363
- logger.error(`No configuration found. Run '${argv.$0} init' to create one automatically.`);
364
- process.exit(1);
365
- }
366
- const options = result.config;
367
- if (!options.targets?.length) {
368
- logger.error(`No targets found in the configuration in '${_path.default.relative(root, result.filepath)}'.`);
369
- process.exit(1);
370
- }
371
- const source = options.source;
372
- if (!source) {
373
- logger.error(`No source option found in the configuration in '${_path.default.relative(root, result.filepath)}'.`);
374
- process.exit(1);
375
- }
376
- const output = options.output;
377
- if (!output) {
378
- logger.error(`No source option found in the configuration in '${_path.default.relative(root, result.filepath)}'.`);
379
- process.exit(1);
380
- }
381
- const exclude = options.exclude ?? '**/{__tests__,__fixtures__,__mocks__}/**';
382
- if (argv.target != null) {
383
- buildTarget(argv.target, source, output, exclude);
384
- } else {
385
- for (const target of options.targets) {
386
- buildTarget(target, source, output, exclude);
387
- }
388
- }
389
- }).demandCommand().recommendCommands().strict().argv;
390
- async function buildTarget(target, source, output, exclude) {
391
- const targetName = Array.isArray(target) ? target[0] : target;
392
- const targetOptions = Array.isArray(target) ? target[1] : undefined;
393
- const report = logger.grouped(targetName);
394
- switch (targetName) {
395
- case 'commonjs':
396
- await (0, _commonjs.default)({
397
- root,
398
- source: _path.default.resolve(root, source),
399
- output: _path.default.resolve(root, output, 'commonjs'),
400
- exclude,
401
- options: targetOptions,
402
- report
403
- });
404
- break;
405
- case 'module':
406
- await (0, _module.default)({
407
- root,
408
- source: _path.default.resolve(root, source),
409
- output: _path.default.resolve(root, output, 'module'),
410
- exclude,
411
- options: targetOptions,
412
- report
413
- });
414
- break;
415
- case 'typescript':
416
- await (0, _typescript.default)({
417
- root,
418
- source: _path.default.resolve(root, source),
419
- output: _path.default.resolve(root, output, 'typescript'),
420
- options: targetOptions,
421
- report
422
- });
423
- break;
424
- case 'codegen':
425
- await (0, _codegen.default)({
426
- root,
427
- source: _path.default.resolve(root, source),
428
- output: _path.default.resolve(root, output, 'typescript'),
429
- report
430
- });
431
- break;
432
- case 'custom':
433
- await (0, _custom.default)({
434
- options: targetOptions,
435
- source: _path.default.resolve(root, source),
436
- report,
437
- root
438
- });
439
- break;
440
- default:
441
- logger.error(`Invalid target ${_kleur.default.blue(targetName)}.`);
442
- process.exit(1);
443
- }
444
- }
14
+ _yargs.default.command('init', 'configure the package to use bob', {}, _init.init).command('build', 'build files for publishing', args, _build.build).demandCommand().recommendCommands().strict().argv;
445
15
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_path","_interopRequireDefault","require","_fsExtra","_kleur","_dedent","_yargs","_cosmiconfig","_isGitDirty","_prompts","logger","_interopRequireWildcard","_commonjs","_module","_typescript","_codegen","_custom","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","args","target","type","description","choices","name","version","root","process","cwd","explorer","cosmiconfig","stopDir","searchPlaces","projectPackagePath","path","resolve","FLOW_PRGAMA_REGEX","yargs","command","isGitDirty","shouldContinue","prompts","message","initial","exit","fs","pathExists","error","pkg","JSON","parse","readFile","result","search","config","devDependencies","source","validate","input","Boolean","entryFile","join","fromEntries","entries","sort","b","localeCompare","questions","title","value","selected","test","length","endsWith","push","keys","includes","output","targets","flow","undefined","esm","main","module","types","import","tsconfig","writeJSON","compilerOptions","rootDir","allowUnreachableCode","allowUnusedLabels","esModuleInterop","forceConsistentCasingInFileNames","jsx","lib","moduleResolution","noFallthroughCasesInSwitch","noImplicitReturns","noImplicitUseStrict","noStrictGenericChecks","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","resolveJsonModule","skipLibCheck","strict","verbatimModuleSyntax","spaces","prepare","files","key","entry","replace","exportsField","codegenConfig","includesGeneratedCode","exports","stringify","startsWith","remove","scripts","pkgFiles","some","file","update","filter","map","copyFlow","jest","modulePathIgnorePatterns","eslintIgnore","ignorefiles","ignorefile","content","split","writeFile","packageManager","console","log","dedent","kleur","yellow","magenta","bold","gray","argv","Error","$0","options","relative","filepath","exclude","buildTarget","demandCommand","recommendCommands","targetName","Array","isArray","targetOptions","report","grouped","buildCommonJS","buildModule","buildTypescript","buildCodegen","customTarget","blue"],"sources":["../src/index.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\nimport kleur from 'kleur';\nimport dedent from 'dedent';\nimport yargs from 'yargs';\nimport { cosmiconfig } from 'cosmiconfig';\nimport isGitDirty from 'is-git-dirty';\nimport prompts, { type PromptObject } from './utils/prompts';\nimport * as logger from './utils/logger';\nimport buildCommonJS from './targets/commonjs';\nimport buildModule from './targets/module';\nimport buildTypescript from './targets/typescript';\nimport buildCodegen from './targets/codegen';\nimport customTarget from './targets/custom';\nimport type { Options, Target } from './types';\n\ntype ArgName = 'target';\n\nconst args = {\n target: {\n type: 'string',\n description: 'The target to build',\n choices: ['commonjs', 'module', 'typescript', 'codegen'] satisfies Target[],\n },\n} satisfies Record<ArgName, yargs.Options>;\n\n// eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-var-requires\nconst { name, version } = require('../package.json');\n\nconst root = process.cwd();\nconst explorer = cosmiconfig(name, {\n stopDir: root,\n searchPlaces: [\n 'package.json',\n 'bob.config.mjs',\n 'bob.config.cjs',\n 'bob.config.js',\n ],\n});\n\nconst projectPackagePath = path.resolve(root, 'package.json');\n\nconst FLOW_PRGAMA_REGEX = /\\*?\\s*@(flow)\\b/m;\n\nyargs\n .command('init', 'configure the package to use bob', {}, async () => {\n if (isGitDirty()) {\n const { shouldContinue } = await prompts({\n type: 'confirm',\n name: 'shouldContinue',\n message: `The working directory is not clean.\\n You should commit or stash your changes before configuring bob.\\n Continue anyway?`,\n initial: false,\n });\n\n if (!shouldContinue) {\n process.exit(0);\n }\n }\n\n if (!(await fs.pathExists(projectPackagePath))) {\n logger.error(\n `Couldn't find a 'package.json' file in '${root}'.\\n Are you in a project folder?`\n );\n process.exit(1);\n }\n\n const pkg = JSON.parse(await fs.readFile(projectPackagePath, 'utf-8'));\n const result = await explorer.search();\n\n if (result?.config && pkg.devDependencies && name in pkg.devDependencies) {\n const { shouldContinue } = await prompts({\n type: 'confirm',\n name: 'shouldContinue',\n message: `The project seems to be already configured with bob.\\n Do you want to overwrite the existing configuration?`,\n initial: false,\n });\n\n if (!shouldContinue) {\n process.exit(0);\n }\n }\n\n const { source } = await prompts({\n type: 'text',\n name: 'source',\n message: 'Where are your source files?',\n initial: 'src',\n validate: (input) => Boolean(input),\n });\n\n let entryFile;\n\n if (await fs.pathExists(path.join(root, source, 'index.js'))) {\n entryFile = 'index.js';\n } else if (await fs.pathExists(path.join(root, source, 'index.ts'))) {\n entryFile = 'index.ts';\n } else if (await fs.pathExists(path.join(root, source, 'index.tsx'))) {\n entryFile = 'index.tsx';\n }\n\n if (!entryFile) {\n logger.error(\n `Couldn't find a 'index.js'. 'index.ts' or 'index.tsx' file under '${source}'.\\n Please re-run the CLI after creating it.`\n );\n process.exit(1);\n }\n\n pkg.devDependencies = Object.fromEntries(\n [\n ...Object.entries(pkg.devDependencies || {}),\n [name, `^${version}`],\n ].sort(([a], [b]) => a.localeCompare(b))\n );\n\n const questions: PromptObject[] = [\n {\n type: 'text',\n name: 'output',\n message: 'Where do you want to generate the output files?',\n initial: 'lib',\n validate: (input: string) => Boolean(input),\n },\n {\n type: 'multiselect',\n name: 'targets',\n message: 'Which targets do you want to build?',\n choices: [\n {\n title: 'commonjs - for running in Node (tests, SSR etc.)',\n value: 'commonjs',\n selected: true,\n },\n {\n title: 'module - for bundlers (metro, webpack etc.)',\n value: 'module',\n selected: true,\n },\n {\n title: 'typescript - declaration files for typechecking',\n value: 'typescript',\n selected: /\\.tsx?$/.test(entryFile),\n },\n ],\n validate: (input: string) => Boolean(input.length),\n },\n ];\n\n if (\n entryFile.endsWith('.js') &&\n FLOW_PRGAMA_REGEX.test(\n await fs.readFile(path.join(root, source, entryFile), 'utf-8')\n )\n ) {\n questions.push({\n type: 'confirm',\n name: 'flow',\n message: 'Do you want to publish definitions for flow?',\n initial: Object.keys(pkg.devDependencies || {}).includes('flow-bin'),\n });\n }\n\n const { output, targets, flow } = await prompts(questions);\n\n const target =\n targets[0] === 'commonjs' || targets[0] === 'module'\n ? targets[0]\n : undefined;\n\n const entries: {\n [key in 'source' | 'main' | 'module' | 'types']?: string;\n } = {\n source: `./${path.join(source, entryFile)}`,\n };\n\n let esm = false;\n\n if (targets.includes('module')) {\n esm = true;\n\n if (targets.includes('commonjs')) {\n entries.main = `./${path.join(output, 'commonjs', 'index.js')}`;\n }\n\n entries.module = `./${path.join(output, 'module', 'index.js')}`;\n } else if (targets.includes('commonjs')) {\n entries.main = `./${path.join(output, 'commonjs', 'index.js')}`;\n } else {\n entries.main = entries.source;\n }\n\n const types: {\n [key in 'require' | 'import']?: string;\n } = {};\n\n if (targets.includes('typescript')) {\n types.require = `./${path.join(\n output,\n 'typescript',\n 'commonjs',\n source,\n 'index.d.ts'\n )}`;\n\n types.import = `./${path.join(\n output,\n 'typescript',\n 'module',\n source,\n 'index.d.ts'\n )}`;\n\n entries.types = types.require;\n\n if (!(await fs.pathExists(path.join(root, 'tsconfig.json')))) {\n const { tsconfig } = await prompts({\n type: 'confirm',\n name: 'tsconfig',\n message: `You have enabled 'typescript' compilation, but we couldn't find a 'tsconfig.json' in project root.\\n Generate one?`,\n initial: true,\n });\n\n if (tsconfig) {\n await fs.writeJSON(\n path.join(root, 'tsconfig.json'),\n {\n compilerOptions: {\n rootDir: '.',\n allowUnreachableCode: false,\n allowUnusedLabels: false,\n esModuleInterop: true,\n forceConsistentCasingInFileNames: true,\n jsx: 'react-jsx',\n lib: ['ESNext'],\n module: 'ESNext',\n moduleResolution: 'Bundler',\n noFallthroughCasesInSwitch: true,\n noImplicitReturns: true,\n noImplicitUseStrict: false,\n noStrictGenericChecks: false,\n noUncheckedIndexedAccess: true,\n noUnusedLocals: true,\n noUnusedParameters: true,\n resolveJsonModule: true,\n skipLibCheck: true,\n strict: true,\n target: 'ESNext',\n verbatimModuleSyntax: true,\n },\n },\n { spaces: 2 }\n );\n }\n }\n }\n\n const prepare = 'bob build';\n const files = [\n source,\n output,\n '!**/__tests__',\n '!**/__fixtures__',\n '!**/__mocks__',\n ];\n\n for (const key in entries) {\n const entry = entries[key as keyof typeof entries];\n\n if (pkg[key] && pkg[key] !== entry) {\n const { replace } = await prompts({\n type: 'confirm',\n name: 'replace',\n message: `Your package.json has the '${key}' field set to '${pkg[key]}'.\\n Do you want to replace it with '${entry}'?`,\n initial: true,\n });\n\n if (replace) {\n pkg[key] = entry;\n }\n } else {\n pkg[key] = entry;\n }\n }\n\n if (esm) {\n let replace = false;\n\n const exportsField = {\n '.': {\n import: {\n ...(types.import ? { types: types.import } : null),\n ...(entries.module ? { default: entries.module } : null),\n },\n require: {\n ...(types.require ? { types: types.require } : null),\n ...(entries.main ? { default: entries.main } : null),\n },\n },\n };\n\n if (pkg.codegenConfig && !pkg.codegenConfig.includesGeneratedCode) {\n // @ts-expect-error The exports is not strictly types therefore it doesn't know about the package.json property\n exportsField['./package.json'] = './package.json';\n }\n\n if (\n pkg.exports &&\n JSON.stringify(pkg.exports) !== JSON.stringify(exportsField)\n ) {\n replace = (\n await prompts({\n type: 'confirm',\n name: 'replace',\n message: `Your package.json has 'exports' field set.\\n Do you want to replace it?`,\n initial: true,\n })\n ).replace;\n } else {\n replace = true;\n }\n\n if (replace) {\n pkg.exports = exportsField;\n }\n }\n\n if (\n pkg['react-native'] &&\n (pkg['react-native'].startsWith(source) ||\n pkg['react-native'].startsWith(`./${source}`))\n ) {\n const { remove } = await prompts({\n type: 'confirm',\n name: 'remove',\n message: `Your package.json has the 'react-native' field pointing to source code.\\n This can cause problems when customizing babel configuration.\\n Do you want to remove it?`,\n initial: true,\n });\n\n if (remove) {\n delete pkg['react-native'];\n }\n }\n\n if (pkg.scripts?.prepare && pkg.scripts.prepare !== prepare) {\n const { replace } = await prompts({\n type: 'confirm',\n name: 'replace',\n message: `Your package.json has the 'scripts.prepare' field set to '${pkg.scripts.prepare}'.\\n Do you want to replace it with '${prepare}'?`,\n initial: true,\n });\n\n if (replace) {\n pkg.scripts.prepare = prepare;\n }\n } else {\n pkg.scripts = pkg.scripts || {};\n pkg.scripts.prepare = prepare;\n }\n\n if (pkg.files) {\n const pkgFiles = pkg.files;\n\n if (files?.some((file) => !pkgFiles.includes(file))) {\n const { update } = await prompts({\n type: 'confirm',\n name: 'update',\n message: `Your package.json already has a 'files' field.\\n Do you want to update it?`,\n initial: true,\n });\n\n if (update) {\n pkg.files = [\n ...files,\n ...pkg.files.filter((file: string) => !files.includes(file)),\n ];\n }\n }\n } else {\n pkg.files = files;\n }\n\n pkg[name] = {\n source,\n output,\n targets: targets.map((t: string) => {\n if (t === target && flow) {\n return [t, { copyFlow: true }];\n }\n\n if (t === 'commonjs' || t === 'module' || t === 'typescript') {\n return [t, { esm }];\n }\n\n return t;\n }),\n };\n\n if (pkg.jest) {\n const entry = `<rootDir>/${output}/`;\n\n if (pkg.jest.modulePathIgnorePatterns) {\n const { modulePathIgnorePatterns } = pkg.jest;\n\n if (!modulePathIgnorePatterns.includes(entry)) {\n modulePathIgnorePatterns.push(entry);\n }\n } else {\n pkg.jest.modulePathIgnorePatterns = [entry];\n }\n }\n\n pkg.eslintIgnore = pkg.eslintIgnore || ['node_modules/'];\n\n if (!pkg.eslintIgnore.includes(`${output}/`)) {\n pkg.eslintIgnore.push(`${output}/`);\n }\n\n await fs.writeJSON(projectPackagePath, pkg, {\n spaces: 2,\n });\n\n const ignorefiles = [\n path.join(root, '.gitignore'),\n path.join(root, '.eslintignore'),\n ];\n\n for (const ignorefile of ignorefiles) {\n if (await fs.pathExists(ignorefile)) {\n const content = await fs.readFile(ignorefile, 'utf-8');\n\n if (!content.split('\\n').includes(`${output}/`)) {\n await fs.writeFile(\n ignorefile,\n `${content}\\n# generated by bob\\n${output}/\\n`\n );\n }\n }\n }\n\n const packageManager = (await fs.pathExists(path.join(root, 'yarn.lock')))\n ? 'yarn'\n : 'npm';\n\n console.log(\n dedent(`\n Project ${kleur.yellow(pkg.name)} configured successfully!\n\n ${kleur.magenta(\n `${kleur.bold('Perform last steps')} by running`\n )}${kleur.gray(':')}\n\n ${kleur.gray('$')} ${packageManager} install\n\n ${kleur.yellow('Good luck!')}\n `)\n );\n })\n .command('build', 'build files for publishing', args, async (argv) => {\n if (!(await fs.pathExists(projectPackagePath))) {\n throw new Error(\n `Couldn't find a 'package.json' file in '${root}'. Are you in a project folder?`\n );\n }\n\n const result = await explorer.search();\n\n if (!result?.config) {\n logger.error(\n `No configuration found. Run '${argv.$0} init' to create one automatically.`\n );\n process.exit(1);\n }\n\n const options: Options = result!.config;\n\n if (!options.targets?.length) {\n logger.error(\n `No targets found in the configuration in '${path.relative(\n root,\n result!.filepath\n )}'.`\n );\n process.exit(1);\n }\n\n const source = options.source;\n\n if (!source) {\n logger.error(\n `No source option found in the configuration in '${path.relative(\n root,\n result!.filepath\n )}'.`\n );\n process.exit(1);\n }\n\n const output = options.output;\n\n if (!output) {\n logger.error(\n `No source option found in the configuration in '${path.relative(\n root,\n result!.filepath\n )}'.`\n );\n process.exit(1);\n }\n\n const exclude =\n options.exclude ?? '**/{__tests__,__fixtures__,__mocks__}/**';\n\n if (argv.target != null) {\n buildTarget(argv.target, source as string, output as string, exclude);\n } else {\n for (const target of options.targets!) {\n buildTarget(target, source as string, output as string, exclude);\n }\n }\n })\n .demandCommand()\n .recommendCommands()\n .strict().argv;\n\nasync function buildTarget(\n target: Exclude<Options['targets'], undefined>[number],\n source: string,\n output: string,\n exclude: string\n) {\n const targetName = Array.isArray(target) ? target[0] : target;\n const targetOptions = Array.isArray(target) ? target[1] : undefined;\n\n const report = logger.grouped(targetName);\n\n switch (targetName) {\n case 'commonjs':\n await buildCommonJS({\n root,\n source: path.resolve(root, source),\n output: path.resolve(root, output, 'commonjs'),\n exclude,\n options: targetOptions,\n report,\n });\n break;\n case 'module':\n await buildModule({\n root,\n source: path.resolve(root, source),\n output: path.resolve(root, output, 'module'),\n exclude,\n options: targetOptions,\n report,\n });\n break;\n case 'typescript':\n await buildTypescript({\n root,\n source: path.resolve(root, source),\n output: path.resolve(root, output, 'typescript'),\n options: targetOptions,\n report,\n });\n break;\n case 'codegen':\n await buildCodegen({\n root,\n source: path.resolve(root, source),\n output: path.resolve(root, output, 'typescript'),\n report,\n });\n break;\n case 'custom':\n await customTarget({\n options: targetOptions,\n source: path.resolve(root, source),\n report,\n root,\n });\n break;\n default:\n logger.error(`Invalid target ${kleur.blue(targetName)}.`);\n process.exit(1);\n }\n}\n"],"mappings":";;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAC,uBAAA,CAAAT,OAAA;AACA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,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MAAM,IAAAM,eAAY,EAAC;QACjBjB,OAAO,EAAEU,aAAa;QACtBvG,MAAM,EAAEtB,aAAI,CAACC,OAAO,CAACT,IAAI,EAAE8B,MAAM,CAAC;QAClCwG,MAAM;QACNtI;MACF,CAAC,CAAC;MACF;IACF;MACElC,MAAM,CAACuD,KAAK,CAAC,kBAAkB8F,cAAK,CAAC0B,IAAI,CAACX,UAAU,CAAC,GAAG,CAAC;MACzDjI,OAAO,CAACiB,IAAI,CAAC,CAAC,CAAC;EACnB;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_yargs","_interopRequireDefault","require","_build","_init","e","__esModule","default","args","target","type","description","choices","yargs","command","init","build","demandCommand","recommendCommands","strict","argv"],"sources":["../src/index.ts"],"sourcesContent":["import yargs from 'yargs';\nimport { build } from './build';\nimport { init } from './init';\nimport type { Target } from './types';\n\ntype ArgName = 'target';\n\nconst args = {\n target: {\n type: 'string',\n description: 'The target to build',\n choices: ['commonjs', 'module', 'typescript', 'codegen'] satisfies Target[],\n },\n} satisfies Record<ArgName, yargs.Options>;\n\nyargs\n .command('init', 'configure the package to use bob', {}, init)\n .command('build', 'build files for publishing', args, build)\n .demandCommand()\n .recommendCommands()\n .strict().argv;\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA8B,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK9B,MAAMG,IAAI,GAAG;EACXC,MAAM,EAAE;IACNC,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE,qBAAqB;IAClCC,OAAO,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS;EACzD;AACF,CAA0C;AAE1CC,cAAK,CACFC,OAAO,CAAC,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC,EAAEC,UAAI,CAAC,CAC7DD,OAAO,CAAC,OAAO,EAAE,4BAA4B,EAAEN,IAAI,EAAEQ,YAAK,CAAC,CAC3DC,aAAa,CAAC,CAAC,CACfC,iBAAiB,CAAC,CAAC,CACnBC,MAAM,CAAC,CAAC,CAACC,IAAI","ignoreList":[]}