-
-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy pathComparisonTable.tsx
804 lines (782 loc) · 16.8 KB
/
ComparisonTable.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
import { Markdown } from 'docusaurus-plugin-typedoc-api/lib/components/Markdown';
const SUPPORTED = '🟩';
const PARTIALLY_SUPPORTED = '🟨';
const SIMILARLY_SUPPORTED = '🟦';
const NOT_SUPPORTED = '🟥';
type Comparable = 'moon' | 'nx' | 'turborepo';
interface Comparison {
feature: string;
support: Partial<Record<Comparable, string[] | string>>;
}
const headers: Comparable[] = ['moon', 'nx', 'turborepo'];
const workspaceRows: Comparison[] = [
{
feature: 'Core/CLI written in',
support: {
moon: 'Rust',
nx: 'Node.js & Rust (for hot paths)',
turborepo: 'Rust / Go',
},
},
{
feature: 'Plugins written in',
support: {
moon: 'WASM (any compatible language)',
nx: 'TypeScript',
},
},
{
feature: 'Workspace configured with',
support: {
moon: '`.moon/workspace.yml`',
nx: '`nx.json`',
turborepo: '`turbo.json`',
},
},
{
feature: 'Project list configured in',
support: {
moon: '`.moon/workspace.yml`',
nx: '`workspace.json` / `package.json` workspaces',
turborepo: '`package.json` workspaces',
},
},
{
feature: 'Repo / folder structure',
support: {
moon: 'loose',
nx: 'loose',
turborepo: 'loose',
},
},
{
feature: 'Ignore file support',
support: {
moon: [SUPPORTED, 'via `hasher.ignorePatterns`'],
nx: [SUPPORTED, '.nxignore'],
turborepo: [SUPPORTED, 'via `--ignore`'],
},
},
{
feature: 'Supports dependencies inherited by all tasks',
support: {
moon: [SUPPORTED, 'via `implicitDeps`'],
nx: [SUPPORTED, 'via `targetDefaults`'],
},
},
{
feature: 'Supports inputs inherited by all tasks',
support: {
moon: [SUPPORTED, 'via `implicitInputs`'],
nx: [SUPPORTED, 'via `implicitDependencies`'],
turborepo: [SUPPORTED, 'via `globalDependencies`'],
},
},
{
feature: 'Supports tasks inherited by all projects',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'via `plugins`'],
},
},
{
feature: 'Integrates with a version control system',
support: {
moon: [SUPPORTED, 'git'],
nx: [SUPPORTED, 'git'],
turborepo: [SUPPORTED, 'git'],
},
},
{
feature: 'Supports scaffolding / generators',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
];
const toolchainRows: Comparison[] = [
{
feature: 'Supported languages in task runner',
support: {
moon: 'All languages available on `PATH`',
nx: 'All languages via plugins. OOTB TS/JS, existing plugins for Rust, Go, Dotnet and more',
turborepo: 'JavaScriptTypeScript via `package.json` scripts',
},
},
{
feature: 'Supported dependency managers',
support: {
moon: 'npm, pnpm, yarn, bun',
nx: 'npm, pnpm, yarn',
turborepo: 'npm, pnpm, yarn',
},
},
{
feature: 'Supported toolchain languages (automatic dev envs)',
support: {
moon: 'Bun, Deno, Node.js, Rust',
},
},
{
feature: 'Has a built-in toolchain',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Downloads and installs languages (when applicable)',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Configures explicit language/dependency manager versions',
support: {
moon: SUPPORTED,
},
},
];
const projectsRows: Comparison[] = [
{
feature: 'Dependencies on other projects',
support: {
moon: [SUPPORTED, 'implicit from `package.json` or explicit in `moon.yml`'],
nx: [
SUPPORTED,
'implicit from `package.json` or explicit in `project.json` and code imports/exports',
],
turborepo: [SUPPORTED, 'implicit from `package.json`'],
},
},
{
feature: 'Ownership metadata',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Primary programming language',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Project type (app, lib, etc)',
support: {
moon: [SUPPORTED, 'app, lib, tool, automation, config, scaffold'],
nx: [SUPPORTED, 'app, lib'],
},
},
{
feature: 'Project tech stack',
support: {
moon: [SUPPORTED, 'frontend, backend, infra, systems'],
},
},
{
feature: 'Project-level file groups',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'via `namedInputs`'],
},
},
{
feature: 'Project-level tasks',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Tags and scopes (boundaries)',
support: {
moon: [SUPPORTED, 'native for all languages'],
nx: [SUPPORTED, 'boundaries via ESLint (TS and JS), tags for filtering for all languages'],
},
},
];
const tasksRows: Comparison[] = [
{
feature: 'Known as',
support: {
moon: 'tasks',
nx: 'targets',
turborepo: 'tasks',
},
},
{
feature: 'Defines tasks in',
support: {
moon: '`moon.yml` or `package.json` scripts',
nx: '`nx.json`, `project.json` or `package.json` scripts',
turborepo: '`package.json` scripts',
},
},
{
feature: 'Run a single task with',
support: {
moon: '`moon run project:task`',
nx: '`nx target project` or `nx run project:target`',
turborepo: '`turbo run task --filter=project`',
},
},
{
feature: 'Run multiple tasks with',
support: {
moon: '`moon run :task` or `moon run a:task b:task` or `moon check`',
nx: '`nx run-many -t task1 task2 task3`',
turborepo: '`turbo run task` or `turbo run a b c`',
},
},
{
feature: 'Run tasks based on a query/filter',
support: {
moon: '`moon run :task --query "..."`',
nx: '`nx run-many -t task -p "tag:.." -p "dir/*" -p "name*" -p "!negation"`',
},
},
{
feature: 'Can define tasks globally',
support: {
moon: [SUPPORTED, 'with `.moon/tasks.yml`'],
nx: [PARTIALLY_SUPPORTED, 'with `targetDefaults`'],
},
},
{
feature: 'Merges or overrides global tasks',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
},
},
{
feature: 'Runs a command with args',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: [PARTIALLY_SUPPORTED, 'within the script'],
},
},
{
feature: 'Runs commands from',
support: {
moon: 'project or workspace root',
nx: 'current working directory, or wherever desired via config',
turborepo: 'project root',
},
},
{
feature: 'Supports pipes, redirects, etc, in configured tasks',
support: {
moon: [PARTIALLY_SUPPORTED, 'encapsulated in a file'],
nx: [PARTIALLY_SUPPORTED, 'within the executor or script'],
turborepo: [PARTIALLY_SUPPORTED, 'within the script'],
},
},
{
feature: 'Dependencies on other tasks',
support: {
moon: [SUPPORTED, 'via `deps`'],
nx: [SUPPORTED, 'via `dependsOn`'],
turborepo: [SUPPORTED, 'via `dependsOn`'],
},
},
{
feature: 'Can provide extra params for task dependencies',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: NOT_SUPPORTED,
},
},
{
feature: 'Can mark a task dependency as optional',
support: {
moon: [SUPPORTED, 'via `optional`'],
},
},
{
feature: 'Can depend on arbitrary or unrelated tasks',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: [NOT_SUPPORTED, 'dependent projects only'],
},
},
{
feature: 'Runs task dependencies in parallel',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Can run task dependencies in serial',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'via `parallel=1`'],
turborepo: [SUPPORTED, 'via `concurrency=1`'],
},
},
{
feature: 'File groups',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'via `namedInputs`'],
},
},
{
feature: 'Environment variables',
support: {
moon: [SUPPORTED, 'via `env`, `envFile`'],
nx: [SUPPORTED, 'automatically via `.env` files and/or inherited from shell'],
turborepo: [PARTIALLY_SUPPORTED, 'within the script'],
},
},
{
feature: 'Inputs',
support: {
moon: [SUPPORTED, 'files, globs, env vars'],
nx: [SUPPORTED, 'files, globs, env vars, runtime'],
turborepo: [SUPPORTED, 'files, globs'],
},
},
{
feature: 'Outputs',
support: {
moon: [SUPPORTED, 'files, globs'],
nx: [SUPPORTED, 'files, globs'],
turborepo: [SUPPORTED, 'files, globs'],
},
},
{
feature: 'Output logging style',
support: {
moon: [SUPPORTED, 'via `outputStyle`'],
nx: [SUPPORTED, 'via `--output-style`'],
turborepo: [SUPPORTED, 'via `outputMode`'],
},
},
{
feature: 'Custom hash inputs',
support: {
nx: [SUPPORTED, 'via `runtime` inputs'],
turborepo: [SUPPORTED, 'via `globalDependencies`'],
},
},
{
feature: 'Token substitution',
support: {
moon: [SUPPORTED, 'token functions and variable syntax'],
nx: [
SUPPORTED,
'`{workspaceRoot}`, `{projectRoot}`, `{projectName}`, arbitrary patterns `namedInputs`',
],
},
},
{
feature: 'Configuration presets',
support: {
moon: [SUPPORTED, 'via task `extends`'],
nx: [SUPPORTED, 'via `configurations`'],
},
},
{
feature: 'Configurable options',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
];
const taskRunnerRows: Comparison[] = [
{
feature: 'Known as',
support: {
moon: 'action pipeline',
nx: 'task runner',
turborepo: 'pipeline',
},
},
{
feature: 'Generates a dependency graph',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Runs in topological order',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Automatically retries failed tasks',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'when flakiness detected on Nx Cloud'],
},
},
{
feature: 'Caches task outputs via a unique hash',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Can customize the underlying runner',
support: {
nx: SUPPORTED,
},
},
{
feature: 'Can profile running tasks',
support: {
moon: [SUPPORTED, 'cpu, heap'],
nx: [SUPPORTED, 'cpu'],
turborepo: [SUPPORTED, 'cpu'],
},
},
{
feature: 'Can generate run reports',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'free in Nx Cloud & GitHub App Comment'],
turborepo: SUPPORTED,
},
},
{
feature: 'Continuous integration (CI) support',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: PARTIALLY_SUPPORTED,
},
},
{
feature: 'Continuous deployment (CD) support',
support: {
nx: [PARTIALLY_SUPPORTED, 'via `nx release`'],
},
},
{
feature: 'Remote / cloud caching and syncing',
support: {
moon: [SUPPORTED, 'with Bazel REAPI (free / paid)'],
nx: [SUPPORTED, 'with nx.app Nx Cloud (free / paid)'],
turborepo: [SUPPORTED, 'requires a Vercel account (free)'],
},
},
];
const generatorRows: Comparison[] = [
{
feature: 'Known as',
support: {
moon: 'generator',
nx: 'generator',
turborepo: 'generator',
},
},
{
feature: 'Templates are configured with a schema',
support: {
moon: [SUPPORTED, 'via `template.yml`'],
nx: SUPPORTED,
},
},
{
feature: 'Template file extensions (optional)',
support: {
moon: [SUPPORTED, '.tera, .twig'],
nx: [SUPPORTED, 'fully under user control, built in utility for .ejs templates'],
turborepo: [SUPPORTED, '.hbs'],
},
},
{
feature: 'Template files support frontmatter',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'fully under user control'],
},
},
{
feature: 'Creates/copies files to destination',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Updates/merges with existing files',
support: {
moon: [SUPPORTED, 'JSON/YAML only'],
nx: [SUPPORTED, 'via TypeScript/JavaScript plugins'],
turborepo: SUPPORTED,
},
},
{
feature: 'Renders with a template engine',
support: {
moon: [SUPPORTED, 'via Tera'],
nx: [SUPPORTED, 'fully under user control, built in utility for .ejs templates'],
turborepo: [SUPPORTED, 'via Handlebars'],
},
},
{
feature: 'Variable interpolation in file content',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Variable interpolation in file paths',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Can define variable values via interactive prompts',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'using JSON schema'],
turborepo: SUPPORTED,
},
},
{
feature: 'Can define variable values via command line args',
support: {
moon: SUPPORTED,
nx: [SUPPORTED, 'using JSON schema'],
turborepo: SUPPORTED,
},
},
{
feature: 'Supports dry runs',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
},
},
{
feature: 'Supports render helpers, filters, and built-ins',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Generators can compose other generators',
support: {
moon: [SUPPORTED, 'via `extends`'],
nx: [SUPPORTED, 'fully under user control, author in TypeScript/JavaScript'],
turborepo: [SUPPORTED, 'using JavaScript'],
},
},
];
const otherSystemRows: Comparison[] = [
{
feature: 'Can send webhooks for critical pipeline events',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Generates run reports with granular stats/metrics',
support: {
moon: SUPPORTED,
turborepo: SUPPORTED,
},
},
{
feature: 'Can define and manage code owners',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can generate a `CODEOWNERS` file',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can define and manage VCS (git) hooks',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Supports git worktrees',
support: {
moon: SUPPORTED,
},
},
];
const javascriptRows: Comparison[] = [
{
feature: 'Will automatically install node modules when lockfile changes',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can automatically dedupe when lockfile changes',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can alias `package.json` names for projects',
support: {
moon: SUPPORTED,
nx: SUPPORTED,
},
},
{
feature: 'Can add `engines` constraint to root `package.json`',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can sync version manager configs (`.nvmrc`, etc)',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can sync cross-project dependencies to `package.json`',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can sync project references to applicable `tsconfig.json`',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can auto-create missing `tsconfig.json`',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can sync dependencies as `paths` to `tsconfig.json`',
support: {
moon: SUPPORTED,
},
},
{
feature: 'Can route `outDir` to a shared cached in `tsconfig.json`',
support: {
moon: SUPPORTED,
},
},
];
const dockerRows: Comparison[] = [
{
feature: 'Efficient scaffolding for Dockerfile layer caching',
support: {
moon: SUPPORTED,
nx: [SIMILARLY_SUPPORTED, 'via custom generator'],
turborepo: SUPPORTED,
},
},
{
feature: 'Automatic production-only dependency installation',
support: {
moon: SUPPORTED,
nx: [PARTIALLY_SUPPORTED, 'generated automatically by first party plugin'],
},
},
{
feature: 'Environment pruning to reduce image/container sizes',
support: {
moon: SUPPORTED,
turborepo: SUPPORTED,
},
},
];
function isSupported(data?: string[] | string): boolean {
if (!data) {
return false;
}
return (
data === SUPPORTED ||
(data !== NOT_SUPPORTED && data !== PARTIALLY_SUPPORTED && data !== SIMILARLY_SUPPORTED) ||
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
(Array.isArray(data) && data[0] === SUPPORTED)
);
}
function Cell({ content }: { content: string[] | string | undefined }) {
if (!content) {
return <>{NOT_SUPPORTED}</>;
}
// nbsp
const markdown = Array.isArray(content) ? content.join(' \u00A0') : content;
if (markdown === SUPPORTED || markdown === PARTIALLY_SUPPORTED) {
return <>{markdown}</>;
}
return <Markdown content={markdown} />;
}
function Table({ rows }: { rows: Comparison[] }) {
return (
<table width="100%">
<thead>
<tr>
<th />
{headers.map((header) => (
<th key={header} align="center">
{header} ({rows.filter((row) => isSupported(row.support[header])).length})
</th>
))}
</tr>
</thead>
<tbody>
{rows.map((row) => (
<tr key={row.feature}>
<td>
<Markdown content={row.feature} />
</td>
{headers.map((header) => (
<td key={row.feature + header} align="center">
<Cell content={row.support[header]} />
</td>
))}
</tr>
))}
</tbody>
</table>
);
}
function createTable(rows: Comparison[]) {
return () => <Table rows={rows} />;
}
export const DockerTable = createTable(dockerRows);
export const GeneratorTable = createTable(generatorRows);
export const JavaScriptTable = createTable(javascriptRows);
export const OtherSystemsTable = createTable(otherSystemRows);
export const ProjectsTable = createTable(projectsRows);
export const TasksTable = createTable(tasksRows);
export const TaskRunnerTable = createTable(taskRunnerRows);
export const ToolchainTable = createTable(toolchainRows);
export const WorkspaceTable = createTable(workspaceRows);