@r_masseater/msch 0.22.0 → 0.24.0

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",
@@ -159,7 +160,10 @@ const lintToolReadonlyAllow = [
159
160
  "ExportSpecifier",
160
161
  "Statement",
161
162
  "Fixer",
163
+ "ImportDeclaration",
164
+ "ImportDeclarationSpecifier",
162
165
  "Location",
166
+ "MemberExpression",
163
167
  "Node",
164
168
  "Range",
165
169
  "Rule",
@@ -678,225 +682,6 @@ const readonlyParameterAllow = [
678
682
  ]
679
683
  }
680
684
  ];
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
685
  // src/features/lint-preset/config/preset.ts
901
686
  const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
902
687
  const DECISION_TIMEOUT_MS = 5e4;
@@ -981,7 +766,7 @@ const lint = {
981
766
  },
982
767
  {
983
768
  name: "msch-lint",
984
- specifier: resolved("@r_masseater/msch/inline-exports")
769
+ specifier: resolved("@r_masseater/msch/lint-rules")
985
770
  }
986
771
  ],
987
772
  rules: {
@@ -1022,6 +807,8 @@ const lint = {
1022
807
  "import/group-exports": "off",
1023
808
  "import/exports-last": "off",
1024
809
  "msch-lint/inline-exports": "error",
810
+ "msch-lint/ui-state-in-atoms": "error",
811
+ "msch-lint/no-hand-written-sql": "error",
1025
812
  "react/react-in-jsx-scope": "off",
1026
813
  "eslint/no-undef": "off",
1027
814
  "typescript/promise-function-async": "off",
@@ -1043,7 +830,6 @@ const lint = {
1043
830
  "internal",
1044
831
  "msch"
1045
832
  ] }],
1046
- "eslint/no-restricted-imports": ["error", restrictedImports],
1047
833
  "eslint-js/no-restricted-syntax": ["error", ...cloudflareResourceSyntax],
