soseki 0.0.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.
Files changed (88) hide show
  1. package/.config/_is-debug-mode.ts +9 -0
  2. package/.config/dependency-cruiser.cjs +408 -0
  3. package/.config/env.d.ts +8 -0
  4. package/.config/mise.toml +28 -0
  5. package/.config/navigation-api.d.ts +18 -0
  6. package/.config/tsconfig.build.json +28 -0
  7. package/.config/tsconfig.config.json +21 -0
  8. package/.config/tsconfig.test.json +26 -0
  9. package/.config/tsconfig.web.json +26 -0
  10. package/.config/vitest.client.ts +30 -0
  11. package/package.json +45 -0
  12. package/src/components/action-id.tsx +35 -0
  13. package/src/components/browser-router.tsx +31 -0
  14. package/src/components/hidden-input.tsx +39 -0
  15. package/src/components/outlet.tsx +17 -0
  16. package/src/components/router.tsx +234 -0
  17. package/src/contexts/route-context.ts +21 -0
  18. package/src/contexts/router-context.ts +55 -0
  19. package/src/core/_action-id-registry.ts +11 -0
  20. package/src/core/_capture-stack-trace.ts +12 -0
  21. package/src/core/_compare-route-paths.ts +90 -0
  22. package/src/core/_create-html-form-element-form-form-data.ts +32 -0
  23. package/src/core/_encode-pathname.ts +17 -0
  24. package/src/core/_is-error.ts +16 -0
  25. package/src/core/_is-promise-like.ts +14 -0
  26. package/src/core/_match-route-path.ts +39 -0
  27. package/src/core/_process-routes.ts +56 -0
  28. package/src/core/_singleton.ts +45 -0
  29. package/src/core/_unreachable.ts +22 -0
  30. package/src/core/_use-singleton.ts +24 -0
  31. package/src/core/_valibot.ts +147 -0
  32. package/src/core/_weak-id-registry.ts +125 -0
  33. package/src/core/constants.ts +4 -0
  34. package/src/core/data-map.types.ts +28 -0
  35. package/src/core/data-store.types.ts +25 -0
  36. package/src/core/deferred-promise.ts +408 -0
  37. package/src/core/errors.ts +680 -0
  38. package/src/core/expect-history-entry.ts +95 -0
  39. package/src/core/history-entry-id-schema.ts +27 -0
  40. package/src/core/history-entry-url-schema.ts +35 -0
  41. package/src/core/init-loaders.ts +79 -0
  42. package/src/core/match-routes.ts +91 -0
  43. package/src/core/readonly-form-data.types.ts +63 -0
  44. package/src/core/readonly-url.types.ts +156 -0
  45. package/src/core/redirect-response.ts +36 -0
  46. package/src/core/route-request.ts +92 -0
  47. package/src/core/route.types.ts +351 -0
  48. package/src/core/start-actions.ts +274 -0
  49. package/src/core/start-loaders.ts +254 -0
  50. package/src/core.ts +43 -0
  51. package/src/engines/engine.types.ts +216 -0
  52. package/src/engines/navigation-api-engine.ts +406 -0
  53. package/src/hooks/_use-route-context.ts +19 -0
  54. package/src/hooks/_use-router-context.ts +25 -0
  55. package/src/hooks/use-action-data.ts +37 -0
  56. package/src/hooks/use-loader-data.ts +28 -0
  57. package/src/hooks/use-navigate.ts +64 -0
  58. package/src/hooks/use-params.ts +11 -0
  59. package/src/hooks/use-pathname.ts +10 -0
  60. package/src/hooks/use-submit.ts +111 -0
  61. package/src/soseki.ts +75 -0
  62. package/src/utils/get-action-id.ts +12 -0
  63. package/src/utils/href.ts +17 -0
  64. package/src/utils/redirect.ts +13 -0
  65. package/src/utils/route-index.ts +70 -0
  66. package/src/utils/route-route.ts +111 -0
  67. package/src/utils/set-action-id.ts +14 -0
  68. package/tests/core/_capture-stack-trace.test.ts +46 -0
  69. package/tests/core/_compare-route-paths.test.ts +134 -0
  70. package/tests/core/_encode-pathname.test.ts +77 -0
  71. package/tests/core/_is-error.test.ts +108 -0
  72. package/tests/core/_is-promise-like.test.ts +100 -0
  73. package/tests/core/_match-route-path.test.ts +74 -0
  74. package/tests/core/_process-routes.test.ts +146 -0
  75. package/tests/core/_singleton.test.ts +102 -0
  76. package/tests/core/_unreachable.test.ts +38 -0
  77. package/tests/core/_use-singleton.test.ts +47 -0
  78. package/tests/core/_weak-id-registry.test.ts +137 -0
  79. package/tests/core/deferred-promise.test.ts +218 -0
  80. package/tests/core/expect-history-entry.test.ts +112 -0
  81. package/tests/core/init-loaders.test.ts +172 -0
  82. package/tests/core/match-routes.test.ts +178 -0
  83. package/tests/core/redirect-response.test.ts +36 -0
  84. package/tests/core/route-request.test.ts +93 -0
  85. package/tests/core/start-actions.test.ts +319 -0
  86. package/tests/core/start-loaders.test.ts +276 -0
  87. package/tests/engines/navigation-api-engine.test.ts +162 -0
  88. package/tsconfig.json +7 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * デバッグモードで実行されているか確認します。
