@langpkg/mcs_gen 0.0.3 → 0.0.4

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 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.3-black"/>
14
+ <img data="version" src="https://img.shields.io/badge/v-0.0.4-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,31 +1,31 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _mcs_fmt = require('@langpkg/mcs_fmt');function m(){let e=_mcs_fmt.formatJSON.call(void 0, JSON.stringify({"files.exclude":{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,"eslint.config.mjs":!0,"bun.lock":!0,"package-lock.json":!0,LICENSE:!0,".gitignore":!0,".gitattributes":!0,".npmignore":!0,node_modules:!0,"tsup.config.ts":!0,"tsconfig.json":!0},"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(_optionalChain([e, 'access', _ => _.errors, 'optionalAccess', _2 => _2.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 u(n,e){let t=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:t?{type:"git",url:`git+${t}.git`}:"",type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},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(n==="cli"){let a=e.name.replace(/^@[^/]+\//,""),g={};for(let[l,j]of Object.entries(r))g[l]=j,l==="type"&&(g.bin={[a]:"./dist/index.js"},g.pkg={type:"cli"});Object.keys(r).forEach(l=>delete r[l]),Object.assign(r,g)}else r.pkg={type:"lib"};let c=_mcs_fmt.formatJSON.call(void 0, JSON.stringify(r),"package.json");if(_optionalChain([c, 'access', _3 => _3.errors, 'optionalAccess', _4 => _4.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
- `}function p(n){let t=_mcs_fmt.formatJSON.call(void 0, JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["node"],declaration:n==="pkg",outDir:"./dist",strict:!0,esModuleInterop:!0,skipLibCheck:!0,forceConsistentCasingInFileNames:!0,resolveJsonModule:!0,isolatedModules:!0,allowImportingTsExtensions:!0,noEmit:!0,ignoreDeprecations:"6.0"},include:["src","test"],exclude:["node_modules","dist"]}),"tsconfig.json");if(_optionalChain([t, 'access', _5 => _5.errors, 'optionalAccess', _6 => _6.length]))throw console.error("Error formatting tsconfig.json:",JSON.stringify(t.errors,null,2)),new Error("Failed to generate tsconfig.json due to formatting errors.");return t.formatted+`
4
- `}function s(n,e,t=!0){let o=t?`
1
+ 'use strict';var mcs_fmt=require('@langpkg/mcs_fmt');function m(){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 u(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"}},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(/^@[^/]+\//,""),g={};for(let[l,j]of Object.entries(r))g[l]=j,l==="type"&&(g.bin={[a]:"./dist/index.js"},g.pkg={type:"cli"});Object.keys(r).forEach(l=>delete r[l]),Object.assign(r,g);}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
+ `}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
+ `}function s(t,e,n=true){let o=n?`
5
5
 
6
6
 
7
- `:"",r="// \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 "+n+` \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
7
+ `:"",r="// \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 "+t+` \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
8
8
 
9
9
  `,c=`// \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
10
10
  `;return e=e.split(`
11
11
  `).map(a=>a===""?a:" "+a).join(`
12
12
  `),o+r+e+`
13
- `+c}function i(n,e){let t=e.author.name?`// Made with \u2764\uFE0F by ${e.author.name}.`:"// Made with \u2764\uFE0F by Maysara.";return`// ${n}
13
+ `+c}function i(t,e){let n=e.author.name?`// Made with \u2764\uFE0F by ${e.author.name}.`:"// Made with \u2764\uFE0F by Maysara.";return `// ${t}
14
14
  //
15
- ${t}
16
- `}function f(n,e){let t=i("src/index.ts",e)+s("PACK",n==="cli"?`import { cli } from '@langpkg/cli';
17
- `:"");if(n==="pkg")t+=s("MAIN",`export const add = (a: number, b: number): number => a + b;
18
- `);else{let r=`export const run = (): void => {
15
+ ${n}
16
+ `}function f(t,e){let n=i("src/index.ts",e)+s("PACK",t==="cli"?`import { cli } from '@langpkg/cli';
17
+ `:"");if(t==="pkg")n+=s("MAIN",`export const add = (a: number, b: number): number => a + b;
18
+ `);else {let r=`export const run = (): void => {
19
19
  console.log('${e.name} running...');
20
20
  };
21
21
 
22
22
  run();
23
- `;t+=s("MAIN",r)}let o=_mcs_fmt.formatTS.call(void 0, t,"src/index.ts");if(_optionalChain([o, 'access', _7 => _7.errors, 'optionalAccess', _8 => _8.length]))throw console.error("Error formatting src/index.ts:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate src/index.ts due to formatting errors.");return o.formatted+`
24
- `}function d(n,e){let t={curly:"off","@stylistic/semi":["warn","always"],"@typescript-eslint/no-empty-function":"off","@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["snake_case","camelCase"],filter:{match:!1,regex:"^_"}},{selector:"function",format:["camelCase"]},{selector:"method",format:["camelCase"]},{selector:"typeLike",format:["PascalCase"]},{selector:"import",format:["camelCase","PascalCase"]},{selector:"variable",modifiers:["const"],format:["UPPER_CASE","snake_case","camelCase"],filter:{match:!1,regex:"^_"}},{selector:"enumMember",format:["PascalCase"]}],"@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_"}]},o=i("eslint.config.ts",e)+s("PACK",`import { defineConfig } from 'eslint/config';
23
+ `;n+=s("MAIN",r);}let o=mcs_fmt.formatTS(n,"src/index.ts");if(o.errors?.length)throw console.error("Error formatting src/index.ts:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate src/index.ts due to formatting errors.");return o.formatted+`
24
+ `}function d(t,e){let n={curly:"off","@stylistic/semi":["warn","always"],"@typescript-eslint/no-empty-function":"off","@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["snake_case","camelCase"],filter:{match:false,regex:"^_"}},{selector:"function",format:["camelCase"]},{selector:"method",format:["camelCase"]},{selector:"typeLike",format:["PascalCase"]},{selector:"import",format:["camelCase","PascalCase"]},{selector:"variable",modifiers:["const"],format:["UPPER_CASE","snake_case","camelCase"],filter:{match:false,regex:"^_"}},{selector:"enumMember",format:["PascalCase"]}],"@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_"}]},o=i("eslint.config.ts",e)+s("PACK",`import { defineConfig } from 'eslint/config';
25
25
  import js from '@eslint/js';
26
26
  import tseslint from 'typescript-eslint';
27
27
  import stylistic from '@stylistic/eslint-plugin';
28
- `)+s("CONST",`const rules = ${_mcs_fmt.formatJSON.call(void 0, JSON.stringify(t)).formatted}`)+s("CONF",`export default defineConfig(
28
+ `)+s("CONST",`const rules = ${mcs_fmt.formatJSON(JSON.stringify(n)).formatted}`)+s("CONF",`export default defineConfig(
29
29
 
30
30
  js.configs.recommended, ...tseslint.configs.recommended, ...tseslint.configs.stylistic,
31
31
 
@@ -35,8 +35,8 @@ import stylistic from '@stylistic/eslint-plugin';
35
35
  rules : rules
36
36
  }
37
37
  );
38
- `),r=_mcs_fmt.formatTS.call(void 0, o,"eslint.config.ts");if(_optionalChain([r, 'access', _9 => _9.errors, 'optionalAccess', _10 => _10.length]))throw console.error("Error formatting eslint.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate eslint.config.ts due to formatting errors.");return r.formatted+`
39
- `}function y(n,e){let t=n==="pkg"?`describe('${e.name}', () => {
38
+ `),r=mcs_fmt.formatTS(o,"eslint.config.ts");if(r.errors?.length)throw console.error("Error formatting eslint.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate eslint.config.ts due to formatting errors.");return r.formatted+`
39
+ `}function y(t,e){let n=t==="pkg"?`describe('${e.name}', () => {
40
40
  it('should add two numbers correctly', () => {
41
41
  expect(add(1, 1)).toBe(2);
42
42
  });
@@ -47,13 +47,13 @@ import stylistic from '@stylistic/eslint-plugin';
47
47
  });
48
48
  });
49
49
  `,o=i("test/index.test.ts",e)+s("PACK",`import { describe, it, expect } from 'bun:test';
50
- `+(n==="pkg"?`import { add } from '../src';
51
- `:""))+s("TEST",t),r=_mcs_fmt.formatTS.call(void 0, o,"test/index.test.ts");if(_optionalChain([r, 'access', _11 => _11.errors, 'optionalAccess', _12 => _12.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 b(n,e){let t={entry:["src/index.ts"],format:["esm","cjs"],dts:!0,minify:!0,sourcemap:!1,clean:!0,splitting:!0};n==="cli"&&(t.banner={js:"#!/usr/bin/env bun"});let o=i("tsup.config.ts",e)+s("PACK",`import { defineConfig } from 'tsup';
53
- `)+s("CONST",`const rules = ${_mcs_fmt.formatJSON.call(void 0, JSON.stringify(t)).formatted}`)+s("CONF",`// eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ `+(t==="pkg"?`import { add } from '../src';
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 b(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
+ `)+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
- `),r=_mcs_fmt.formatTS.call(void 0, o,"tsup.config.ts");if(_optionalChain([r, 'access', _13 => _13.errors, 'optionalAccess', _14 => _14.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 h(){return`# Dependencies
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 h(){return `# Dependencies
57
57
  node_modules/
58
58
  package-lock.json
59
59
  yarn.lock
@@ -85,9 +85,9 @@ Thumbs.db
85
85
  # Test coverage
86
86
  coverage/
87
87
  .nyc_output/
88
- `}function v(n){let e=n.author.name||"",t=n.author.email||"",o=typeof n.author.github=="string"?n.author.github.trim():"",r=o?o.includes("github.com")?o:`https://github.com/${o.replace(/^@/,"")}`:"";return e?r?`${e} (${r})`:t?`${e} (${t})`:e:""}function A(n){let e=new Date().getFullYear(),t=v(n);return`Copyright (c) ${e}${t?" "+t:""}`}function x(n){return`MIT License
88
+ `}function v(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 A(t){let e=new Date().getFullYear(),n=v(t);return `Copyright (c) ${e}${n?" "+n:""}`}function x(t){return `MIT License
89
89
 
90
- ${A(n)}
90
+ ${A(t)}
91
91
 
92
92
  Permission is hereby granted, free of charge, to any person obtaining a copy
93
93
  of this software and associated documentation files (the "Software"), to deal
@@ -106,7 +106,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
106
106
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
107
107
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
108
108
  SOFTWARE.
109
- `}function E(){return`# Source and test files
109
+ `}function E(){return `# Source and test files
110
110
  src/
111
111
  test/
112
112
  *.test.ts
@@ -151,21 +151,21 @@ bun.lockb
151
151
  *.swp
152
152
  *.swo
153
153
  *~
154
- `}function T(n,e){let t=n==="cli"?L(e):$(e),o=_mcs_fmt.formatMD.call(void 0, t,"README.md");if(_optionalChain([o, 'access', _15 => _15.errors, 'optionalAccess', _16 => _16.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
- `}function L(n){return`# ${n.name}
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+`
155
+ `}function L(t){return `# ${t.name}
156
156
 
157
- ${n.description||"A TypeScript command-line tool."}
157
+ ${t.description||"A TypeScript command-line tool."}
158
158
 
159
159
  ## Installation
160
160
 
161
161
  \`\`\`bash
162
- pkg install -g ${n.name}
162
+ pkg install -g ${t.name}
163
163
  \`\`\`
164
164
 
165
165
  ## Usage
166
166
 
167
167
  \`\`\`bash
168
- ${n.name} --help
168
+ ${t.name} --help
169
169
  \`\`\`
170
170
 
171
171
  ## Development
@@ -179,21 +179,21 @@ pkg build # Build for production
179
179
 
180
180
  ## License
181
181
 
182
- ${n.license}`+(n.author.name?` \xA9 ${new Date().getFullYear()} ${n.author.name}`:"")+`
183
- `}function $(n){return`# ${n.name}
182
+ ${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
183
+ `}function $(t){return `# ${t.name}
184
184
 
185
- ${n.description||"A TypeScript library."}
185
+ ${t.description||"A TypeScript library."}
186
186
 
187
187
  ## Installation
188
188
 
189
189
  \`\`\`bash
190
- pkg install ${n.name}
190
+ pkg install ${t.name}
191
191
  \`\`\`
192
192
 
193
193
  ## Usage
194
194
 
195
195
  \`\`\`typescript
196
- import { example } from '${n.name}'
196
+ import { example } from '${t.name}'
197
197
 
198
198
  example()
199
199
  \`\`\`
@@ -209,5 +209,5 @@ pkg test # Run tests
209
209
 
210
210
  ## License
211
211
 
212
- ${n.license}`+(n.author.name?` \xA9 ${new Date().getFullYear()} ${n.author.name}`:"")+`
213
- `}var S=class extends Error{constructor(t,o,r){super(t);this.code=o;this.ctx=r;this.name="PkgError"}};function Fe(n,e,t){switch(n){case"package.json":return u(e,t);case"tsconfig.json":return p(e);case".vscode/settings.json":return m();case"tsup.config.ts":return b(e,t);case"eslint.config.mjs":return d(e,t);case"src/index.ts":return f(e,t);case"test/index.test.ts":return y(e,t);case"README.md":return T(e,t);case".gitignore":return h();case".npmignore":return E();case"LICENSE":return x(t);default:throw new Error(`Unknown file: ${n}`)}}exports.PkgError = S; exports.generateEslintConfig = d; exports.generateFile = Fe; exports.generateGitignore = h; exports.generateLicense = x; exports.generateNpmignore = E; exports.generatePackageJson = u; exports.generateReadme = T; exports.generateSourceIndexTs = f; exports.generateTestIndexTs = y; exports.generateTsconfig = p; exports.generateTsupConfig = b; exports.generateVscodeSettings = m;
212
+ ${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
213
+ `}var S=class extends Error{constructor(n,o,r){super(n);this.code=o;this.ctx=r;this.name="PkgError";}};function Fe(t,e,n){switch(t){case "package.json":return u(e,n);case "tsconfig.json":return p(e);case ".vscode/settings.json":return m();case "tsup.config.ts":return b(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 T(e,n);case ".gitignore":return h();case ".npmignore":return E();case "LICENSE":return x(n);default:throw new Error(`Unknown file: ${t}`)}}exports.PkgError=S;exports.generateEslintConfig=d;exports.generateFile=Fe;exports.generateGitignore=h;exports.generateLicense=x;exports.generateNpmignore=E;exports.generatePackageJson=u;exports.generateReadme=T;exports.generateSourceIndexTs=f;exports.generateTestIndexTs=y;exports.generateTsconfig=p;exports.generateTsupConfig=b;exports.generateVscodeSettings=m;
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
- import{formatJSON as O}from"@langpkg/mcs_fmt";function m(){let e=O(JSON.stringify({"files.exclude":{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,"eslint.config.mjs":!0,"bun.lock":!0,"package-lock.json":!0,LICENSE:!0,".gitignore":!0,".gitattributes":!0,".npmignore":!0,node_modules:!0,"tsup.config.ts":!0,"tsconfig.json":!0},"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
- `}import{formatJSON as N}from"@langpkg/mcs_fmt";function u(n,e){let t=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:t?{type:"git",url:`git+${t}.git`}:"",type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},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(n==="cli"){let a=e.name.replace(/^@[^/]+\//,""),g={};for(let[l,j]of Object.entries(r))g[l]=j,l==="type"&&(g.bin={[a]:"./dist/index.js"},g.pkg={type:"cli"});Object.keys(r).forEach(l=>delete r[l]),Object.assign(r,g)}else r.pkg={type:"lib"};let c=N(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
- `}import{formatJSON as k}from"@langpkg/mcs_fmt";function p(n){let t=k(JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["node"],declaration:n==="pkg",outDir:"./dist",strict:!0,esModuleInterop:!0,skipLibCheck:!0,forceConsistentCasingInFileNames:!0,resolveJsonModule:!0,isolatedModules:!0,allowImportingTsExtensions:!0,noEmit:!0,ignoreDeprecations:"6.0"},include:["src","test"],exclude:["node_modules","dist"]}),"tsconfig.json");if(t.errors?.length)throw console.error("Error formatting tsconfig.json:",JSON.stringify(t.errors,null,2)),new Error("Failed to generate tsconfig.json due to formatting errors.");return t.formatted+`
4
- `}import{formatTS as P}from"@langpkg/mcs_fmt";function s(n,e,t=!0){let o=t?`
1
+ import {formatJSON,formatTS,formatMD}from'@langpkg/mcs_fmt';function m(){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 u(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"}},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(/^@[^/]+\//,""),g={};for(let[l,j]of Object.entries(r))g[l]=j,l==="type"&&(g.bin={[a]:"./dist/index.js"},g.pkg={type:"cli"});Object.keys(r).forEach(l=>delete r[l]),Object.assign(r,g);}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
+ `}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
+ `}function s(t,e,n=true){let o=n?`
5
5
 
6
6
 
7
- `:"",r="// \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 "+n+` \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
7
+ `:"",r="// \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 "+t+` \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
8
8
 
9
9
  `,c=`// \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
10
10
  `;return e=e.split(`
11
11
  `).map(a=>a===""?a:" "+a).join(`
12
12
  `),o+r+e+`
13
- `+c}function i(n,e){let t=e.author.name?`// Made with \u2764\uFE0F by ${e.author.name}.`:"// Made with \u2764\uFE0F by Maysara.";return`// ${n}
13
+ `+c}function i(t,e){let n=e.author.name?`// Made with \u2764\uFE0F by ${e.author.name}.`:"// Made with \u2764\uFE0F by Maysara.";return `// ${t}
14
14
  //
15
- ${t}
16
- `}function f(n,e){let t=i("src/index.ts",e)+s("PACK",n==="cli"?`import { cli } from '@langpkg/cli';
17
- `:"");if(n==="pkg")t+=s("MAIN",`export const add = (a: number, b: number): number => a + b;
18
- `);else{let r=`export const run = (): void => {
15
+ ${n}
16
+ `}function f(t,e){let n=i("src/index.ts",e)+s("PACK",t==="cli"?`import { cli } from '@langpkg/cli';
17
+ `:"");if(t==="pkg")n+=s("MAIN",`export const add = (a: number, b: number): number => a + b;
18
+ `);else {let r=`export const run = (): void => {
19
19
  console.log('${e.name} running...');
20
20
  };
21
21
 
22
22
  run();
23
- `;t+=s("MAIN",r)}let o=P(t,"src/index.ts");if(o.errors?.length)throw console.error("Error formatting src/index.ts:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate src/index.ts due to formatting errors.");return o.formatted+`
24
- `}import{formatTS as I,formatJSON as w}from"@langpkg/mcs_fmt";function d(n,e){let t={curly:"off","@stylistic/semi":["warn","always"],"@typescript-eslint/no-empty-function":"off","@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["snake_case","camelCase"],filter:{match:!1,regex:"^_"}},{selector:"function",format:["camelCase"]},{selector:"method",format:["camelCase"]},{selector:"typeLike",format:["PascalCase"]},{selector:"import",format:["camelCase","PascalCase"]},{selector:"variable",modifiers:["const"],format:["UPPER_CASE","snake_case","camelCase"],filter:{match:!1,regex:"^_"}},{selector:"enumMember",format:["PascalCase"]}],"@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_"}]},o=i("eslint.config.ts",e)+s("PACK",`import { defineConfig } from 'eslint/config';
23
+ `;n+=s("MAIN",r);}let o=formatTS(n,"src/index.ts");if(o.errors?.length)throw console.error("Error formatting src/index.ts:",JSON.stringify(o.errors,null,2)),new Error("Failed to generate src/index.ts due to formatting errors.");return o.formatted+`
24
+ `}function d(t,e){let n={curly:"off","@stylistic/semi":["warn","always"],"@typescript-eslint/no-empty-function":"off","@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["snake_case","camelCase"],filter:{match:false,regex:"^_"}},{selector:"function",format:["camelCase"]},{selector:"method",format:["camelCase"]},{selector:"typeLike",format:["PascalCase"]},{selector:"import",format:["camelCase","PascalCase"]},{selector:"variable",modifiers:["const"],format:["UPPER_CASE","snake_case","camelCase"],filter:{match:false,regex:"^_"}},{selector:"enumMember",format:["PascalCase"]}],"@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_"}]},o=i("eslint.config.ts",e)+s("PACK",`import { defineConfig } from 'eslint/config';
25
25
  import js from '@eslint/js';
26
26
  import tseslint from 'typescript-eslint';
27
27
  import stylistic from '@stylistic/eslint-plugin';
28
- `)+s("CONST",`const rules = ${w(JSON.stringify(t)).formatted}`)+s("CONF",`export default defineConfig(
28
+ `)+s("CONST",`const rules = ${formatJSON(JSON.stringify(n)).formatted}`)+s("CONF",`export default defineConfig(
29
29
 
30
30
  js.configs.recommended, ...tseslint.configs.recommended, ...tseslint.configs.stylistic,
31
31
 
@@ -35,8 +35,8 @@ import stylistic from '@stylistic/eslint-plugin';
35
35
  rules : rules
36
36
  }
37
37
  );
38
- `),r=I(o,"eslint.config.ts");if(r.errors?.length)throw console.error("Error formatting eslint.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate eslint.config.ts due to formatting errors.");return r.formatted+`
39
- `}import{formatTS as C}from"@langpkg/mcs_fmt";function y(n,e){let t=n==="pkg"?`describe('${e.name}', () => {
38
+ `),r=formatTS(o,"eslint.config.ts");if(r.errors?.length)throw console.error("Error formatting eslint.config.ts:",JSON.stringify(r.errors,null,2)),new Error("Failed to generate eslint.config.ts due to formatting errors.");return r.formatted+`
39
+ `}function y(t,e){let n=t==="pkg"?`describe('${e.name}', () => {
40
40
  it('should add two numbers correctly', () => {
41
41
  expect(add(1, 1)).toBe(2);
42
42
  });
@@ -47,13 +47,13 @@ import stylistic from '@stylistic/eslint-plugin';
47
47
  });
48
48
  });
49
49
  `,o=i("test/index.test.ts",e)+s("PACK",`import { describe, it, expect } from 'bun:test';
50
- `+(n==="pkg"?`import { add } from '../src';
51
- `:""))+s("TEST",t),r=C(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
- `}import{formatJSON as R,formatTS as M}from"@langpkg/mcs_fmt";function b(n,e){let t={entry:["src/index.ts"],format:["esm","cjs"],dts:!0,minify:!0,sourcemap:!1,clean:!0,splitting:!0};n==="cli"&&(t.banner={js:"#!/usr/bin/env bun"});let o=i("tsup.config.ts",e)+s("PACK",`import { defineConfig } from 'tsup';
53
- `)+s("CONST",`const rules = ${R(JSON.stringify(t)).formatted}`)+s("CONF",`// eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ `+(t==="pkg"?`import { add } from '../src';
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 b(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
+ `)+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
- `),r=M(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 h(){return`# Dependencies
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 h(){return `# Dependencies
57
57
  node_modules/
58
58
  package-lock.json
59
59
  yarn.lock
@@ -85,9 +85,9 @@ Thumbs.db
85
85
  # Test coverage
86
86
  coverage/
87
87
  .nyc_output/
88
- `}function v(n){let e=n.author.name||"",t=n.author.email||"",o=typeof n.author.github=="string"?n.author.github.trim():"",r=o?o.includes("github.com")?o:`https://github.com/${o.replace(/^@/,"")}`:"";return e?r?`${e} (${r})`:t?`${e} (${t})`:e:""}function A(n){let e=new Date().getFullYear(),t=v(n);return`Copyright (c) ${e}${t?" "+t:""}`}function x(n){return`MIT License
88
+ `}function v(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 A(t){let e=new Date().getFullYear(),n=v(t);return `Copyright (c) ${e}${n?" "+n:""}`}function x(t){return `MIT License
89
89
 
90
- ${A(n)}
90
+ ${A(t)}
91
91
 
92
92
  Permission is hereby granted, free of charge, to any person obtaining a copy
93
93
  of this software and associated documentation files (the "Software"), to deal
@@ -106,7 +106,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
106
106
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
107
107
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
108
108
  SOFTWARE.
109
- `}function E(){return`# Source and test files
109
+ `}function E(){return `# Source and test files
110
110
  src/
111
111
  test/
112
112
  *.test.ts
@@ -151,21 +151,21 @@ bun.lockb
151
151
  *.swp
152
152
  *.swo
153
153
  *~
154
- `}import{formatMD as F}from"@langpkg/mcs_fmt";function T(n,e){let t=n==="cli"?L(e):$(e),o=F(t,"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
- `}function L(n){return`# ${n.name}
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+`
155
+ `}function L(t){return `# ${t.name}
156
156
 
157
- ${n.description||"A TypeScript command-line tool."}
157
+ ${t.description||"A TypeScript command-line tool."}
158
158
 
159
159
  ## Installation
160
160
 
161
161
  \`\`\`bash
162
- pkg install -g ${n.name}
162
+ pkg install -g ${t.name}
163
163
  \`\`\`
164
164
 
165
165
  ## Usage
166
166
 
167
167
  \`\`\`bash
168
- ${n.name} --help
168
+ ${t.name} --help
169
169
  \`\`\`
170
170
 
171
171
  ## Development
@@ -179,21 +179,21 @@ pkg build # Build for production
179
179
 
180
180
  ## License
181
181
 
182
- ${n.license}`+(n.author.name?` \xA9 ${new Date().getFullYear()} ${n.author.name}`:"")+`
183
- `}function $(n){return`# ${n.name}
182
+ ${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
183
+ `}function $(t){return `# ${t.name}
184
184
 
185
- ${n.description||"A TypeScript library."}
185
+ ${t.description||"A TypeScript library."}
186
186
 
187
187
  ## Installation
188
188
 
189
189
  \`\`\`bash
190
- pkg install ${n.name}
190
+ pkg install ${t.name}
191
191
  \`\`\`
192
192
 
193
193
  ## Usage
194
194
 
195
195
  \`\`\`typescript
196
- import { example } from '${n.name}'
196
+ import { example } from '${t.name}'
197
197
 
198
198
  example()
199
199
  \`\`\`
@@ -209,5 +209,5 @@ pkg test # Run tests
209
209
 
210
210
  ## License
211
211
 
212
- ${n.license}`+(n.author.name?` \xA9 ${new Date().getFullYear()} ${n.author.name}`:"")+`
213
- `}var S=class extends Error{constructor(t,o,r){super(t);this.code=o;this.ctx=r;this.name="PkgError"}};function Fe(n,e,t){switch(n){case"package.json":return u(e,t);case"tsconfig.json":return p(e);case".vscode/settings.json":return m();case"tsup.config.ts":return b(e,t);case"eslint.config.mjs":return d(e,t);case"src/index.ts":return f(e,t);case"test/index.test.ts":return y(e,t);case"README.md":return T(e,t);case".gitignore":return h();case".npmignore":return E();case"LICENSE":return x(t);default:throw new Error(`Unknown file: ${n}`)}}export{S as PkgError,d as generateEslintConfig,Fe as generateFile,h as generateGitignore,x as generateLicense,E as generateNpmignore,u as generatePackageJson,T as generateReadme,f as generateSourceIndexTs,y as generateTestIndexTs,p as generateTsconfig,b as generateTsupConfig,m as generateVscodeSettings};
212
+ ${t.license}`+(t.author.name?` \xA9 ${new Date().getFullYear()} ${t.author.name}`:"")+`
213
+ `}var S=class extends Error{constructor(n,o,r){super(n);this.code=o;this.ctx=r;this.name="PkgError";}};function Fe(t,e,n){switch(t){case "package.json":return u(e,n);case "tsconfig.json":return p(e);case ".vscode/settings.json":return m();case "tsup.config.ts":return b(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 T(e,n);case ".gitignore":return h();case ".npmignore":return E();case "LICENSE":return x(n);default:throw new Error(`Unknown file: ${t}`)}}export{S as PkgError,d as generateEslintConfig,Fe as generateFile,h as generateGitignore,x as generateLicense,E as generateNpmignore,u as generatePackageJson,T as generateReadme,f as generateSourceIndexTs,y as generateTestIndexTs,p as generateTsconfig,b as generateTsupConfig,m as generateVscodeSettings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langpkg/mcs_gen",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "maysara code style generator",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
+ "files": ["dist"],
15
16
  "exports": {
16
17
  ".": {
17
18
  "import": "./dist/index.js",
@@ -20,23 +21,23 @@
20
21
  },
21
22
  "module": "./dist/index.js",
22
23
  "pkg": {
23
- "type": "lib"
24
+ "type": "pkg"
24
25
  },
25
26
  "scripts": {},
26
27
  "dependencies": {
27
- "@langpkg/mcs_fmt": "^0.0.3",
28
+ "@langpkg/mcs_fmt": "^0.0.5",
28
29
  "glob": "^13.0.6"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@eslint/js": "^10.0.1",
32
33
  "@stylistic/eslint-plugin": "^5.10.0",
33
34
  "@types/bun": "^1.3.14",
34
- "@types/node": "^25.8.0",
35
+ "@types/node": "^25.9.1",
35
36
  "bun-plugin-dts": "^0.4.0",
36
37
  "bun-types": "^1.3.14",
37
38
  "ts-node": "^10.9.2",
38
39
  "tsup": "^8.5.1",
39
40
  "typescript": "^6.0.3",
40
- "typescript-eslint": "^8.59.3"
41
+ "typescript-eslint": "^8.59.4"
41
42
  }
42
43
  }