@r_masseater/msch 0.23.0 → 0.24.1

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.
package/dist/lint.mjs CHANGED
@@ -74,6 +74,7 @@ const generated = [
74
74
  ".intent/**",
75
75
  "AGENTS.md",
76
76
  "skills-lock.json",
77
+ "**/CHANGELOG.md",
77
78
  ".github/release-please/*manifest.json",
78
79
  "**/.release-please-manifest.json",
79
80
  "**/*.d.rpp.ts",
@@ -112,10 +113,16 @@ const shadcnRestyleContracts = [{
112
113
  const BINARY_DATA = [
113
114
  "ArrayBuffer",
114
115
  "DataView",
116
+ "BigInt64Array",
117
+ "BigUint64Array",
115
118
  "Float32Array",
116
119
  "Float64Array",
120
+ "Int8Array",
121
+ "Int16Array",
117
122
  "Int32Array",
118
123
  "Uint8Array",
124
+ "Uint8ClampedArray",
125
+ "Uint16Array",
119
126
  "Uint32Array"
120
127
  ];
121
128
  // src/features/lint-preset/config/readonly-browser.config.ts
@@ -159,7 +166,10 @@ const lintToolReadonlyAllow = [
159
166
  "ExportSpecifier",
160
167
  "Statement",
161
168
  "Fixer",
169
+ "ImportDeclaration",
170
+ "ImportDeclarationSpecifier",
162
171
  "Location",
172
+ "MemberExpression",
163
173
  "Node",
164
174
  "Range",
165
175
  "Rule",
@@ -357,6 +367,11 @@ const readonlyParameterAllow = [
357
367
  package: "@better-auth/drizzle-adapter",
358
368
  name: "DB"
359
369
  },
370
+ {
371
+ from: "package",
372
+ package: "drizzle-orm",
373
+ name: ["DrizzleSqliteDODatabase", "SQL"]
374
+ },
360
375
  {
361
376
  from: "package",
362
377
  package: "@tanstack/query-core",
@@ -651,6 +666,7 @@ const readonlyParameterAllow = [
651
666
  "Atom",
652
667
  "Cause",
653
668
  "Context",
669
+ "DateTime",
654
670
  "Deferred",
655
671
  "Duration",
656
672
  "Effect",
@@ -678,225 +694,6 @@ const readonlyParameterAllow = [
678
694
  ]
679
695
  }
680
696
  ];
681
- // src/features/lint-preset/config/required-stack.config.ts
682
- const REACT_STATE_HOOKS = [
683
- "useState",
684
- "useReducer",
685
- "createContext",
686
- "useContext"
687
- ];
688
- const HAND_WRITTEN_SQL = "SQL を手書きせず Drizzle のクエリビルダーを使う";
689
- const UI_STATE = "UI 状態は effect-atom だけで扱う";
690
- const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
691
- const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
692
- const requiredStack = {
693
- [UI_STATE]: [
694
- "zustand",
695
- "jotai",
696
- "valtio",
697
- "recoil",
698
- "mobx",
699
- "mobx-*",
700
- "redux",
701
- "@reduxjs/*",
702
- "react-redux",
703
- "xstate",
704
- "@xstate/*",
705
- "nanostores",
706
- "@nanostores/*",
707
- "@preact/signals*"
708
- ],
709
- "サーバー状態は TanStack Query と Eden だけで扱う": [
710
- "swr",
711
- "react-query",
712
- "@apollo/*",
713
- "urql",
714
- "@urql/*",
715
- "axios",
716
- "ky",
717
- "ofetch",
718
- "got",
719
- "node-fetch",
720
- "graphql-request",
721
- "@trpc/*"
722
- ],
723
- "ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
724
- "react-router",
725
- "react-router-dom",
726
- "next",
727
- "@remix-run/*",
728
- "wouter",
729
- "express",
730
- "hono",
731
- "fastify",
732
- "koa",
733
- "@nestjs/*"
734
- ],
735
- "データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
736
- "prisma",
737
- "@prisma/*",
738
- "typeorm",
739
- "sequelize",
740
- "kysely",
741
- "knex",
742
- "@mikro-orm/*",
743
- "better-sqlite3",
744
- "pg",
745
- "mysql2"
746
- ],
747
- "認証は better-auth だけで扱う": [
748
- "next-auth",
749
- "@auth/*",
750
- "lucia",
751
- "passport",
752
- "passport-*",
753
- "@clerk/*",
754
- "firebase/auth",
755
- "@supabase/*"
756
- ],
757
- "UI は shadcn/ui と Tailwind CSS だけで組む": [
758
- "@mui/*",
759
- "antd",
760
- "@chakra-ui/*",
761
- "@mantine/*",
762
- "styled-components",
763
- "@emotion/*",
764
- "bootstrap",
765
- "react-bootstrap"
766
- ],
767
- "検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
768
- "zod",
769
- "yup",
770
- "joi",
771
- "valibot",
772
- "arktype",
773
- "io-ts",
774
- "superstruct",
775
- "moment",
776
- "dayjs",
777
- "date-fns",
778
- "luxon",
779
- "winston",
780
- "pino",
781
- "bunyan",
782
- "loglevel",
783
- "lodash",
784
- "lodash-es",
785
- "ramda",
786
- "rxjs",
787
- "fp-ts",
788
- "neverthrow",
789
- "ts-results",
790
- "purify-ts"
791
- ],
792
- "CSV は effect/encoding の Csv だけで読み書きする": [
793
- "papaparse",
794
- "csv-parse",
795
- "csv-parser",
796
- "csv-stringify",
797
- "fast-csv",
798
- "@fast-csv/*",
799
- "d3-dsv"
800
- ],
801
- "フィーチャーフラグは OpenFeature だけで扱う": [
802
- "launchdarkly-*",
803
- "@launchdarkly/*",
804
- "@growthbook/*",
805
- "unleash-client",
806
- "flagsmith",
807
- "@vercel/flags"
808
- ],
809
- "テストは Vitest と Playwright だけで扱う": [
810
- "jest",
811
- "jest-*",
812
- "@jest/*",
813
- "ts-jest",
814
- "mocha",
815
- "jasmine",
816
- "jasmine-core",
817
- "ava",
818
- "cypress",
819
- "tap",
820
- "uvu"
821
- ],
822
- "決済は Stripe だけで扱う": [
823
- "@paypal/*",
824
- "paypal-rest-sdk",
825
- "braintree",
826
- "@paddle/*",
827
- "@lemonsqueezy/*",
828
- "square"
829
- ],
830
- "整形は Vite+ の vp fmt だけで扱う": [
831
- "prettier",
832
- "prettier-plugin-*",
833
- "@prettier/*",
834
- "@biomejs/*",
835
- "dprint"
836
- ],
837
- "lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
838
- "eslint",
839
- "@eslint/*",
840
- "eslint-config-*",
841
- "tslint",
842
- "standard",
843
- "xo"
844
- ],
845
- [INSTRUMENTATION]: [
846
- "@opentelemetry/*",
847
- "dd-trace",
848
- "newrelic"
849
- ],
850
- [INFRASTRUCTURE]: [
851
- "wrangler",
852
- "miniflare",
853
- "@cloudflare/vite-plugin",
854
- "@vercel/*",
855
- "@netlify/*",
856
- "aws-cdk",
857
- "aws-cdk-lib",
858
- "@pulumi/*",
859
- "cdktf"
860
- ]
861
- };
862
- const requiredStackEntries = Array.flatMap(Record.toEntries(requiredStack), ([message, modules]) => pipe(modules, Array.map((module) => ({
863
- message,
864
- module
865
- }))));
866
- const requiredStackPaths = Array.map(pipe(requiredStackEntries, Array.filter(({ module }) => !String.includes("*")(module))), ({ message, module }) => ({
867
- name: module,
868
- message
869
- }));
870
- const requiredStackPatterns = pipe(requiredStackEntries, Array.map(({ message, module }) => {
871
- if (String.includes("*")(module)) return {
872
- group: [module, `${module}/**`],
873
- message
874
- };
875
- return {
876
- group: [`${module}/**`],
877
- message
878
- };
879
- }));
880
- const restrictedImports = {
881
- paths: [
882
- {
883
- name: "react",
884
- importNames: [...REACT_STATE_HOOKS],
885
- message: UI_STATE
886
- },
887
- {
888
- name: "drizzle-orm",
889
- importNames: ["sql"],
890
- message: HAND_WRITTEN_SQL
891
- },
892
- {
893
- name: "drizzle-orm/sql",
894
- message: HAND_WRITTEN_SQL
895
- },
896
- ...requiredStackPaths
897
- ],
898
- patterns: [...requiredStackPatterns]
899
- };
900
697
  // src/features/lint-preset/config/preset.ts