3
+ *
4
+ * @returns デバッグモードなら `true` です。
5
+ */
6
+ export default function isDebugMode(): boolean {
7
+ return ["DEBUG", "RUNNER_DEBUG", "ACTIONS_RUNNER_DEBUG", "ACTIONS_STEP_DEBUG"]
8
+ .some(k => ["1", "true"].includes(process.env[k]?.toLowerCase()!));
9
+ }
@@ -0,0 +1,408 @@
1
+ /** @type {import('dependency-cruiser').IConfiguration} */
2
+ module.exports = {
3
+ forbidden: [
4
+ {
5
+ name: "no-circular",
6
+ severity: "warn",
7
+ comment: "This dependency is part of a circular relationship. You might want to revise "
8
+ + "your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ",
9
+ from: {},
10
+ to: {
11
+ circular: true,
12
+ },
13
+ },
14
+ {
15
+ name: "no-orphans",
16
+ comment: "This is an orphan module - it's likely not used (anymore?). Either use it or "
17
+ + "remove it. If it's logical this module is an orphan (i.e. it's a config file), "
18
+ + "add an exception for it in your dependency-cruiser configuration. By default "
19
+ + "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration "
20
+ + "files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
21
+ severity: "warn",
22
+ from: {
23
+ orphan: true,
24
+ pathNot: [
25
+ "(^|/)[.][^/]+[.](?:js|cjs|mjs|ts|cts|mts|json)$", // dot files
26
+ "[.]d[.]ts$", // TypeScript declaration files
27
+ "(^|/)tsconfig[.]json$", // TypeScript config
28
+ "(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
29
+ ],
30
+ },
31
+ to: {},
32
+ },
33
+ {
34
+ name: "no-deprecated-core",
35
+ comment:
36
+ "A module depends on a node core module that has been deprecated. Find an alternative - these are "
37
+ + "bound to exist - node doesn't deprecate lightly.",
38
+ severity: "warn",
39
+ from: {},
40
+ to: {
41
+ dependencyTypes: [
42
+ "core",
43
+ ],
44
+ path: [
45
+ "^v8/tools/codemap$",
46
+ "^v8/tools/consarray$",
47
+ "^v8/tools/csvparser$",
48
+ "^v8/tools/logreader$",
49
+ "^v8/tools/profile_view$",
50
+ "^v8/tools/profile$",
51
+ "^v8/tools/SourceMap$",
52
+ "^v8/tools/splaytree$",
53
+ "^v8/tools/tickprocessor-driver$",
54
+ "^v8/tools/tickprocessor$",
55
+ "^node-inspect/lib/_inspect$",
56
+ "^node-inspect/lib/internal/inspect_client$",
57
+ "^node-inspect/lib/internal/inspect_repl$",
58
+ "^async_hooks$",
59
+ "^punycode$",
60
+ "^domain$",
61
+ "^constants$",
62
+ "^sys$",
63
+ "^_linklist$",
64
+ "^_stream_wrap$",
65
+ ],
66
+ },
67
+ },
68
+ {
69
+ name: "not-to-deprecated",
70
+ comment:
71
+ "This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later "
72
+ + "version of that module, or find an alternative. Deprecated modules are a security risk.",
73
+ severity: "warn",
74
+ from: {},
75
+ to: {
76
+ dependencyTypes: [
77
+ "deprecated",
78
+ ],
79
+ },
80
+ },
81
+ {
82
+ name: "no-non-package-json",
83
+ severity: "error",
84
+ comment:
85
+ "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. "
86
+ + "That's problematic as the package either (1) won't be available on live (2 - worse) will be "
87
+ + "available on live with an non-guaranteed version. Fix it by adding the package to the dependencies "
88
+ + "in your package.json.",
89
+ from: {},
90
+ to: {
91
+ dependencyTypes: [
92
+ "npm-no-pkg",
93
+ "npm-unknown",
94
+ ],
95
+ },
96
+ },
97
+ {
98
+ name: "not-to-unresolvable",
99
+ comment:
100
+ "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm "
101
+ + "module: add it to your package.json. In all other cases you likely already know what to do.",
102
+ severity: "error",
103
+ from: {},
104
+ to: {
105
+ couldNotResolve: true,
106
+ },
107
+ },
108
+ {
109
+ name: "no-duplicate-dep-types",
110
+ comment:
111
+ "Likely this module depends on an external ('npm') package that occurs more than once "
112
+ + "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause "
113
+ + "maintenance problems later on.",
114
+ severity: "warn",
115
+ from: {},
116
+ to: {
117
+ moreThanOneDependencyType: true,
118
+ // as it's pretty common to have a type import be a type only import
119
+ // _and_ (e.g.) a devDependency - don't consider type-only dependency
120
+ // types for this rule
121
+ dependencyTypesNot: ["type-only"],
122
+ },
123
+ },
124
+
125
+ /* rules you might want to tweak for your specific situation: */
126
+ {
127
+ name: "not-to-test",
128
+ comment:
129
+ "This module depends on code within a folder that should only contain tests. As tests don't "
130
+ + "implement functionality this is odd. Either you're writing a test outside the test folder "
131
+ + "or there's something in the test folder that isn't a test.",
132
+ severity: "error",
133
+ from: {
134
+ pathNot: "^(tests)",
135
+ },
136
+ to: {
137
+ path: "^(tests)",
138
+ },
139
+ },
140
+ {
141
+ name: "not-to-spec",
142
+ comment:
143
+ "This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. "
144
+ + "If there's something in a spec that's of use to other modules, it doesn't have that single "
145
+ + "responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.",
146
+ severity: "error",
147
+ from: {},
148
+ to: {
149
+ path: "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$",
150
+ },
151
+ },
152
+ {
153
+ name: "not-to-dev-dep",
154
+ severity: "error",
155
+ comment: "This module depends on an npm package from the 'devDependencies' section of your "
156
+ + "package.json. It looks like something that ships to production, though. To prevent problems "
157
+ + "with npm packages that aren't there on production declare it (only!) in the 'dependencies'"
158
+ + "section of your package.json. If this module is development only - add it to the "
159
+ + "from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration",
160
+ from: {
161
+ path: "^(src)",
162
+ pathNot: "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$",
163
+ },
164
+ to: {
165
+ dependencyTypes: [
166
+ "npm-dev",
167
+ ],
168
+ // type only dependencies are not a problem as they don't end up in the
169
+ // production code or are ignored by the runtime.
170
+ dependencyTypesNot: [
171
+ "type-only",
172
+ ],
173
+ pathNot: [
174
+ "node_modules/@types/",
175
+ ],
176
+ },
177
+ },
178
+ {
179
+ name: "optional-deps-used",
180
+ severity: "info",
181
+ comment: "This module depends on an npm package that is declared as an optional dependency "
182
+ + "in your package.json. As this makes sense in limited situations only, it's flagged here. "
183
+ + "If you're using an optional dependency here by design - add an exception to your"
184
+ + "dependency-cruiser configuration.",
185
+ from: {},
186
+ to: {
187
+ dependencyTypes: [
188
+ "npm-optional",
189
+ ],
190
+ },
191
+ },
192
+ {
193
+ name: "peer-deps-used",
194
+ comment: "This module depends on an npm package that is declared as a peer dependency "
195
+ + "in your package.json. This makes sense if your package is e.g. a plugin, but in "
196
+ + "other cases - maybe not so much. If the use of a peer dependency is intentional "
197
+ + "add an exception to your dependency-cruiser configuration.",
198
+ severity: "warn",
199
+ from: {},
200
+ to: {
201
+ dependencyTypes: [
202
+ "npm-peer",
203
+ ],
204
+ },
205
+ },
206
+ ],
207
+ options: {
208
+ /* Which modules not to follow further when encountered */
209
+ doNotFollow: {
210
+ /* path: an array of regular expressions in strings to match against */
211
+ path: ["node_modules"],
212
+ },
213
+
214
+ /* Which modules to exclude */
215
+ // exclude : {
216
+ // /* path: an array of regular expressions in strings to match against */
217
+ // path: '',
218
+ // },
219
+
220
+ /* Which modules to exclusively include (array of regular expressions in strings)
221
+ dependency-cruiser will skip everything not matching this pattern
222
+ */
223
+ // includeOnly : [''],
224
+
225
+ /* List of module systems to cruise.
226
+ When left out dependency-cruiser will fall back to the list of _all_
227
+ module systems it knows of. It's the default because it's the safe option
228
+ It might come at a performance penalty, though.
229
+ moduleSystems: ['amd', 'cjs', 'es6', 'tsd']
230
+
231
+ As in practice only commonjs ('cjs') and ecmascript modules ('es6')
232
+ are widely used, you can limit the moduleSystems to those.
233
+ */
234
+
235
+ // moduleSystems: ['cjs', 'es6'],
236
+
237
+ /*
238
+ false: don't look at JSDoc imports (the default)
239
+ true: dependency-cruiser will detect dependencies in JSDoc-style
240
+ import statements. Implies "parser": "tsc", so the dependency-cruiser
241
+ will use the typescript parser for JavaScript files.
242
+
243
+ For this to work the typescript compiler will need to be installed in the
244
+ same spot as you're running dependency-cruiser from.
245
+ */
246
+ // detectJSDocImports: true,
247
+
248
+ /*
249
+ false: don't look at process.getBuiltinModule calls (the default)
250
+ true: dependency-cruiser will detect calls to process.getBuiltinModule/
251
+ globalThis.process.getBuiltinModule as imports.
252
+ */
253
+ // detectProcessBuiltinModuleCalls: true,
254
+
255
+ /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/main/'
256
+ to open it on your online repo or `vscode://file/${process.cwd()}/` to
257
+ open it in visual studio code),
258
+ */
259
+ // prefix: `vscode://file/${process.cwd()}/`,
260
+
261
+ /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation
262
+ true: also detect dependencies that only exist before typescript-to-javascript compilation
263
+ "specify": for each dependency identify whether it only exists before compilation or also after
264
+ */
265
+ tsPreCompilationDeps: true,
266
+
267
+ /* list of extensions to scan that aren't javascript or compile-to-javascript.
268
+ Empty by default. Only put extensions in here that you want to take into
269
+ account that are _not_ parsable.
270
+ */
271
+ // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],
272
+
273
+ /* if true combines the package.jsons found from the module up to the base
274
+ folder the cruise is initiated from. Useful for how (some) mono-repos
275
+ manage dependencies & dependency definitions.
276
+ */
277
+ // combinedDependencies: false,
278
+
279
+ /* if true leave symlinks untouched, otherwise use the realpath */
280
+ // preserveSymlinks: false,
281
+
282
+ /* TypeScript project file ('tsconfig.json') to use for
283
+ (1) compilation and
284
+ (2) resolution (e.g. with the paths property)
285
+
286
+ The (optional) fileName attribute specifies which file to take (relative to
287
+ dependency-cruiser's current working directory). When not provided
288
+ defaults to './tsconfig.json'.
289
+ */
290
+ tsConfig: {
291
+ fileName: "tsconfig.json",
292
+ },
293
+
294
+ /* Webpack configuration to use to get resolve options from.
295
+
296
+ The (optional) fileName attribute specifies which file to take (relative
297
+ to dependency-cruiser's current working directory. When not provided defaults
298
+ to './webpack.conf.js'.
299
+
300
+ The (optional) `env` and `arguments` attributes contain the parameters
301
+ to be passed if your webpack config is a function and takes them (see
302
+ webpack documentation for details)
303
+ */
304
+ // webpackConfig: {
305
+ // fileName: 'webpack.config.js',
306
+ // env: {},
307
+ // arguments: {}
308
+ // },
309
+
310
+ /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use
311
+ for compilation
312
+ */
313
+ // babelConfig: {
314
+ // fileName: '.babelrc',
315
+ // },
316
+
317
+ /* List of strings you have in use in addition to cjs/ es6 requires
318
+ & imports to declare module dependencies. Use this e.g. if you've
319
+ re-declared require, use a require-wrapper or use window.require as
320
+ a hack.
321
+ */
322
+ // exoticRequireStrings: [],
323
+
324
+ /* options to pass on to enhanced-resolve, the package dependency-cruiser
325
+ uses to resolve module references to disk. The values below should be
326
+ suitable for most situations
327
+
328
+ If you use webpack: you can also set these in webpack.conf.js. The set
329
+ there will override the ones specified here.
330
+ */
331
+ enhancedResolveOptions: {
332
+ /* What to consider as an 'exports' field in package.jsons */
333
+ exportsFields: ["exports"],
334
+ /* List of conditions to check for in the exports field.
335
+ Only works when the 'exportsFields' array is non-empty.
336
+ */
337
+ conditionNames: ["import", "require", "node", "default", "types"],
338
+ /* The extensions, by default are the same as the ones dependency-cruiser
339
+ can access (run `npx depcruise --info` to see which ones that are in
340
+ _your_ environment). If that list is larger than you need you can pass
341
+ the extensions you actually use (e.g. [".js", ".jsx"]). This can speed
342
+ up module resolution, which is the most expensive step.
343
+ */
344
+ // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
345
+ /* What to consider a 'main' field in package.json */
346
+ mainFields: ["module", "main", "types", "typings"],
347
+ /* A list of alias fields in package.jsons
348
+
349
+ See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and
350
+ the webpack [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields)
351
+ documentation.
352
+
353
+ Defaults to an empty array (= don't use alias fields).
354
+ */
355
+ // aliasFields: ["browser"],
356
+ },
357
+
358
+ /* skipAnalysisNotInRules will make dependency-cruiser execute
359
+ analysis strictly necessary for checking the rule set only.
360
+
361
+ See https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#skipanalysisnotinrules
362
+ for details
363
+ */
364
+ skipAnalysisNotInRules: true,
365
+
366
+ reporterOptions: {
367
+ dot: {
368
+ /* pattern of modules that can be consolidated in the detailed
369
+ graphical dependency graph. The default pattern in this configuration
370
+ collapses everything in node_modules to one folder deep so you see
371
+ the external modules, but their innards.
372
+ */
373
+ collapsePattern: "node_modules/(?:@[^/]+/[^/]+|[^/]+)",
374
+ /* Options to tweak the appearance of your graph.See
375
+ https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions
376
+ for details and some examples. If you don't specify a theme
377
+ dependency-cruiser falls back to a built-in one.
378
+ */
379
+ // theme: {
380
+ // graph: {
381
+ // /* splines: "ortho" gives straight lines, but is slow on big graphs
382
+ // splines: "true" gives bezier curves (fast, not as nice as ortho)
383
+ // */
384
+ // splines: "true"
385
+ // },
386
+ // }
387
+ },
388
+ archi: {
389
+ /* pattern of modules that can be consolidated in the high level
390
+ graphical dependency graph. If you use the high level graphical
391
+ dependency graph reporter (`archi`) you probably want to tweak
392
+ this collapsePattern to your situation.
393
+ */
394
+ collapsePattern:
395
+ "^(?:packages|src|lib(s?)|app(s?)|bin|test(s?)|spec(s?))/[^/]+|node_modules/(?:@[^/]+/[^/]+|[^/]+)",
396
+ /* Options to tweak the appearance of your graph. If you don't specify a
397
+ theme for 'archi' dependency-cruiser will use the one specified in the
398
+ dot section above and otherwise use the default one.
399
+ */
400
+ // theme: { },
401
+ },
402
+ "text": {
403
+ "highlightFocused": true,
404
+ },
405
+ },
406
+ },
407
+ };
408
+ // generated: dependency-cruiser@17.3.5 on 2025-12-24T00:09:32.540Z
@@ -0,0 +1,8 @@
1
+ declare const __DEBUG__: boolean;
2
+
3
+ // @ts-ignore
4
+ declare module globalThis {
5
+ interface ArrayConstructor {
6
+ isArray(arg: readonly any[] | any): arg is readonly any[];
7
+ }
8
+ }
@@ -0,0 +1,28 @@
1
+ [tools]
2
+ node = "22"
3
+
4
+ [tasks.test]
5
+ run = [
6
+ { task = "test:client" },
7
+ { task = "test:typecheck" },
8
+ ]
9
+
10
+ [tasks."test:client"]
11
+ run = "npx vitest --config ./.config/vitest.client.ts"
12
+
13
+ [tasks."test:typecheck"]
14
+ run = "npx tsc --noEmit --project ./.config/tsconfig.test.json"
15
+
16
+ [tasks.update]
17
+ run = [
18
+ "npx npm-check-updates --target minor -u --cooldown 3",
19
+ "npm install",
20
+ "npx playwright install chromium --with-deps",
21
+ "npm audit",
22
+ ]
23
+
24
+ [tasks.build]
25
+ run = "npx tsc --project ./.config/tsconfig.build.json"
26
+
27
+ [tasks.doc]
28
+ run = "npx depcruise src --include-only '^src' --output-type dot --config .config/dependency-cruiser.cjs | dot -T svg > ../doc/public/dependency-graph.svg"
@@ -0,0 +1,18 @@
1
+ interface PrecommitHandlerController {
2
+ redirect(
3
+ url: string,
4
+ options?: {
5
+ state?: unknown;
6
+ history?: NavigationHistoryBehavior;
7
+ },
8
+ ): void;
9
+ }
10
+
11
+ type NavigationInterceptPrecommitHandler = (
12
+ controller: PrecommitHandlerController,
13
+ ) => Promise<void>;
14
+
15
+ interface NavigationInterceptOptions {
16
+ /** @see https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController */
17
+ precommitHandler?: NavigationInterceptPrecommitHandler;
18
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "extends": [
3
+ "@tsconfig/strictest"
4
+ ],
5
+ "include": [
6
+ "./env.d.ts",
7
+ "../src/**/*"
8
+ ],
9
+ "compilerOptions": {
10
+ "types": [
11
+ "navigation-api-types",
12
+ "./navigation-api.d.ts"
13
+ ],
14
+ "lib": [
15
+ "DOM",
16
+ "ESNext"
17
+ ],
18
+ "jsx": "preserve",
19
+ "noEmit": false,
20
+ "outDir": "../dist",
21
+ "declaration": true,
22
+ "declarationMap": true,
23
+ "target": "es2020",
24
+ "module": "nodenext",
25
+ "moduleResolution": "nodenext",
26
+ "erasableSyntaxOnly": true
27
+ }
28
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "extends": [
3
+ "@tsconfig/node22",
4
+ "@tsconfig/strictest"
5
+ ],
6
+ "include": [
7
+ "./**/*"
8
+ ],
9
+ "compilerOptions": {
10
+ "types": [
11
+ "node"
12
+ ],
13
+ "lib": [
14
+ "ESNext"
15
+ ],
16
+ "noEmit": true,
17
+ "module": "nodenext",
18
+ "moduleResolution": "nodenext",
19
+ "erasableSyntaxOnly": true
20
+ }
21
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "extends": [
3
+ "@tsconfig/strictest"
4
+ ],
5
+ "include": [
6
+ "./env.d.ts",
7
+ "../src/**/*",
8
+ "../tests/**/*"
9
+ ],
10
+ "compilerOptions": {
11
+ "types": [
12
+ "navigation-api-types",
13
+ "./navigation-api.d.ts"
14
+ ],
15
+ "lib": [
16
+ "DOM",
17
+ "ESNext"
18
+ ],
19
+ "jsx": "preserve",
20
+ "noEmit": true,
21
+ "target": "es2020",
22
+ "module": "nodenext",
23
+ "moduleResolution": "nodenext",
24
+ "erasableSyntaxOnly": true
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "extends": [
3
+ "@tsconfig/strictest"
4
+ ],
5
+ "include": [
6
+ "./env.d.ts",
7
+ "../src/**/*",
8
+ "../tests/**/*"
9
+ ],
10
+ "compilerOptions": {
11
+ "types": [
12
+ "navigation-api-types",
13
+ "./navigation-api.d.ts"
14
+ ],
15
+ "lib": [
16
+ "DOM",
17
+ "ESNext"
18
+ ],
19
+ "jsx": "preserve",
20
+ "noEmit": true,
21
+ "target": "es2020",
22
+ "module": "nodenext",
23
+ "moduleResolution": "nodenext",
24
+ "erasableSyntaxOnly": true
25
+ }
26
+ }
@@ -0,0 +1,30 @@
1
+ import react from "@vitejs/plugin-react";
2
+ import { playwright } from "@vitest/browser-playwright";
3
+ import { defineConfig } from "vitest/config";
4
+ import isDebugMode from "./_is-debug-mode.js";
5
+
6
+ export default defineConfig({
7
+ plugins: [
8
+ react(),
9
+ ],
10
+ esbuild: {
11
+ target: "es2020",
12
+ },
13
+ define: {
14
+ __DEBUG__: String(isDebugMode()),
15
+ },
16
+ test: {
17
+ include: [
18
+ "tests/**/*.test.ts",
19
+ "tests/**/*.test.tsx",
20
+ ],
21
+ browser: {
22
+ provider: playwright(),
23
+ enabled: true,
24
+ headless: true,
25
+ instances: [
26
+ { browser: "chromium" },
27
+ ],
28
+ },
29
+ },
30
+ });
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "soseki",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "sideEffects": false,
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/soseki.d.ts",
10
+ "default": "./dist/soseki.js"
11
+ },
12
+ "./core": {
13
+ "types": "./dist/core.d.ts",
14
+ "default": "./dist/core.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "regexparam": "^3.0.0",
19
+ "type-name": "^2.0.2"
20
+ },
21
+ "peerDependencies": {
22
+ "react": "^19.0.0",
23
+ "valibot": "^1.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@tsconfig/node22": "^22.0.5",
27
+ "@tsconfig/strictest": "^2.0.8",
28
+ "@types/node": "^22.19.3",
29
+ "@types/react": "^19.2.7",
30
+ "@types/react-dom": "^19.2.3",
31
+ "@types/type-name": "^1.0.32",
32
+ "@vitest/browser": "^4.0.16",
33
+ "@vitest/browser-playwright": "^4.0.16",
34
+ "@vitejs/plugin-react": "^5.1.2",
35
+ "dependency-cruiser": "^17.3.5",
36
+ "navigation-api-types": "^0.6.1",
37
+ "npm-check-updates": "^19.2.0",
38
+ "playwright": "^1.57.0",
39
+ "react": "^19.2.3",
40
+ "react-dom": "^19.2.3",
41
+ "valibot": "^1.2.0",
42
+ "vitest": "^4.0.16",
43
+ "vitest-browser-react": "^2.0.2"
44
+ }
45
+ }