@shibanet0/datamitsu-config 0.0.3-alpha-27 → 0.0.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shibanet0/datamitsu-config
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,133 @@
1
- # datamitsu-config
1
+ # @shibanet0/datamitsu-config
2
2
 
3
- Reusable configurations for TypeScript, ESLint, Prettier and other tools.
3
+ <p align="center">
4
+ <img src="https://datamitsu.com/img/logo.png" alt="datamitsu" width="400" />
5
+ </p>
4
6
 
5
- ## TypeScript Configurations
7
+ Shared configuration package for [datamitsu](https://datamitsu.com/) that provides a comprehensive collection of development tools with unified management. Install once, get linters, formatters, security scanners, and build tools — all versioned and configured together.
6
8
 
7
- See [TSCONFIG.md](https://github.com/shibanet0/datamitsu-config/blob/main/TSCONFIG.md) for full documentation.
9
+ ## Installation
8
10
 
9
- **Available configs:**
11
+ ### npm/pnpm (recommended)
10
12
 
11
- - `base.json` - for any projects
12
- - `library.json` - standalone libraries
13
- - `react-library.json` - standalone React libraries
14
- - `service.json` - backend services
15
- - `shared-library.json` - libraries in monorepo
16
- - `shared-react-library.json` - React libraries in monorepo
17
- - `nextjs.json` - Next.js apps
13
+ ```bash
14
+ pnpm add -D @shibanet0/datamitsu-config
15
+ ```
16
+
17
+ ### Docker
18
+
19
+ Pre-built Docker images with all tools pre-installed for fast CI/CD:
20
+
21
+ **Stable releases (Debian default):**
22
+
23
+ ```bash
24
+ # Latest stable
25
+ docker pull ghcr.io/shibanet0/datamitsu-config:latest
26
+
27
+ # Specific version
28
+ docker pull ghcr.io/shibanet0/datamitsu-config:0.0.4
29
+ ```
30
+
31
+ **Stable releases (Alpine, smaller):**
32
+
33
+ ```bash
34
+ docker pull ghcr.io/shibanet0/datamitsu-config:latest-alpine
35
+ ```
36
+
37
+ **Unstable builds (bleeding edge):**
38
+
39
+ ```bash
40
+ # Latest unstable (Debian)
41
+ docker pull ghcr.io/shibanet0/datamitsu-config-unstable:unstable
42
+
43
+ # Latest unstable (Alpine)
44
+ docker pull ghcr.io/shibanet0/datamitsu-config-unstable:unstable-alpine
45
+ ```
46
+
47
+ **Usage:**
48
+
49
+ ```bash
50
+ # Run checks
51
+ docker run --rm -v "$(pwd):/workspace" ghcr.io/shibanet0/datamitsu-config:latest check
52
+
53
+ # Run specific tool
54
+ docker run --rm -v "$(pwd):/workspace" ghcr.io/shibanet0/datamitsu-config:latest exec eslint -- src/
55
+ ```
56
+
57
+ **Features:**
58
+
59
+ - Pre-installed tools (via `datamitsu init --all`)
60
+ - Multi-platform: linux/amd64, linux/arm64
61
+ - Separate registries for stable and unstable releases
62
+
63
+ **Container registries:**
64
+
65
+ - Stable: [ghcr.io/shibanet0/datamitsu-config](https://github.com/shibanet0/datamitsu-config/pkgs/container/datamitsu-config)
66
+ - Unstable: [ghcr.io/shibanet0/datamitsu-config-unstable](https://github.com/shibanet0/datamitsu-config/pkgs/container/datamitsu-config-unstable)
18
67
 
19
- **Example:**
68
+ ### Remote Config
20
69
 
21
- ```json
22
- {
23
- "extends": "@shibanet0/datamitsu-config/tsconfig/base.json"
70
+ Reference this config as a remote base configuration in your project's `datamitsu.config.js`:
71
+
72
+ ```javascript
73
+ function getRemoteConfigs() {
74
+ return [
75
+ {
76
+ url: "https://github.com/shibanet0/datamitsu-config/releases/download/v0.0.4/datamitsu.config.js",
77
+ hash: "a1b2c3d4e5f6...", // SHA-256 hash (see releases page)
78
+ },
79
+ ];
24
80
  }
81
+
82
+ globalThis.getRemoteConfigs = getRemoteConfigs;
83
+ ```
84
+
85
+ **Get the SHA-256 hash for a specific version:**
86
+
87
+ ```bash
88
+ VERSION=v0.0.4
89
+ curl -sL "https://github.com/shibanet0/datamitsu-config/releases/download/${VERSION}/datamitsu.config.js" | sha256sum
90
+ ```
91
+
92
+ Your local `getConfig()` receives the merged configuration from this remote base. See [remote configs guide](https://datamitsu.com/docs/how-to/use-remote-configs/) for details on configuration inheritance and security.
93
+
94
+ **Note:** Pin to a specific version (not `latest`) since the hash changes with each release.
95
+
96
+ Browse all releases at [GitHub Releases](https://github.com/shibanet0/datamitsu-config/releases).
97
+
98
+ ## Quick Start
99
+
100
+ After installation, initialize datamitsu in your project:
101
+
102
+ ```bash
103
+ pnpm dm init
104
+ pnpm dm setup
105
+ pnpm dm check
25
106
  ```
107
+
108
+ `dm init` installs managed tool binaries. `dm setup` initializes configuration files. `dm check` runs all configured linters and formatters in one pass.
109
+
110
+ ## What's Included
111
+
112
+ This config manages tools across multiple runtimes (Node.js, Go binaries, Python):
113
+
114
+ - **Linters & formatters** — ESLint, Prettier, oxlint, Ruff, ktlint, and more
115
+ - **Security scanners** — Semgrep, Trivy, Grype, Gitleaks, detect-secrets
116
+ - **Build tools** — TypeScript, protobuf (buf, protoc), OpenAPI generators
117
+ - **Git hooks** — commitlint, lefthook
118
+ - **Spelling & docs** — cspell, Vale, markdownlint, Mermaid CLI
119
+
120
+ See the [documentation site](https://datamitsu-config.shibanet0.com/) for complete information, or browse [docs/reference/tools.md](docs/reference/tools.md) for the full list of configured tools.
121
+
122
+ ## Documentation
123
+
124
+ - [Documentation Site](https://datamitsu-config.shibanet0.com/) — full documentation with search and navigation
125
+ - [TypeScript Configurations](docs/reference/tsconfig.md) — reusable tsconfig presets for different project types
126
+ - [Configured Tools](docs/reference/tools.md) — auto-generated list of all managed tools
127
+ - [Usage Guide](docs/get-started/usage.md) — installation, configuration, and common workflows
128
+
129
+ For datamitsu documentation, visit [datamitsu.com](https://datamitsu.com/).
130
+
131
+ ## License
132
+
133
+ MIT
package/bin/datamitsu.js CHANGED
@@ -1,24 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from "node:child_process";
3
+ import { getExePath } from "@datamitsu/datamitsu/get-exe.js";
4
+ import { spawnSync } from "node:child_process";
4
5
  import { join } from "node:path";
5
6
 
6
- import { getBinaryFilepath } from "./utils.js";
7
-
8
- const arguments_ = process.argv.slice(2);
9
-
10
- if (!arguments_.includes("--binary-command")) {
11
- arguments_.unshift("--binary-command", "pnpm datamitsu");
7
+ const args = process.argv.slice(2);
8
+ if (!args.includes("--binary-command")) {
9
+ args.unshift("--binary-command", "pnpm datamitsu");
12
10
  }
13
11
 
14
- const child = spawn(
15
- "node",
16
- [
17
- getBinaryFilepath("@datamitsu/datamitsu/package.json", "../bin/index.js"),
18
- "--before-config",
19
- join(import.meta.dirname, "../datamitsu.config.js"),
20
- ...arguments_,
21
- ],
12
+ const result = spawnSync(
13
+ getExePath(),
14
+ ["--before-config", join(import.meta.dirname, "../datamitsu.config.js"), ...args],
22
15
  {
23
16
  env: {
24
17
  ...process.env,
@@ -28,10 +21,12 @@ const child = spawn(
28
21
  },
29
22
  );
30
23
 
31
- child.on("exit", (code, signal) => {
32
- if (signal) {
33
- process.kill(process.pid, signal);
34
- } else if (code !== 0) {
35
- process.exit(code);
36
- }
37
- });
24
+ if (result.error) {
25
+ throw result.error;
26
+ }
27
+
28
+ if (result.signal) {
29
+ process.kill(process.pid, result.signal);
30
+ } else {
31
+ process.exitCode = result.status ?? 1;
32
+ }
package/bin/tsc.js CHANGED
@@ -1,19 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from "node:child_process";
3
+ import { spawnSync } from "node:child_process";
4
4
 
5
5
  import { getBinaryFilepath } from "./utils.js";
6
6
 
7
- const args = process.argv.slice(2);
7
+ const result = spawnSync(
8
+ getBinaryFilepath("typescript/package.json", "bin/tsc"),
9
+ process.argv.slice(2),
10
+ { stdio: "inherit" },
11
+ );
8
12
 
9
- const child = spawn(getBinaryFilepath("typescript/package.json", "../bin/tsc"), args, {
10
- stdio: "inherit",
11
- });
13
+ if (result.error) {
14
+ throw result.error;
15
+ }
12
16
 
13
- child.on("exit", (code, signal) => {
14
- if (signal) {
15
- process.kill(process.pid, signal);
16
- } else if (code !== 0) {
17
- process.exit(code);
18
- }
19
- });
17
+ if (result.signal) {
18
+ process.kill(process.pid, result.signal);
19
+ } else {
20
+ process.exitCode = result.status ?? 1;
21
+ }
package/bin/tsx.js CHANGED
@@ -1,19 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from "node:child_process";
3
+ import { spawnSync } from "node:child_process";
4
4
 
5
5
  import { getBinaryFilepath } from "./utils.js";
6
6
 
7
- const args = process.argv.slice(2);
7
+ const result = spawnSync(
8
+ "node",
9
+ [getBinaryFilepath("tsx", "../dist/cli.mjs"), ...process.argv.slice(2)],
10
+ { stdio: "inherit" },
11
+ );
8
12
 
9
- const child = spawn("node", [getBinaryFilepath("tsx", "../../dist/cli.mjs"), ...args], {
10
- stdio: "inherit",
11
- });
13
+ if (result.error) {
14
+ throw result.error;
15
+ }
12
16
 
13
- child.on("exit", (code, signal) => {
14
- if (signal) {
15
- process.kill(process.pid, signal);
16
- } else if (code !== 0) {
17
- process.exit(code);
18
- }
19
- });
17
+ if (result.signal) {
18
+ process.kill(process.pid, result.signal);
19
+ } else {
20
+ process.exitCode = result.status ?? 1;
21
+ }
package/bin/utils.js CHANGED
@@ -1,6 +1,6 @@
1
- import { join } from "node:path";
1
+ import { dirname, join } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
 
4
4
  export const getBinaryFilepath = (/** @type {string} */ specifier, /** @type {string} */ path) => {
5
- return join(fileURLToPath(import.meta.resolve(specifier)), path);
5
+ return join(dirname(fileURLToPath(import.meta.resolve(specifier))), path);
6
6
  };