@md-oss/config 0.1.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/LICENSE +5 -0
- package/README.md +60 -0
- package/package.json +34 -0
- package/tsconfig.base.json +28 -0
- package/tsconfig.node.json +10 -0
- package/tsconfig.tsx.json +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Copyright 2026 Mirasaki Development
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
+
|
|
5
|
+
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @md-oss/config
|
|
2
|
+
|
|
3
|
+
Shared TypeScript configuration for the monorepo. Provides consistent compiler settings across all packages.
|
|
4
|
+
|
|
5
|
+
## Available Configurations
|
|
6
|
+
|
|
7
|
+
- **`tsconfig.base.json`** - Base configuration for Node.js packages (recommended for most packages)
|
|
8
|
+
- **`tsconfig.node.json`** - Strict Node.js environment configuration
|
|
9
|
+
- **`tsconfig.tsx.json`** - Configuration for React/TSX projects
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### For standard packages
|
|
14
|
+
|
|
15
|
+
Extend the base configuration in your package's `tsconfig.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"extends": "@md-oss/config/tsconfig.base.json",
|
|
20
|
+
"compilerOptions": {
|
|
21
|
+
"outDir": "./dist",
|
|
22
|
+
"rootDir": "./src"
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"],
|
|
25
|
+
"exclude": ["node_modules", "dist"]
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### For React/Next.js projects
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"extends": "@md-oss/config/tsconfig.tsx.json",
|
|
34
|
+
"compilerOptions": {
|
|
35
|
+
"outDir": "./dist"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### For Node.js-specific packages
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"extends": "@md-oss/config/tsconfig.node.json",
|
|
45
|
+
"compilerOptions": {
|
|
46
|
+
"outDir": "./dist"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Benefits
|
|
52
|
+
|
|
53
|
+
- **Consistency**: All packages use the same compiler settings
|
|
54
|
+
- **Maintainability**: Update TypeScript config in one place
|
|
55
|
+
- **Best practices**: Configurations follow TypeScript and ecosystem best practices
|
|
56
|
+
- **Type safety**: Strict mode enabled by default for better code quality
|
|
57
|
+
|
|
58
|
+
## Adding to New Packages
|
|
59
|
+
|
|
60
|
+
When creating packages with turbo generators (`pnpm gen:package`), the base configuration is automatically included.
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@md-oss/config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public",
|
|
7
|
+
"registry": "https://registry.npmjs.org/"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+ssh://git@github.com/Mirasaki-OSS/monorepo-template.git",
|
|
12
|
+
"directory": "vendor/config"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"files": [
|
|
17
|
+
"tsconfig.base.json",
|
|
18
|
+
"tsconfig.node.json",
|
|
19
|
+
"tsconfig.tsx.json",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
"./tsconfig.base.json": "./tsconfig.base.json",
|
|
25
|
+
"./tsconfig.node.json": "./tsconfig.node.json",
|
|
26
|
+
"./tsconfig.tsx.json": "./tsconfig.tsx.json"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"typescript": "^5.9.3"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "git clean -xdf .turbo dist node_modules tsconfig.tsbuildinfo"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022", // Specify ECMAScript target version
|
|
4
|
+
"useDefineForClassFields": true, // Use ECMAScript standard for class fields
|
|
5
|
+
"lib": ["ES2022", "DOM"], // Specify library files to be included
|
|
6
|
+
"module": "Preserve", // Specify module code generation
|
|
7
|
+
"skipLibCheck": true, // Skip type checking of declaration files
|
|
8
|
+
"esModuleInterop": true, // Use correct ESM import behavior
|
|
9
|
+
"allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
|
|
10
|
+
"strict": true, // Enable all strict type-checking options
|
|
11
|
+
"noImplicitAny": true, // Raise error on expressions and declarations with an implied 'any' type
|
|
12
|
+
"strictNullChecks": true, // Enable strict null checks
|
|
13
|
+
"strictFunctionTypes": true, // Enable strict checking of function types
|
|
14
|
+
"strictBindCallApply": true, // Enable strict 'bind', 'call', and 'apply' methods on functions
|
|
15
|
+
"strictPropertyInitialization": true, // Enable strict checking of property initialization in classes
|
|
16
|
+
"noImplicitThis": true, // Raise error on 'this' expressions with an implied 'any' type
|
|
17
|
+
"alwaysStrict": true, // Parse in strict mode and emit "use strict" for each source file
|
|
18
|
+
"noUnusedLocals": true, // Report errors on unused locals
|
|
19
|
+
"noUnusedParameters": true, // Raise an error when a function parameter isn't read
|
|
20
|
+
"noImplicitReturns": true, // Report error when not all code paths in function return a value
|
|
21
|
+
"noFallthroughCasesInSwitch": true, // Report errors for fallthrough cases in switch statement
|
|
22
|
+
"resolveJsonModule": true, // Allow JSON modules to be imported
|
|
23
|
+
"isolatedModules": true, // Disallow features that require cross-file awareness
|
|
24
|
+
"declaration": true, // Generate .d.ts files from TypeScript files
|
|
25
|
+
"declarationMap": true, // Create sourcemaps for d.ts files
|
|
26
|
+
"sourceMap": true // Generate corresponding .map files
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "Node16", // Specify module code generation
|
|
5
|
+
"moduleResolution": "Node16", // Specify module resolution strategy
|
|
6
|
+
"types": [
|
|
7
|
+
"node" // Include Node.js type definitions (@types/node)
|
|
8
|
+
]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// https://tsx.is/typescript#recommendation
|
|
5
|
+
"moduleDetection": "force", // Treat files as modules even if it doesn't use import/export
|
|
6
|
+
"module": "Preserve", // Ignore module structure
|
|
7
|
+
"allowJs": true, // Allow JS files to be imported from TS and vice versa
|
|
8
|
+
"verbatimModuleSyntax": true, // Preserve module syntax as-is
|
|
9
|
+
"jsx": "react-jsx"
|
|
10
|
+
}
|
|
11
|
+
}
|