@langpkg/mcs_gen 0.1.5 → 0.1.6
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 +3 -3
- package/dist/index.js +3 -3
- package/package.json +1 -1
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.1.
|
|
14
|
+
<img data="version" src="https://img.shields.io/badge/v-0.1.6-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,6 +1,6 @@
|
|
|
1
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
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
|
-
`}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+`
|
|
3
|
+
`}function p(t){let n=mcs_fmt.formatJSON(JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["bun","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
|
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ run();
|
|
|
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(JSON.stringify(n)).formatted}
|
|
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
|
|
|
@@ -50,7 +50,7 @@ import stylistic from '@stylistic/eslint-plugin';
|
|
|
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
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
|
-
`)+s("CONST",`const rules = ${mcs_fmt.formatJSON(JSON.stringify(n)).formatted}
|
|
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
56
|
`}function b(){return `# Dependencies
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
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
|
-
`}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+`
|
|
3
|
+
`}function p(t){let n=formatJSON(JSON.stringify({compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"bundler",lib:["DOM","ES2020","ESNext"],types:["bun","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
|
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ run();
|
|
|
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 = ${formatJSON(JSON.stringify(n)).formatted}
|
|
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
|
|
|
@@ -50,7 +50,7 @@ import stylistic from '@stylistic/eslint-plugin';
|
|
|
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
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
|
-
`)+s("CONST",`const rules = ${formatJSON(JSON.stringify(n)).formatted}
|
|
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
56
|
`}function b(){return `# Dependencies
|