@langpkg/mcs_gen 0.0.7 → 0.0.9
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/README.md +1 -1
- package/dist/index.cjs +11 -54
- package/dist/index.d.cts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +11 -54
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<p align="center" style="font-style:italic; color:gray;">
|
|
12
12
|
----------------<br>
|
|
13
13
|
</p>
|
|
14
|
-
<img data="version" src="https://img.shields.io/badge/v-0.0.
|
|
14
|
+
<img data="version" src="https://img.shields.io/badge/v-0.0.9-black"/>
|
|
15
15
|
<a href="https://github.com/langpkg/pkg"><img src="https://img.shields.io/badge/part of-langpkg/pkg-black"/></a>
|
|
16
16
|
<br>
|
|
17
17
|
<img src="https://img.shields.io/badge/coverage-~%25-brightgreen" alt="Test Coverage" />
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var mcs_fmt=require('@langpkg/mcs_fmt');function
|
|
2
|
-
`}function
|
|
1
|
+
'use strict';var mcs_fmt=require('@langpkg/mcs_fmt');function u(){let e=mcs_fmt.formatJSON(JSON.stringify({"files.exclude":{"**/.git":true,"**/.svn":true,"**/.hg":true,"**/.DS_Store":true,"**/Thumbs.db":true,"eslint.config.mjs":true,"bun.lock":true,"package-lock.json":true,LICENSE:true,".gitignore":true,".gitattributes":true,".npmignore":true,node_modules:true,"tsup.config.ts":true,"tsconfig.json":true},"hide-files.files":["eslint.config.mjs",".pkg",".vscode","bun.lock","package-lock.json","LICENSE",".gitignore",".gitattributes",".npmignore","node_modules","tsup.config.ts","tsconfig.json"]}),".vscode/settings.json");if(e.errors?.length)throw console.error("Error formatting vscode settings:",JSON.stringify(e.errors,null,2)),new Error("Failed to generate vscode settings due to formatting errors.");return e.formatted+`
|
|
2
|
+
`}function m(t,e){let n=e.org&&e.repoName?`https://github.com/${e.org}/${e.repoName}`:"",o=[e.author.name,e.author.email?`<${e.author.email}>`:""].filter(Boolean).join(" "),r={name:e.name,version:e.version,description:e.description,keywords:[],license:e.license,author:o||"",repository:n?{type:"git",url:`git+${n}.git`}:"",type:"module",files:["dist"],main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts",require:"./dist/index.cjs"}},scripts:{},dependencies:{},devDependencies:{"@eslint/js":"^9.39.4","@stylistic/eslint-plugin":"^5.10.0","@types/bun":"^1.3.13","@types/node":"^25.7.0","bun-plugin-dts":"^0.3.0","bun-types":"^1.3.13","ts-node":"^10.9.2",tsup:"^8.5.1",typescript:"^5.9.3","typescript-eslint":"^8.59.3"}};if(t==="cli"){let a=e.name.replace(/^@[^/]+\//,""),l={};for(let[g,S]of Object.entries(r))l[g]=S,g==="type"&&(l.bin={[a]:"./dist/index.js"},l.pkg={type:"cli"});Object.keys(r).forEach(g=>delete r[g]),Object.assign(r,l);}else r.pkg={type:"lib"};let c=mcs_fmt.formatJSON(JSON.stringify(r),"package.json");if(c.errors?.length)throw console.error("Error formatting package.json:",JSON.stringify(c.errors,null,2)),new Error("Failed to generate package.json due to formatting errors.");return c.formatted+`
|
|
3
3
|
`}function p(t){let n=mcs_fmt.formatJSON(JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["node"],declaration:t==="pkg",outDir:"./dist",strict:true,esModuleInterop:true,skipLibCheck:true,forceConsistentCasingInFileNames:true,resolveJsonModule:true,isolatedModules:true,allowImportingTsExtensions:true,noEmit:true,ignoreDeprecations:"6.0"},include:["src","test"],exclude:["node_modules","dist"]}),"tsconfig.json");if(n.errors?.length)throw console.error("Error formatting tsconfig.json:",JSON.stringify(n.errors,null,2)),new Error("Failed to generate tsconfig.json due to formatting errors.");return n.formatted+`
|
|
4
4
|
`}function s(t,e,n=true){let o=n?`
|
|
5
5
|
|
|
@@ -49,17 +49,19 @@ import stylistic from '@stylistic/eslint-plugin';
|
|
|
49
49
|
`,o=i("test/index.test.ts",e)+s("PACK",`import { describe, it, expect } from 'bun:test';
|
|
50
50
|
`+(t==="pkg"?`import { add } from '../src';
|
|
51
51
|
`:""))+s("TEST",n),r=mcs_fmt.formatTS(o,"test/index.test.ts");if(r.errors?.length)throw console.error("Error formatting test/index.test.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate test/index.test.ts due to formatting errors.");return r.formatted+`
|
|
52
|
-
`}function
|
|
52
|
+
`}function h(t,e){let n={clean:true,dts:true,entry:["src/index.ts"],format:["esm","cjs"],minify:true,sourcemap:false,splitting:true};t==="pkg"&&Object.assign(n,{clean:true,dts:true,entry:["src/index.ts"],format:["esm","cjs"],minify:true,sourcemap:false,splitting:false,treeshake:true,external:["bun"],target:"es2022",outDir:"dist"}),t==="cli"&&(n.banner={js:"#!/usr/bin/env bun"});let o=i("tsup.config.ts",e)+s("PACK",`import { defineConfig } from 'tsup';
|
|
53
53
|
`)+s("CONST",`const rules = ${mcs_fmt.formatJSON(JSON.stringify(n)).formatted}`)+s("CONF",`// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
54
|
export default defineConfig(rules as any);
|
|
55
55
|
`),r=mcs_fmt.formatTS(o,"tsup.config.ts");if(r.errors?.length)throw console.error("Error formatting tsup.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate tsup.config.ts due to formatting errors.");return r.formatted+`
|
|
56
|
-
`}function
|
|
56
|
+
`}function b(){return `# Dependencies
|
|
57
57
|
node_modules/
|
|
58
58
|
package-lock.json
|
|
59
59
|
yarn.lock
|
|
60
60
|
pnpm-lock.yaml
|
|
61
61
|
bun.lockb
|
|
62
62
|
|
|
63
|
+
bun.lock
|
|
64
|
+
|
|
63
65
|
# Build outputs
|
|
64
66
|
dist/
|
|
65
67
|
build/
|
|
@@ -85,9 +87,9 @@ Thumbs.db
|
|
|
85
87
|
# Test coverage
|
|
86
88
|
coverage/
|
|
87
89
|
.nyc_output/
|
|
88
|
-
`}function
|
|
90
|
+
`}function M(t){let e=t.author.name||"",n=t.author.email||"",o=typeof t.author.github=="string"?t.author.github.trim():"",r=o?o.includes("github.com")?o:`https://github.com/${o.replace(/^@/,"")}`:"";return e?r?`${e} (${r})`:n?`${e} (${n})`:e:""}function F(t){let e=new Date().getFullYear(),n=M(t);return `Copyright (c) ${e}${n?" "+n:""}`}function x(t){return `MIT License
|
|
89
91
|
|
|
90
|
-
${
|
|
92
|
+
${F(t)}
|
|
91
93
|
|
|
92
94
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
93
95
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -106,52 +108,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
106
108
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
107
109
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
108
110
|
SOFTWARE.
|
|
109
|
-
`}function E(){
|
|
110
|
-
src/
|
|
111
|
-
test/
|
|
112
|
-
*.test.ts
|
|
113
|
-
*.tsbuildinfo
|
|
114
|
-
|
|
115
|
-
# Build and package artifacts
|
|
116
|
-
.pkg/
|
|
117
|
-
assets/
|
|
118
|
-
|
|
119
|
-
# Configuration files
|
|
120
|
-
tsconfig.json
|
|
121
|
-
eslint.config.mjs
|
|
122
|
-
tsup.config.ts
|
|
123
|
-
vitest.config.ts
|
|
124
|
-
jest.config.js
|
|
125
|
-
|
|
126
|
-
# Documentation (keep README only)
|
|
127
|
-
docs/
|
|
128
|
-
CHANGELOG.md
|
|
129
|
-
CONTRIBUTING.md
|
|
130
|
-
|
|
131
|
-
# Development files
|
|
132
|
-
.vscode/
|
|
133
|
-
.idea/
|
|
134
|
-
.env
|
|
135
|
-
.env.local
|
|
136
|
-
.DS_Store
|
|
137
|
-
Thumbs.db
|
|
138
|
-
|
|
139
|
-
# Git and version control
|
|
140
|
-
.git/
|
|
141
|
-
.gitignore
|
|
142
|
-
.gitattributes
|
|
143
|
-
|
|
144
|
-
# Package manager lock files
|
|
145
|
-
package-lock.json
|
|
146
|
-
yarn.lock
|
|
147
|
-
pnpm-lock.yaml
|
|
148
|
-
bun.lockb
|
|
149
|
-
|
|
150
|
-
# IDE and editor files
|
|
151
|
-
*.swp
|
|
152
|
-
*.swo
|
|
153
|
-
*~
|
|
154
|
-
`}function T(t,e){let n=t==="cli"?L(e):$(e),o=mcs_fmt.formatMD(n,"README.md");if(o.errors?.length)throw console.error("Error formatting readme:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate readme due to formatting errors.");return o.formatted+`
|
|
111
|
+
`}function E(t,e){let n=t==="cli"?L(e):v(e),o=mcs_fmt.formatMD(n,"README.md");if(o.errors?.length)throw console.error("Error formatting readme:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate readme due to formatting errors.");return o.formatted+`
|
|
155
112
|
`}function L(t){return `# ${t.name}
|
|
156
113
|
|
|
157
114
|
${t.description||"A TypeScript command-line tool."}
|
|
@@ -180,7 +137,7 @@ pkg build # Build for production
|
|
|
180
137
|
## License
|
|
181
138
|
|
|
182
139
|
${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
|
|
183
|
-
`}function
|
|
140
|
+
`}function v(t){return `# ${t.name}
|
|
184
141
|
|
|
185
142
|
${t.description||"A TypeScript library."}
|
|
186
143
|
|
|
@@ -210,4 +167,4 @@ pkg test # Run tests
|
|
|
210
167
|
## License
|
|
211
168
|
|
|
212
169
|
${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
|
|
213
|
-
`}var
|
|
170
|
+
`}var T=class extends Error{constructor(n,o,r){super(n);this.code=o;this.ctx=r;this.name="PkgError";}};function Re(t,e,n){switch(t){case "package.json":return m(e,n);case "tsconfig.json":return p(e);case ".vscode/settings.json":return u();case "tsup.config.ts":return h(e,n);case "eslint.config.mjs":return d(e,n);case "src/index.ts":return f(e,n);case "test/index.test.ts":return y(e,n);case "README.md":return E(e,n);case ".gitignore":return b();case "LICENSE":return x(n);default:throw new Error(`Unknown file: ${t}`)}}exports.PkgError=T;exports.generateEslintConfig=d;exports.generateFile=Re;exports.generateGitignore=b;exports.generateLicense=x;exports.generatePackageJson=m;exports.generateReadme=E;exports.generateSourceIndexTs=f;exports.generateTestIndexTs=y;exports.generateTsconfig=p;exports.generateTsupConfig=h;exports.generateVscodeSettings=u;
|
package/dist/index.d.cts
CHANGED
|
@@ -82,12 +82,10 @@ declare function generateGitignore(): string;
|
|
|
82
82
|
|
|
83
83
|
declare function generateLicense(meta: ProjectMeta): string;
|
|
84
84
|
|
|
85
|
-
declare function generateNpmignore(): string;
|
|
86
|
-
|
|
87
85
|
/**
|
|
88
86
|
* Main entry point for file generation
|
|
89
87
|
* Routes filename to the appropriate generator function
|
|
90
88
|
*/
|
|
91
89
|
declare function generateFile(filename: string, projectType: ProjectType, meta: ProjectMeta): string;
|
|
92
90
|
|
|
93
|
-
export { type FormatError, type FormatFix, type FormatIssue, type FormatResult, type IssueSeverity, PkgError, type ProjectMeta, type ProjectType, generateEslintConfig, generateFile, generateGitignore, generateLicense,
|
|
91
|
+
export { type FormatError, type FormatFix, type FormatIssue, type FormatResult, type IssueSeverity, PkgError, type ProjectMeta, type ProjectType, generateEslintConfig, generateFile, generateGitignore, generateLicense, generatePackageJson, generateReadme, generateSourceIndexTs, generateTestIndexTs, generateTsconfig, generateTsupConfig, generateVscodeSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,12 +82,10 @@ declare function generateGitignore(): string;
|
|
|
82
82
|
|
|
83
83
|
declare function generateLicense(meta: ProjectMeta): string;
|
|
84
84
|
|
|
85
|
-
declare function generateNpmignore(): string;
|
|
86
|
-
|
|
87
85
|
/**
|
|
88
86
|
* Main entry point for file generation
|
|
89
87
|
* Routes filename to the appropriate generator function
|
|
90
88
|
*/
|
|
91
89
|
declare function generateFile(filename: string, projectType: ProjectType, meta: ProjectMeta): string;
|
|
92
90
|
|
|
93
|
-
export { type FormatError, type FormatFix, type FormatIssue, type FormatResult, type IssueSeverity, PkgError, type ProjectMeta, type ProjectType, generateEslintConfig, generateFile, generateGitignore, generateLicense,
|
|
91
|
+
export { type FormatError, type FormatFix, type FormatIssue, type FormatResult, type IssueSeverity, PkgError, type ProjectMeta, type ProjectType, generateEslintConfig, generateFile, generateGitignore, generateLicense, generatePackageJson, generateReadme, generateSourceIndexTs, generateTestIndexTs, generateTsconfig, generateTsupConfig, generateVscodeSettings };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {formatJSON,formatTS,formatMD}from'@langpkg/mcs_fmt';function
|
|
2
|
-
`}function
|
|
1
|
+
import {formatJSON,formatTS,formatMD}from'@langpkg/mcs_fmt';function u(){let e=formatJSON(JSON.stringify({"files.exclude":{"**/.git":true,"**/.svn":true,"**/.hg":true,"**/.DS_Store":true,"**/Thumbs.db":true,"eslint.config.mjs":true,"bun.lock":true,"package-lock.json":true,LICENSE:true,".gitignore":true,".gitattributes":true,".npmignore":true,node_modules:true,"tsup.config.ts":true,"tsconfig.json":true},"hide-files.files":["eslint.config.mjs",".pkg",".vscode","bun.lock","package-lock.json","LICENSE",".gitignore",".gitattributes",".npmignore","node_modules","tsup.config.ts","tsconfig.json"]}),".vscode/settings.json");if(e.errors?.length)throw console.error("Error formatting vscode settings:",JSON.stringify(e.errors,null,2)),new Error("Failed to generate vscode settings due to formatting errors.");return e.formatted+`
|
|
2
|
+
`}function m(t,e){let n=e.org&&e.repoName?`https://github.com/${e.org}/${e.repoName}`:"",o=[e.author.name,e.author.email?`<${e.author.email}>`:""].filter(Boolean).join(" "),r={name:e.name,version:e.version,description:e.description,keywords:[],license:e.license,author:o||"",repository:n?{type:"git",url:`git+${n}.git`}:"",type:"module",files:["dist"],main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts",require:"./dist/index.cjs"}},scripts:{},dependencies:{},devDependencies:{"@eslint/js":"^9.39.4","@stylistic/eslint-plugin":"^5.10.0","@types/bun":"^1.3.13","@types/node":"^25.7.0","bun-plugin-dts":"^0.3.0","bun-types":"^1.3.13","ts-node":"^10.9.2",tsup:"^8.5.1",typescript:"^5.9.3","typescript-eslint":"^8.59.3"}};if(t==="cli"){let a=e.name.replace(/^@[^/]+\//,""),l={};for(let[g,S]of Object.entries(r))l[g]=S,g==="type"&&(l.bin={[a]:"./dist/index.js"},l.pkg={type:"cli"});Object.keys(r).forEach(g=>delete r[g]),Object.assign(r,l);}else r.pkg={type:"lib"};let c=formatJSON(JSON.stringify(r),"package.json");if(c.errors?.length)throw console.error("Error formatting package.json:",JSON.stringify(c.errors,null,2)),new Error("Failed to generate package.json due to formatting errors.");return c.formatted+`
|
|
3
3
|
`}function p(t){let n=formatJSON(JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["node"],declaration:t==="pkg",outDir:"./dist",strict:true,esModuleInterop:true,skipLibCheck:true,forceConsistentCasingInFileNames:true,resolveJsonModule:true,isolatedModules:true,allowImportingTsExtensions:true,noEmit:true,ignoreDeprecations:"6.0"},include:["src","test"],exclude:["node_modules","dist"]}),"tsconfig.json");if(n.errors?.length)throw console.error("Error formatting tsconfig.json:",JSON.stringify(n.errors,null,2)),new Error("Failed to generate tsconfig.json due to formatting errors.");return n.formatted+`
|
|
4
4
|
`}function s(t,e,n=true){let o=n?`
|
|
5
5
|
|
|
@@ -49,17 +49,19 @@ import stylistic from '@stylistic/eslint-plugin';
|
|
|
49
49
|
`,o=i("test/index.test.ts",e)+s("PACK",`import { describe, it, expect } from 'bun:test';
|
|
50
50
|
`+(t==="pkg"?`import { add } from '../src';
|
|
51
51
|
`:""))+s("TEST",n),r=formatTS(o,"test/index.test.ts");if(r.errors?.length)throw console.error("Error formatting test/index.test.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate test/index.test.ts due to formatting errors.");return r.formatted+`
|
|
52
|
-
`}function
|
|
52
|
+
`}function h(t,e){let n={clean:true,dts:true,entry:["src/index.ts"],format:["esm","cjs"],minify:true,sourcemap:false,splitting:true};t==="pkg"&&Object.assign(n,{clean:true,dts:true,entry:["src/index.ts"],format:["esm","cjs"],minify:true,sourcemap:false,splitting:false,treeshake:true,external:["bun"],target:"es2022",outDir:"dist"}),t==="cli"&&(n.banner={js:"#!/usr/bin/env bun"});let o=i("tsup.config.ts",e)+s("PACK",`import { defineConfig } from 'tsup';
|
|
53
53
|
`)+s("CONST",`const rules = ${formatJSON(JSON.stringify(n)).formatted}`)+s("CONF",`// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
54
|
export default defineConfig(rules as any);
|
|
55
55
|
`),r=formatTS(o,"tsup.config.ts");if(r.errors?.length)throw console.error("Error formatting tsup.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate tsup.config.ts due to formatting errors.");return r.formatted+`
|
|
56
|
-
`}function
|
|
56
|
+
`}function b(){return `# Dependencies
|
|
57
57
|
node_modules/
|
|
58
58
|
package-lock.json
|
|
59
59
|
yarn.lock
|
|
60
60
|
pnpm-lock.yaml
|
|
61
61
|
bun.lockb
|
|
62
62
|
|
|
63
|
+
bun.lock
|
|
64
|
+
|
|
63
65
|
# Build outputs
|
|
64
66
|
dist/
|
|
65
67
|
build/
|
|
@@ -85,9 +87,9 @@ Thumbs.db
|
|
|
85
87
|
# Test coverage
|
|
86
88
|
coverage/
|
|
87
89
|
.nyc_output/
|
|
88
|
-
`}function
|
|
90
|
+
`}function M(t){let e=t.author.name||"",n=t.author.email||"",o=typeof t.author.github=="string"?t.author.github.trim():"",r=o?o.includes("github.com")?o:`https://github.com/${o.replace(/^@/,"")}`:"";return e?r?`${e} (${r})`:n?`${e} (${n})`:e:""}function F(t){let e=new Date().getFullYear(),n=M(t);return `Copyright (c) ${e}${n?" "+n:""}`}function x(t){return `MIT License
|
|
89
91
|
|
|
90
|
-
${
|
|
92
|
+
${F(t)}
|
|
91
93
|
|
|
92
94
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
93
95
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -106,52 +108,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
106
108
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
107
109
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
108
110
|
SOFTWARE.
|
|
109
|
-
`}function E(){
|
|
110
|
-
src/
|
|
111
|
-
test/
|
|
112
|
-
*.test.ts
|
|
113
|
-
*.tsbuildinfo
|
|
114
|
-
|
|
115
|
-
# Build and package artifacts
|
|
116
|
-
.pkg/
|
|
117
|
-
assets/
|
|
118
|
-
|
|
119
|
-
# Configuration files
|
|
120
|
-
tsconfig.json
|
|
121
|
-
eslint.config.mjs
|
|
122
|
-
tsup.config.ts
|
|
123
|
-
vitest.config.ts
|
|
124
|
-
jest.config.js
|
|
125
|
-
|
|
126
|
-
# Documentation (keep README only)
|
|
127
|
-
docs/
|
|
128
|
-
CHANGELOG.md
|
|
129
|
-
CONTRIBUTING.md
|
|
130
|
-
|
|
131
|
-
# Development files
|
|
132
|
-
.vscode/
|
|
133
|
-
.idea/
|
|
134
|
-
.env
|
|
135
|
-
.env.local
|
|
136
|
-
.DS_Store
|
|
137
|
-
Thumbs.db
|
|
138
|
-
|
|
139
|
-
# Git and version control
|
|
140
|
-
.git/
|
|
141
|
-
.gitignore
|
|
142
|
-
.gitattributes
|
|
143
|
-
|
|
144
|
-
# Package manager lock files
|
|
145
|
-
package-lock.json
|
|
146
|
-
yarn.lock
|
|
147
|
-
pnpm-lock.yaml
|
|
148
|
-
bun.lockb
|
|
149
|
-
|
|
150
|
-
# IDE and editor files
|
|
151
|
-
*.swp
|
|
152
|
-
*.swo
|
|
153
|
-
*~
|
|
154
|
-
`}function T(t,e){let n=t==="cli"?L(e):$(e),o=formatMD(n,"README.md");if(o.errors?.length)throw console.error("Error formatting readme:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate readme due to formatting errors.");return o.formatted+`
|
|
111
|
+
`}function E(t,e){let n=t==="cli"?L(e):v(e),o=formatMD(n,"README.md");if(o.errors?.length)throw console.error("Error formatting readme:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate readme due to formatting errors.");return o.formatted+`
|
|
155
112
|
`}function L(t){return `# ${t.name}
|
|
156
113
|
|
|
157
114
|
${t.description||"A TypeScript command-line tool."}
|
|
@@ -180,7 +137,7 @@ pkg build # Build for production
|
|
|
180
137
|
## License
|
|
181
138
|
|
|
182
139
|
${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
|
|
183
|
-
`}function
|
|
140
|
+
`}function v(t){return `# ${t.name}
|
|
184
141
|
|
|
185
142
|
${t.description||"A TypeScript library."}
|
|
186
143
|
|
|
@@ -210,4 +167,4 @@ pkg test # Run tests
|
|
|
210
167
|
## License
|
|
211
168
|
|
|
212
169
|
${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
|
|
213
|
-
`}var
|
|
170
|
+
`}var T=class extends Error{constructor(n,o,r){super(n);this.code=o;this.ctx=r;this.name="PkgError";}};function Re(t,e,n){switch(t){case "package.json":return m(e,n);case "tsconfig.json":return p(e);case ".vscode/settings.json":return u();case "tsup.config.ts":return h(e,n);case "eslint.config.mjs":return d(e,n);case "src/index.ts":return f(e,n);case "test/index.test.ts":return y(e,n);case "README.md":return E(e,n);case ".gitignore":return b();case "LICENSE":return x(n);default:throw new Error(`Unknown file: ${t}`)}}export{T as PkgError,d as generateEslintConfig,Re as generateFile,b as generateGitignore,x as generateLicense,m as generatePackageJson,E as generateReadme,f as generateSourceIndexTs,y as generateTestIndexTs,p as generateTsconfig,h as generateTsupConfig,u as generateVscodeSettings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langpkg/mcs_gen",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "maysara code style generator",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"import": "./dist/index.js",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"require": "./dist/index.cjs",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"module": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@langpkg/mcs_fmt": "^0.0.
|
|
29
|
+
"@langpkg/mcs_fmt": "^0.0.7",
|
|
30
30
|
"glob": "^13.0.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|