1048
834
  "typescript/prefer-readonly-parameter-types": ["error", {
1049
835
  ignoreInferredTypes: true,
@@ -1093,6 +879,185 @@ const lint = {
1093
879
  reportUnusedDisableDirectives: "error"
1094
880
  }
1095
881
  };
882
+ // src/features/lint-preset/config/required-stack.config.ts
883
+ const UI_STATE = "UI 状態は effect-atom だけで扱う";
884
+ const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
885
+ const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
886
+ const requiredStack = {
887
+ [UI_STATE]: [
888
+ "zustand",
889
+ "jotai",
890
+ "valtio",
891
+ "recoil",
892
+ "mobx",
893
+ "mobx-*",
894
+ "redux",
895
+ "@reduxjs/*",
896
+ "react-redux",
897
+ "xstate",
898
+ "@xstate/*",
899
+ "nanostores",
900
+ "@nanostores/*",
901
+ "@preact/signals*"
902
+ ],
903
+ "サーバー状態は TanStack Query と Eden だけで扱う": [
904
+ "swr",
905
+ "react-query",
906
+ "@apollo/*",
907
+ "urql",
908
+ "@urql/*",
909
+ "axios",
910
+ "ky",
911
+ "ofetch",
912
+ "got",
913
+ "node-fetch",
914
+ "graphql-request",
915
+ "@trpc/*"
916
+ ],
917
+ "ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
918
+ "react-router",
919
+ "react-router-dom",
920
+ "next",
921
+ "@remix-run/*",
922
+ "wouter",
923
+ "express",
924
+ "hono",
925
+ "fastify",
926
+ "koa",
927
+ "@nestjs/*"
928
+ ],
929
+ "データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
930
+ "prisma",
931
+ "@prisma/*",
932
+ "typeorm",
933
+ "sequelize",
934
+ "kysely",
935
+ "knex",
936
+ "@mikro-orm/*",
937
+ "better-sqlite3",
938
+ "pg",
939
+ "mysql2"
940
+ ],
941
+ "認証は better-auth だけで扱う": [
942
+ "next-auth",
943
+ "@auth/*",
944
+ "lucia",
945
+ "passport",
946
+ "passport-*",
947
+ "@clerk/*",
948
+ "firebase/auth",
949
+ "@supabase/*"
950
+ ],
951
+ "UI は shadcn/ui と Tailwind CSS だけで組む": [
952
+ "@mui/*",
953
+ "antd",
954
+ "@chakra-ui/*",
955
+ "@mantine/*",
956
+ "styled-components",
957
+ "@emotion/*",
958
+ "bootstrap",
959
+ "react-bootstrap"
960
+ ],
961
+ "検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
962
+ "zod",
963
+ "yup",
964
+ "joi",
965
+ "valibot",
966
+ "arktype",
967
+ "io-ts",
968
+ "superstruct",
969
+ "moment",
970
+ "dayjs",
971
+ "date-fns",
972
+ "luxon",
973
+ "winston",
974
+ "pino",
975
+ "bunyan",
976
+ "loglevel",
977
+ "lodash",
978
+ "lodash-es",
979
+ "ramda",
980
+ "rxjs",
981
+ "fp-ts",
982
+ "neverthrow",
983
+ "ts-results",
984
+ "purify-ts"
985
+ ],
986
+ "CSV は effect/encoding の Csv だけで読み書きする": [
987
+ "papaparse",
988
+ "csv-parse",
989
+ "csv-parser",
990
+ "csv-stringify",
991
+ "fast-csv",
992
+ "@fast-csv/*",
993
+ "d3-dsv"
994
+ ],
995
+ "フィーチャーフラグは OpenFeature だけで扱う": [
996
+ "launchdarkly-*",
997
+ "@launchdarkly/*",
998
+ "@growthbook/*",
999
+ "unleash-client",
1000
+ "flagsmith",
1001
+ "@vercel/flags"
1002
+ ],
1003
+ "テストは Vitest と Playwright だけで扱う": [
1004
+ "jest",
1005
+ "jest-*",
1006
+ "@jest/*",
1007
+ "ts-jest",
1008
+ "mocha",
1009
+ "jasmine",
1010
+ "jasmine-core",
1011
+ "ava",
1012
+ "cypress",
1013
+ "tap",
1014
+ "uvu"
1015
+ ],
1016
+ "決済は Stripe だけで扱う": [
1017
+ "@paypal/*",
1018
+ "paypal-rest-sdk",
1019
+ "braintree",
1020
+ "@paddle/*",
1021
+ "@lemonsqueezy/*",
1022
+ "square"
1023
+ ],
1024
+ "整形は Vite+ の vp fmt だけで扱う": [
1025
+ "prettier",
1026
+ "prettier-plugin-*",
1027
+ "@prettier/*",
1028
+ "@biomejs/*",
1029
+ "dprint"
1030
+ ],
1031
+ "lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
1032
+ "eslint",
1033
+ "@eslint/*",
1034
+ "eslint-config-*",
1035
+ "tslint",
1036
+ "standard",
1037
+ "xo"
1038
+ ],
1039
+ [INSTRUMENTATION]: [
1040
+ "@opentelemetry/*",
1041
+ "dd-trace",
1042
+ "newrelic"
1043
+ ],
1044
+ [INFRASTRUCTURE]: [
1045
+ "wrangler",
1046
+ "miniflare",
1047
+ "@cloudflare/vite-plugin",
1048
+ "@vercel/*",
1049
+ "@netlify/*",
1050
+ "aws-cdk",
1051
+ "aws-cdk-lib",
1052
+ "@pulumi/*",
1053
+ "cdktf"
1054
+ ]
1055
+ };
1056
+ // src/features/lint-preset/config/traced-rules.config.ts
1057
+ const tracedRules = {
1058
+ "msch-lint/traced-elysia": "error",
1059
+ "msch-lint/traced-effect-run": "error"
1060
+ };
1096
1061
  // src/features/lint-preset/config/fsd-rules.ts
1097
1062
  const steigerRules = [...fsd.configs.recommended, { rules: {
1098
1063
  "fsd/insignificant-slice": "off",
@@ -1100,6 +1065,6 @@ const steigerRules = [...fsd.configs.recommended, { rules: {
1100
1065
  "fsd/no-higher-level-imports": "error",
1101
1066
  "fsd/no-wildcard-exports": "error"
1102
1067
  } }];
1103
- export { INFRASTRUCTURE, INSTRUMENTATION, alchemyOverride, allRulesOf, cloudflareResourceSyntax, commandsOverride, decisionRules, decisionTestRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, restrictedImports, steigerRules };
1068
+ export { INSTRUMENTATION, alchemyOverride, allRulesOf, cloudflareResourceSyntax, commandsOverride, decisionRules, decisionTestRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, steigerRules, tracedRules };
1104
1069
 
1105
1070
  //# sourceMappingURL=lint.mjs.map