-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
1040 lines (973 loc) · 32.9 KB
/
build.sbt
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
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import org.scalajs.linker.interface.ModuleInitializer
ThisBuild / version := "0.1.0-SNAPSHOT"
// https://www.scala-lang.org/
val scala3Version = "3.6.2"
val scala2Version = "2.13.15"
ThisBuild / scalaVersion := scala3Version
ThisBuild / organization := "com.peknight"
Docker / packageName := "pek/demo"
Docker / maintainer := "peknight <JKpeknight@gmail.com>"
lazy val commonSettings = Seq(
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-unchecked",
"-Xfatal-warnings",
"-language:strictEquality",
"-Xmax-inlines:64"
// "-Ywarn-value-discard",
),
)
lazy val demo = (project in file("."))
.aggregate(
demoScala,
demoShapeless,
demoFpInScala,
demoCats,
demoCatsEffect,
demoCatsParse,
demoFs2,
demoFs2Grpc,
demoCirce,
demoMonocle,
demoLog4Cats,
demoCiris,
demoCatsStm,
demoCatsMtl,
demoSpire,
demoSquants,
demoHttp4s.jvm,
demoHttp4s.js,
demoDoobie,
demoRedis4Cats,
demoNatchez,
demoNeo4j,
demoNebula,
demoZio,
demoAkka,
demoScalaTest.jvm,
demoScalaTest.js,
demoScalaCheck,
demoJs.jvm,
demoJs.js,
demoJsModuleA,
demoJsModuleB,
demoFrontEnd.jvm,
demoFrontEnd.js,
demoFrontEndModuleNode,
demoFrontEndModuleVue,
demoFrontEndModuleZRender,
demoFrontEndModuleECharts,
demoFrontEndModuleSwiper,
demoFrontEndModuleFastClick,
demoFrontEndModuleZyMedia,
demoFrontEndModuleDemoVue,
demoFrontEndModuleHeimamm,
demoOAuth2.jvm,
demoOAuth2.js,
demoAcme4j,
demoSecurity,
demoPlayground.jvm,
demoPlayground.js,
)
.enablePlugins(JavaAppPackaging)
.settings(commonSettings)
.settings(
name := "demo",
)
lazy val demoScala = (project in file("demo-scala"))
.settings(commonSettings)
.settings(
name := "demo-scala",
libraryDependencies ++= Seq(
scalaTestFlatSpec % Test,
),
)
lazy val demoShapeless = (project in file("demo-shapeless"))
.settings(commonSettings)
.settings(
name := "demo-shapeless",
crossScalaVersions := List(scala3Version, scala2Version),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(
shapeless,
catsCore,
scalaCheck
)
case Some((2, _)) => Seq(
shapeless2,
catsCore,
scalaCheck
)
case _ => Seq()
}
},
scalacOptions --= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => Seq(
"-language:strictEquality",
"-Xmax-inlines:64"
)
case _ => Seq()
}
}
)
lazy val demoFpInScala = (project in file("demo-fp"))
.settings(commonSettings)
.settings(
name := "demo-fp",
libraryDependencies ++= Seq(
scalaCheck,
),
)
lazy val demoCats = (project in file("demo-cats"))
.settings(commonSettings)
.settings(
name := "demo-cats",
libraryDependencies ++= Seq(
catsCore,
catsLaws % Test,
),
)
lazy val demoCatsEffect = (project in file("demo-cats-effect"))
.settings(commonSettings)
.settings(
name := "demo-cats-effect",
libraryDependencies ++= Seq(
catsEffect,
catsEffectCps,
scalaTestFlatSpec % Test,
scalaTestShouldMatchers % Test,
catsEffectTestkit % Test,
catsEffectTestingSpecs % Test,
catsEffectTestingScalaTest % Test,
mUnitCatsEffect % Test,
weaverCats % Test,
),
)
lazy val demoCatsParse = (project in file("demo-cats-parse"))
.settings(commonSettings)
.settings(
name := "demo-cats-parse",
libraryDependencies ++= Seq(
catsParse,
jawnAst,
),
)
lazy val demoFs2 = (project in file("demo-fs2"))
.settings(commonSettings)
.settings(
name := "demo-fs2",
libraryDependencies ++= Seq(
fs2Core,
fs2IO,
fs2ReactiveStreams,
fs2Scodec,
),
)
lazy val demoFs2Grpc = (project in file("demo-fs2-grpc"))
.aggregate(demoFs2GrpcProtobuf, demoFs2GrpcClient, demoFs2GrpcServer)
.settings(commonSettings)
.settings(
name := "demo-fs2-grpc",
)
lazy val demoFs2GrpcProtobuf = (project in file("demo-fs2-grpc/protobuf"))
.enablePlugins(Fs2Grpc)
.settings(commonSettings)
.settings(
name := "demo-fs2-grpc-protobuf",
scalacOptions --= Seq(
"-Xfatal-warnings",
)
)
lazy val demoFs2GrpcClient = (project in file("demo-fs2-grpc/client"))
.dependsOn(demoFs2GrpcProtobuf)
.settings(commonSettings)
.settings(
name := "demo-fs2-grpc-client",
libraryDependencies ++= Seq(
grpcNettyShaded,
)
)
lazy val demoFs2GrpcServer = (project in file("demo-fs2-grpc/server"))
.dependsOn(demoFs2GrpcProtobuf)
.settings(commonSettings)
.settings(
name := "demo-fs2-grpc-server",
libraryDependencies ++= Seq(
grpcNettyShaded,
)
)
lazy val demoCirce = (project in file("demo-circe"))
.settings(commonSettings)
.settings(
name := "demo-circe",
libraryDependencies ++= Seq(
circeCore,
circeGeneric,
circeParser,
),
)
lazy val demoMonocle = (project in file("demo-monocle"))
.settings(commonSettings)
.settings(
name := "demo-monocle",
libraryDependencies ++= Seq(
monocleCore,
monocleMacro,
alleyCatsCore,
),
)
lazy val demoLog4Cats = (project in file("demo-log4cats"))
.settings(commonSettings)
.settings(
name := "demo-log4cats",
libraryDependencies ++= Seq(
log4CatsSlf4j,
logbackClassic % Runtime,
),
)
lazy val demoCiris = (project in file("demo-ciris"))
.settings(commonSettings)
.settings(
name := "demo-ciris",
libraryDependencies ++= Seq(
ciris,
cirisCirce,
cirisCirceYaml,
cirisHttp4s,
cirisRefined,
cirisSquants,
// cirisHocon,
circeGeneric,
refinedCats,
),
)
lazy val demoCatsStm = (project in file("demo-cats-stm"))
.settings(commonSettings)
.settings(
name := "demo-cats-stm",
libraryDependencies ++= Seq(
catsStm,
),
)
lazy val demoCatsMtl = (project in file("demo-cats-mtl"))
.settings(commonSettings)
.settings(
name := "demo-cats-mtl",
libraryDependencies ++= Seq(
catsMtl,
),
)
lazy val demoSpire = (project in file("demo-spire"))
.settings(commonSettings)
.settings(
name := "demo-spire",
libraryDependencies ++= Seq(
spire,
),
)
lazy val demoSquants = (project in file("demo-squants"))
.settings(commonSettings)
.settings(
name := "demo-squants",
libraryDependencies ++= Seq(
squants,
),
)
lazy val demoHttp4s = (crossProject(JSPlatform, JVMPlatform) in file("demo-http4s"))
.settings(commonSettings)
.settings(
name := "demo-http4s",
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dsl" % http4sVersion,
"org.http4s" %%% "http4s-ember-server" % http4sVersion,
"org.http4s" %%% "http4s-ember-client" % http4sVersion,
"org.http4s" %%% "http4s-server" % http4sVersion,
"org.http4s" %%% "http4s-client" % http4sVersion,
"org.http4s" %%% "http4s-circe" % http4sVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
),
)
.jvmSettings(
libraryDependencies ++= Seq(
http4sScalaTags,
http4sPrometheusMetrics,
// http4sDropwizardMetrics,
http4sJdkHttpClient,
jQuery,
logbackClassic % Runtime,
),
)
.jsSettings(
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dom" % http4sDomVersion,
),
)
lazy val demoDoobie = (project in file("demo-doobie"))
.settings(commonSettings)
.settings(
name := "demo-doobie",
libraryDependencies ++= Seq(
doobieCore,
doobieH2,
doobieHikari,
doobiePostgres,
doobiePostgresCirce,
circeCore,
circeGeneric,
circeParser,
logbackClassic % Runtime,
doobieScalaTest % Test,
h2 % Test,
),
)
lazy val demoRedis4Cats = (project in file("demo-redis4cats"))
.settings(commonSettings)
.settings(
name := "demo-redis4cats",
libraryDependencies ++= Seq(
redis4CatsEffects,
redis4CatsStreams,
redis4CatsLog4Cats,
circeCore,
circeGeneric,
circeParser,
log4CatsSlf4j,
logbackClassic % Runtime,
),
)
lazy val demoNatchez = (project in file("demo-natchez"))
.settings(commonSettings)
.settings(
name := "demo-natchez",
libraryDependencies ++= Seq(
natchezMtl,
natchezLog,
http4sDsl,
http4sEmberServer,
http4sEmberClient,
log4CatsSlf4j,
logbackClassic % Runtime,
),
)
lazy val demoNeo4j = (project in file("demo-neo4j"))
.settings(commonSettings)
.settings(
name := "demo-neo4j",
libraryDependencies ++= Seq(
neotypesCatsEffect,
neotypesFs2Stream,
neotypesGeneric,
fs2Core,
neo4jJavaDriver,
),
)
lazy val demoNebula = (project in file("demo-nebula"))
.settings(commonSettings)
.settings(
name := "demo-nebula",
libraryDependencies ++= Seq(
nebulaClient,
circeParser,
logbackClassic % Runtime,
),
)
lazy val demoZio = (project in file("demo-zio"))
.settings(commonSettings)
.settings(
name := "demo-zio",
libraryDependencies ++= Seq(
zio,
zioStreams,
),
)
lazy val demoAkka = (project in file("demo-akka"))
.settings(commonSettings)
.settings(
name := "demo-akka",
libraryDependencies ++= Seq(
akkaActorTyped,
logbackClassic % Runtime,
),
)
lazy val demoScalaTest = (crossProject(JSPlatform, JVMPlatform) in file("demo-scalatest"))
.settings(commonSettings)
.settings(
name := "demo-scalatest",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest-flatspec" % scalaTestVersion,
"org.scalatest" %%% "scalatest-shouldmatchers" % scalaTestVersion,
),
)
lazy val demoScalaCheck = (project in file("demo-scalacheck"))
.settings(commonSettings)
.settings(
name := "demo-scalacheck",
libraryDependencies ++= Seq(
scalaCheck,
scalaTestFlatSpec,
scalaTestPlusScalaCheck,
scalaCheckEffect,
scalaCheckEffectMUnit,
catsEffect,
mUnitCatsEffect,
),
)
lazy val demoJs = (crossProject(JSPlatform, JVMPlatform) in file("demo-js"))
// .enablePlugins(ScalaJSPlugin) crossProject下不设置
.settings(commonSettings)
.settings(
name := "demo-js",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "cats-effect" % catsEffectVersion,
"co.fs2" %%% "fs2-core" % fs2Version,
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"org.typelevel" %%% "spire" % spireVersion,
"org.http4s" %%% "http4s-dsl" % http4sVersion,
"org.http4s" %%% "http4s-ember-server" % http4sVersion,
"org.http4s" %%% "http4s-ember-client" % http4sVersion,
"org.http4s" %%% "http4s-circe" % http4sVersion,
"com.lihaoyi" %%% "scalatags" % scalaTagsVersion,
"com.lihaoyi" %%% "upickle" % uPickleVersion,
"com.github.japgolly.scalacss" %% "core" % scalaCssVersion,
"com.lihaoyi" %%% "utest" % uTestVersion % Test,
),
)
.jvmSettings(
libraryDependencies ++= Seq(
http4sScalaTags,
ciris,
log4CatsSlf4j,
logbackClassic % Runtime,
),
)
.jsSettings(
// This is an application with a main method
scalaJSUseMainModuleInitializer := true,
Compile / mainClass := Some("com.peknight.demo.js.tutorial.webapp.TutorialApp"),
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
"org.http4s" %%% "http4s-dom" % http4sDomVersion,
),
)
lazy val demoJsModuleA = (project in file("demo-js/module/module-a"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-js-module-a",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoJsModuleB = (project in file("demo-js/module/module-b"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(demoJsModuleA)
.settings(commonSettings)
.settings(
name := "demo-js-module-b",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
Compile / scalaJSModuleInitializers ++= Seq(
ModuleInitializer.mainMethod("com.peknight.demo.js.module.emitting.AppB", "main")
.withModuleID("b")
),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEnd = (crossProject(JSPlatform, JVMPlatform) in file("demo-front-end"))
.settings(commonSettings)
.settings(
name := "demo-front-end",
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dsl" % http4sVersion,
"org.http4s" %%% "http4s-ember-server" % http4sVersion,
"org.http4s" %%% "http4s-ember-client" % http4sVersion,
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-jawn" % circeVersion,
"com.lihaoyi" %%% "scalatags" % scalaTagsVersion,
"com.github.japgolly.scalacss" %% "core" % scalaCssVersion,
),
)
.jvmSettings(
libraryDependencies ++= Seq(
http4sScalaTags,
ciris,
log4CatsSlf4j,
flexible,
jQuery,
swiper,
bootstrap,
bootstrapIcons,
fastClick,
eCharts,
vue,
logbackClassic % Runtime,
),
)
.jsConfigure(_.dependsOn(
demoFrontEndModuleNode,
demoFrontEndModuleVue,
demoFrontEndModuleZRender,
demoFrontEndModuleECharts,
demoFrontEndModuleSwiper,
demoFrontEndModuleFastClick,
demoFrontEndModuleZyMedia,
))
.jsSettings(
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dom" % http4sDomVersion,
"org.querki" %%% "jquery-facade" % jQueryFacadeVersion,
),
)
lazy val demoFrontEndModuleNode = (project in file("demo-front-end/module/node"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-node",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
scalaJSUseMainModuleInitializer := true,
Compile / mainClass := Some("com.peknight.demo.frontend.node.NodeApp"),
// jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleVue = (project in file("demo-front-end/module/vue"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-vue",
scalacOptions ++= Seq("-explain"),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleZRender = (project in file("demo-front-end/module/zrender"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-zrender",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleECharts = (project in file("demo-front-end/module/echarts"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(demoFrontEndModuleZRender)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-echarts",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleSwiper = (project in file("demo-front-end/module/swiper"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-swiper",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleFastClick = (project in file("demo-front-end/module/fastclick"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-fastclick",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleZyMedia = (project in file("demo-front-end/module/zymedia"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-zymedia",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleDemoVue = (project in file("demo-front-end/module/demo-vue"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(demoFrontEndModuleVue)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-demo-vue",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
),
)
lazy val demoFrontEndModuleHeimamm = (project in file("demo-front-end/module/heimamm"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(demoFrontEndModuleSwiper)
.settings(commonSettings)
.settings(
name := "demo-front-end-module-heimamm",
Compile / scalaJSModuleInitializers ++= Seq(
ModuleInitializer.mainMethod(
"com.peknight.demo.frontend.heima.pink.mobile.heimamm.HeimammSwipers",
"init")
.withModuleID("heimamm")
),
)
lazy val demoOAuth2 = (crossProject(JSPlatform, JVMPlatform) in file("demo-oauth2"))
.settings(commonSettings)
.settings(
name := "demo-oauth2",
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dsl" % http4sVersion,
"org.http4s" %%% "http4s-ember-server" % http4sVersion,
"org.http4s" %%% "http4s-ember-client" % http4sVersion,
"org.http4s" %%% "http4s-circe" % http4sVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"co.fs2" %%% "fs2-core" % fs2Version,
"org.typelevel" %%% "cats-parse" % catsParseVersion,
"org.typelevel" %%% "shapeless3-deriving" % shapelessVersion,
"com.lihaoyi" %%% "scalatags" % scalaTagsVersion,
"com.github.japgolly.scalacss" %% "core" % scalaCssVersion,
),
)
.jvmSettings(
libraryDependencies ++= Seq(
circeFs2,
http4sScalaTags,
jwtCirce,
ciris,
log4CatsSlf4j,
bootstrap,
jQuery,
html5Shiv,
respondJs,
logbackClassic % Runtime,
),
)
.jsSettings(
scalaJSUseMainModuleInitializer := true,
Compile / mainClass := Some("com.peknight.demo.oauth2.webclient.WebClient"),
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-dom" % http4sDomVersion,
),
)
lazy val demoAcme4j = (project in file("demo-acme4j"))
.settings(commonSettings)
.settings(
name := "demo-acme4j",
libraryDependencies ++= Seq(
acme4jClient,
acme4jUtils,
fs2Core,
fs2IO,
log4CatsSlf4j,
logbackClassic % Runtime,
),
)
lazy val demoSecurity = (project in file("demo-security"))
.settings(commonSettings)
.settings(
name := "demo-security",
libraryDependencies ++= Seq(
fs2Core,
bouncyCastle,
apacheCommonsCodec,
jwtCirce,
scalaJwk,
),
)
lazy val demoPlayground = (crossProject(JSPlatform, JVMPlatform) in file("demo-playground"))
.settings(commonSettings)
.settings(
name := "demo-playground",
libraryDependencies ++= Seq(
"org.typelevel" %%% "shapeless3-deriving" % shapelessVersion,
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "alleycats-core" % catsVersion,
"org.typelevel" %%% "cats-effect" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-cps" % catsEffectCpsVersion,
"org.typelevel" %%% "cats-parse" % catsParseVersion,
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
"co.fs2" %%% "fs2-scodec" % fs2Version,
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-jawn" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"dev.optics" %%% "monocle-core" % monocleVersion,
"dev.optics" %%% "monocle-macro" % monocleVersion,
"io.github.timwspence" %% "cats-stm" % catsStmVersion,
"org.typelevel" %%% "spire" % spireVersion,
"org.typelevel" %%% "squants" % squantsVersion,
"org.http4s" %%% "http4s-dsl" % http4sVersion,
"org.http4s" %%% "http4s-ember-server" % http4sVersion,
"org.http4s" %%% "http4s-ember-client" % http4sVersion,
"org.http4s" %%% "http4s-server" % http4sVersion,
"org.http4s" %%% "http4s-client" % http4sVersion,
"org.http4s" %%% "http4s-circe" % http4sVersion,
"org.tpolecat" %%% "natchez-mtl" % natchezVersion,
"org.tpolecat" %%% "natchez-log" % natchezVersion,
"org.typelevel" %%% "jawn-ast" % jawnAstVersion,
"dev.zio" %%% "zio" % zioVersion,
"dev.zio" %%% "zio-streams" % zioVersion,
"com.lihaoyi" %%% "scalatags" % scalaTagsVersion,
"com.lihaoyi" %%% "upickle" % uPickleVersion,
"com.github.japgolly.scalacss" %% "core" % scalaCssVersion,
"org.scalatest" %%% "scalatest-flatspec" % scalaTestVersion % Test,
"org.scalatest" %%% "scalatest-shouldmatchers" % scalaTestVersion % Test,
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-18" % scalaTestPlusVersion % Test,
"org.typelevel" %%% "scalacheck-effect" % scalaCheckEffectVersion % Test,
"org.typelevel" %%% "scalacheck-effect-munit" % scalaCheckEffectVersion % Test,
"org.typelevel" %%% "cats-laws" % catsVersion % Test,
"org.typelevel" %%% "cats-effect-testkit" % catsEffectVersion % Test,
"org.typelevel" %%% "cats-effect-testing-specs2" % catsEffectTestingSpecsVersion % Test,
"org.typelevel" %%% "cats-effect-testing-scalatest" % catsEffectTestingScalaTestVersion % Test,
"org.typelevel" %%% "munit-cats-effect" % mUnitCatsEffectVersion % Test,
"com.disneystreaming" %%% "weaver-cats" % weaverCatsVersion % Test,
"com.lihaoyi" %%% "utest" % uTestVersion % Test,
),
)
.jvmSettings(
libraryDependencies ++= Seq(
circeFs2,
fs2ReactiveStreams,
log4CatsSlf4j,
ciris,
cirisCirce,
cirisCirceYaml,
// cirisHttp4s,
cirisRefined,
cirisSquants,
// cirisHocon,
refinedCats,
http4sScalaTags,
http4sPrometheusMetrics,
// http4sDropwizardMetrics,
http4sJdkHttpClient,
doobieCore,
doobieH2,
doobieHikari,
doobiePostgres,
doobiePostgresCirce,
redis4CatsEffects,
redis4CatsStreams,
redis4CatsLog4Cats,
neotypesCatsEffect,
neotypesFs2Stream,
neotypesGeneric,
neo4jJavaDriver,
nebulaClient,
akkaActorTyped,
apacheCommonsCodec,
acme4jClient,
acme4jUtils,
bouncyCastle,
jwtCirce,
scalaJwk,
jQuery,
flexible,
swiper,
bootstrap,
bootstrapIcons,
fastClick,
eCharts,
vue,
html5Shiv,
respondJs,
logbackClassic % Runtime,
doobieScalaTest % Test,
h2 % Test,
),
)
.jsSettings(
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
"org.http4s" %%% "http4s-dom" % http4sDomVersion,
"org.querki" %%% "jquery-facade" % jQueryFacadeVersion,
),
)
// Functional
// https://mvnrepository.com/artifact/org.typelevel/shapeless3-deriving
val shapelessVersion = "3.4.3"
val shapeless2Version = "2.3.12"
val catsVersion = "2.12.0"
val catsEffectVersion = "3.5.7"
val catsEffectCpsVersion = "0.4.0"
val catsParseVersion = "0.3.10" // "1.1.0"
val catsMtlVersion = "1.5.0"
val fs2Version = "3.11.0"
val circeVersion = "0.14.10"
val circeFs2Version = "0.14.1"
val monocleVersion = "3.3.0"
val log4CatsVersion = "2.7.0"
val cirisVersion = "3.7.0"
val cirisHoconVersion = "1.3.0"
val refinedCatsVersion = "0.11.3"
// https://mvnrepository.com/artifact/io.github.timwspence/cats-stm
val catsStmVersion = "0.13.5"
val spireVersion = "0.18.0"
val squantsVersion = "1.8.3"
val http4sVersion = "1.0.0-M34" // 1.0.0-M44
val http4sDomVersion = "1.0.0-M34" // 1.0.0-M36 -> 1.0.0-M36
val http4sScalaTagsVersion = "1.0.0-M34" // 1.0.0-M35 -> 1.0.0-M35, 1.0.0-M38 -> 1.0.0-M38
// https://mvnrepository.com/artifact/org.http4s/http4s-prometheus-metrics
val http4sPrometheusMetricsVersion = "1.0.0-M34" // 1.0.0-M35 -> 1.0.0-M35, 1.0.0-M38 -> 1.0.0-M38
// https://mvnrepository.com/artifact/org.http4s/http4s-dropwizard-metrics
val http4sDropwizardMetricsVersion = "1.0.0-M32"
val http4sJdkHttpClientVersion = "1.0.0-M3" // 1.0.0-M4 -> M35, 1.0.0-M5 -> 1.0.0-M36, 1.0.0-M6 & 1.0.0-M7 -> 1.0.0-M37, 1.0.0-M8 -> 1.0.0-M38, 1.0.0-M9 -> 1.0.0-M39 1.0.0-M10 -> 1.0.0-M44
val doobieVersion = "1.0.0-RC6"
val redis4CatsVersion = "1.7.2"
val natchezVersion = "0.3.7"
val neotypesVersion = "1.2.0"
val jawnAstVersion = "1.6.0"
val zioVersion = "2.1.14"
val shapeless = "org.typelevel" %% "shapeless3-deriving" % shapelessVersion
val shapeless2 = "com.chuusai" %% "shapeless" % shapeless2Version
val catsCore = "org.typelevel" %% "cats-core" % catsVersion
val alleyCatsCore = "org.typelevel" %% "alleycats-core" % catsVersion
val catsEffect = "org.typelevel" %% "cats-effect" % catsEffectVersion withSources() withJavadoc()
val catsEffectCps = "org.typelevel" %% "cats-effect-cps" % catsEffectCpsVersion
val catsParse = "org.typelevel" %% "cats-parse" % catsParseVersion
val fs2Core = "co.fs2" %% "fs2-core" % fs2Version
val fs2IO = "co.fs2" %% "fs2-io" % fs2Version
val fs2ReactiveStreams = "co.fs2" %% "fs2-reactive-streams" % fs2Version
val fs2Scodec = "co.fs2" %% "fs2-scodec" % fs2Version
val circeCore = "io.circe" %% "circe-core" % circeVersion
val circeGeneric = "io.circe" %% "circe-generic" % circeVersion
val circeParser = "io.circe" %% "circe-parser" % circeVersion
val circeFs2 = "io.circe" %% "circe-fs2" % circeFs2Version
val monocleCore = "dev.optics" %% "monocle-core" % monocleVersion
val monocleMacro = "dev.optics" %% "monocle-macro" % monocleVersion
val log4CatsSlf4j = "org.typelevel" %% "log4cats-slf4j" % log4CatsVersion
val ciris = "is.cir" %% "ciris" % cirisVersion
val cirisCirce = "is.cir" %% "ciris-circe" % cirisVersion
val cirisCirceYaml = "is.cir" %% "ciris-circe-yaml" % cirisVersion
val cirisHttp4s = "is.cir" %% "ciris-http4s" % cirisVersion
val cirisRefined = "is.cir" %% "ciris-refined" % cirisVersion
val cirisSquants = "is.cir" %% "ciris-squants" % cirisVersion
// val cirisHocon = "lt.dvim.ciris-hocon" %% "ciris-hocon" % cirisHoconVersion
val refinedCats = "eu.timepit" %% "refined-cats" % refinedCatsVersion
val catsStm = "io.github.timwspence" %% "cats-stm" % catsStmVersion
val catsMtl = "org.typelevel" %% "cats-mtl" % catsMtlVersion
val spire = "org.typelevel" %% "spire" % spireVersion
val squants = "org.typelevel" %% "squants" % squantsVersion
val http4sDsl = "org.http4s" %% "http4s-dsl" % http4sVersion
val http4sEmberServer = "org.http4s" %% "http4s-ember-server" % http4sVersion
val http4sEmberClient = "org.http4s" %% "http4s-ember-client" % http4sVersion
val http4sCirce = "org.http4s" %% "http4s-circe" % http4sVersion
val http4sScalaTags = "org.http4s" %% "http4s-scalatags" % http4sScalaTagsVersion
val http4sPrometheusMetrics = "org.http4s" %% "http4s-prometheus-metrics" % http4sPrometheusMetricsVersion
val http4sDropwizardMetrics = "org.http4s" %% "http4s-dropwizard-metrics" % http4sDropwizardMetricsVersion
val http4sJdkHttpClient = "org.http4s" %% "http4s-jdk-http-client" % http4sJdkHttpClientVersion
val doobieCore = "org.tpolecat" %% "doobie-core" % doobieVersion
val doobieH2 = "org.tpolecat" %% "doobie-h2" % doobieVersion
val doobieHikari = "org.tpolecat" %% "doobie-hikari" % doobieVersion
val doobiePostgres = "org.tpolecat" %% "doobie-postgres" % doobieVersion
val doobiePostgresCirce = "org.tpolecat" %% "doobie-postgres-circe" % doobieVersion
val doobieScalaTest = "org.tpolecat" %% "doobie-scalatest" % doobieVersion
val redis4CatsEffects = "dev.profunktor" %% "redis4cats-effects" % redis4CatsVersion
val redis4CatsStreams = "dev.profunktor" %% "redis4cats-streams" % redis4CatsVersion
val redis4CatsLog4Cats = "dev.profunktor" %% "redis4cats-log4cats" % redis4CatsVersion
val natchezMtl = "org.tpolecat" %% "natchez-mtl" % natchezVersion
val natchezLog = "org.tpolecat" %% "natchez-log" % natchezVersion
val neotypesCatsEffect = "io.github.neotypes" %% "neotypes-cats-effect" % neotypesVersion
val neotypesFs2Stream = "io.github.neotypes" %% "neotypes-fs2-stream" % neotypesVersion
val neotypesGeneric = "io.github.neotypes" %% "neotypes-generic" % neotypesVersion
val jawnAst = "org.typelevel" %% "jawn-ast" % jawnAstVersion
val zio = "dev.zio" %% "zio" % zioVersion
val zioStreams = "dev.zio" %% "zio-streams" % zioVersion
// Library
val logbackVersion = "1.5.16"
// val jansiVersion = "1.18"
val akkaVersion = "2.8.8"
val apacheCommonsCodecVersion = "1.17.2"
val h2Version = "2.3.232"
val postgisJdbcVersion = "2024.1.0"
val neo4jVersion = "5.26.0"
// https://mvnrepository.com/artifact/com.vesoft/client
val nebulaClientVersion = "3.8.4"
val acme4jClientVersion = "3.4.0"
val acme4jUtilsVersion = "2.16"
val bouncyCastleVersion = "1.79"
val jwtCirceVersion = "10.0.1"
val scalaJwkVersion = "1.2.24"
val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion
// val jansi = "org.fusesource.jansi" % "jansi" % jansiVersion
val akkaActorTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion
val apacheCommonsCodec = "commons-codec" % "commons-codec" % apacheCommonsCodecVersion
val h2 = "com.h2database" % "h2" % h2Version
// val postgisJdbc = "net.postgis" % "postgis-jdbc" % postgisJdbcVersion
val neo4jJavaDriver = "org.neo4j.driver" % "neo4j-java-driver" % neo4jVersion
val nebulaClient = "com.vesoft" % "client" % nebulaClientVersion
val grpcNettyShaded = "io.grpc" % "grpc-netty-shaded" % scalapb.compiler.Version.grpcJavaVersion
val acme4jClient = "org.shredzone.acme4j" % "acme4j-client" % acme4jClientVersion
val acme4jUtils = "org.shredzone.acme4j" % "acme4j-utils" % acme4jUtilsVersion
val bouncyCastle = "org.bouncycastle" % "bcprov-jdk18on" % bouncyCastleVersion
val jwtCirce = "com.github.jwt-scala" %% "jwt-circe" % jwtCirceVersion
// https://mvnrepository.com/artifact/com.chatwork/scala-jwk
val scalaJwk = "com.chatwork" %% "scala-jwk" % scalaJwkVersion
// Webjars
// https://www.webjars.org/
val jQueryVersion = "3.7.1"
val flexibleVersion = "2.2.1"
val swiperVersion = "11.0.5"
val bootstrapVersion = "5.3.3"
val bootstrapIconsVersion = "1.11.3"
val fastClickVersion = "1.0.6"
val eChartsVersion = "5.5.1" // "5.4.3"
val vueVersion = "3.5.13" // "3.5.4"
val html5ShivVersion = "3.7.3-1"
val respondJsVersion = "1.4.2"
val jQuery = "org.webjars" % "jquery" % jQueryVersion
val flexible = "org.webjars.npm" % "amfe-flexible" % flexibleVersion
val swiper = "org.webjars.npm" % "swiper" % swiperVersion
val bootstrap = "org.webjars.npm" % "bootstrap" % bootstrapVersion