901
698
  const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
902
699
  const DECISION_TIMEOUT_MS = 5e4;
@@ -981,7 +778,7 @@ const lint = {
981
778
  },
982
779
  {
983
780
  name: "msch-lint",
984
- specifier: resolved("@r_masseater/msch/inline-exports")
781
+ specifier: resolved("@r_masseater/msch/lint-rules")
985
782
  }
986
783
  ],
987
784
  rules: {
@@ -1022,6 +819,8 @@ const lint = {
1022
819
  "import/group-exports": "off",
1023
820
  "import/exports-last": "off",
1024
821
  "msch-lint/inline-exports": "error",
822
+ "msch-lint/ui-state-in-atoms": "error",
823
+ "msch-lint/no-hand-written-sql": "error",
1025
824
  "react/react-in-jsx-scope": "off",
1026
825
  "eslint/no-undef": "off",
1027
826
  "typescript/promise-function-async": "off",
@@ -1043,7 +842,6 @@ const lint = {
1043
842
  "internal",
1044
843
  "msch"
1045
844
  ] }],
1046
- "eslint/no-restricted-imports": ["error", restrictedImports],
1047
845
  "eslint-js/no-restricted-syntax": ["error", ...cloudflareResourceSyntax],
1048
846
  "typescript/prefer-readonly-parameter-types": ["error", {
1049
847
  ignoreInferredTypes: true,
@@ -1093,6 +891,185 @@ const lint = {
1093
891
  reportUnusedDisableDirectives: "error"
1094
892
  }
1095
893
  };
894
+ // src/features/lint-preset/config/required-stack.config.ts
895
+ const UI_STATE = "UI 状態は effect-atom だけで扱う";
896
+ const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
897
+ const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
898
+ const requiredStack = {
899
+ [UI_STATE]: [
900
+ "zustand",
901
+ "jotai",
902
+ "valtio",
903
+ "recoil",
904
+ "mobx",
905
+ "mobx-*",
906
+ "redux",
907
+ "@reduxjs/*",
908
+ "react-redux",
909
+ "xstate",
910
+ "@xstate/*",
911
+ "nanostores",
912
+ "@nanostores/*",
913
+ "@preact/signals*"
914
+ ],
915
+ "サーバー状態は TanStack Query と Eden だけで扱う": [
916
+ "swr",
917
+ "react-query",
918
+ "@apollo/*",
919
+ "urql",
920
+ "@urql/*",
921
+ "axios",
922
+ "ky",
923
+ "ofetch",
924
+ "got",
925
+ "node-fetch",
926
+ "graphql-request",
927
+ "@trpc/*"
928
+ ],
929
+ "ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
930
+ "react-router",
931
+ "react-router-dom",
932
+ "next",
933
+ "@remix-run/*",
934
+ "wouter",
935
+ "express",
936
+ "hono",
937
+ "fastify",
938
+ "koa",
939
+ "@nestjs/*"
940
+ ],
941
+ "データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
942
+ "prisma",
943
+ "@prisma/*",
944
+ "typeorm",
945
+ "sequelize",
946
+ "kysely",
947
+ "knex",
948
+ "@mikro-orm/*",
949
+ "better-sqlite3",
950
+ "pg",
951
+ "mysql2"
952
+ ],
953
+ "認証は better-auth だけで扱う": [
954
+ "next-auth",
955
+ "@auth/*",
956
+ "lucia",
957
+ "passport",
958
+ "passport-*",
959
+ "@clerk/*",
960
+ "firebase/auth",
961
+ "@supabase/*"
962
+ ],
963
+ "UI は shadcn/ui と Tailwind CSS だけで組む": [
964
+ "@mui/*",
965
+ "antd",
966
+ "@chakra-ui/*",
967
+ "@mantine/*",
968
+ "styled-components",
969
+ "@emotion/*",
970
+ "bootstrap",
971
+ "react-bootstrap"
972
+ ],
973
+ "検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
974
+ "zod",
975
+ "yup",
976
+ "joi",
977
+ "valibot",
978
+ "arktype",
979
+ "io-ts",
980
+ "superstruct",
981
+ "moment",
982
+ "dayjs",
983
+ "date-fns",
984
+ "luxon",
985
+ "winston",
986
+ "pino",
987
+ "bunyan",
988
+ "loglevel",
989
+ "lodash",
990
+ "lodash-es",
991
+ "ramda",
992
+ "rxjs",
993
+ "fp-ts",
994
+ "neverthrow",
995
+ "ts-results",
996
+ "purify-ts"
997
+ ],
998
+ "CSV は effect/encoding の Csv だけで読み書きする": [
999
+ "papaparse",
1000
+ "csv-parse",
1001
+ "csv-parser",
1002
+ "csv-stringify",
1003
+ "fast-csv",
1004
+ "@fast-csv/*",
1005
+ "d3-dsv"
1006
+ ],
1007
+ "フィーチャーフラグは OpenFeature だけで扱う": [
1008
+ "launchdarkly-*",
1009
+ "@launchdarkly/*",
1010
+ "@growthbook/*",
1011
+ "unleash-client",
1012
+ "flagsmith",
1013
+ "@vercel/flags"
1014
+ ],
1015
+ "テストは Vitest と Playwright だけで扱う": [
1016
+ "jest",
1017
+ "jest-*",
1018
+ "@jest/*",
1019
+ "ts-jest",
1020
+ "mocha",
1021
+ "jasmine",
1022
+ "jasmine-core",
1023
+ "ava",
1024
+ "cypress",
1025
+ "tap",
1026
+ "uvu"
1027
+ ],
1028
+ "決済は Stripe だけで扱う": [
1029
+ "@paypal/*",
1030
+ "paypal-rest-sdk",
1031
+ "braintree",
1032
+ "@paddle/*",
1033
+ "@lemonsqueezy/*",
1034
+ "square"
1035
+ ],
1036
+ "整形は Vite+ の vp fmt だけで扱う": [
1037
+ "prettier",
1038
+ "prettier-plugin-*",
1039
+ "@prettier/*",
1040
+ "@biomejs/*",
1041
+ "dprint"
1042
+ ],
1043
+ "lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
1044
+ "eslint",
1045
+ "@eslint/*",
1046
+ "eslint-config-*",
1047
+ "tslint",
1048
+ "standard",
1049
+ "xo"
1050
+ ],
1051
+ [INSTRUMENTATION]: [
1052
+ "@opentelemetry/*",
1053
+ "dd-trace",
1054
+ "newrelic"
1055
+ ],
1056
+ [INFRASTRUCTURE]: [
1057
+ "wrangler",
1058
+ "miniflare",
1059
+ "@cloudflare/vite-plugin",
1060
+ "@vercel/*",
1061
+ "@netlify/*",
1062
+ "aws-cdk",
1063
+ "aws-cdk-lib",
1064
+ "@pulumi/*",
1065
+ "cdktf"
1066
+ ]
1067
+ };
1068
+ // src/features/lint-preset/config/traced-rules.config.ts
1069
+ const tracedRules = {
1070
+ "msch-lint/traced-elysia": "error",
1071
+ "msch-lint/traced-effect-run": "error"
1072
+ };
1096
1073
  // src/features/lint-preset/config/fsd-rules.ts
1097
1074
  const steigerRules = [...fsd.configs.recommended, { rules: {
1098
1075
  "fsd/insignificant-slice": "off",
@@ -1100,6 +1077,6 @@ const steigerRules = [...fsd.configs.recommended, { rules: {
1100
1077
  "fsd/no-higher-level-imports": "error",
1101
1078
  "fsd/no-wildcard-exports": "error"
1102
1079
  } }];
1103
- export { INFRASTRUCTURE, INSTRUMENTATION, alchemyOverride, allRulesOf, cloudflareResourceSyntax, commandsOverride, decisionRules, decisionTestRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, restrictedImports, steigerRules };
1080
+ export { INSTRUMENTATION, alchemyOverride, allRulesOf, cloudflareResourceSyntax, commandsOverride, decisionRules, decisionTestRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, steigerRules, tracedRules };
1104
1081
 
1105
1082
  //# sourceMappingURL=lint.mjs.map