@murumets-ee/create 0.1.18 → 0.2.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/dist/cli.mjs +754 -3253
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +756 -3255
- package/dist/index.mjs.map +1 -1
- package/dist/utils-DHetVfSn.mjs +2 -0
- package/dist/{utils-Bmw75lEa.mjs.map → utils-DHetVfSn.mjs.map} +1 -1
- package/package.json +11 -4
- package/templates/template-blank.tar.gz +0 -0
- package/templates/template-demo.tar.gz +0 -0
- package/dist/utils-Bmw75lEa.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{appendFile as e,mkdir as t,readFile as n,rm as r,writeFile as i}from"node:fs/promises";import{dirname as a,join as o}from"node:path";import{execSync as s}from"node:child_process";var c=Object.defineProperty,l=((e,t)=>{let n={};for(var r in e)c(n,r,{get:e[r],enumerable:!0});return t||c(n,Symbol.toStringTag,{value:`Module`}),n})({appendToFile:()=>m,deleteFiles:()=>f,mergePackageJson:()=>d,runCommand:()=>p,writeFile:()=>u});async function u(e,n){await t(a(e),{recursive:!0}),await i(e,n,`utf-8`)}async function d(e,t){let r=await n(e,`utf-8`),a=JSON.parse(r);t.type&&(a.type=t.type),t.dependencies&&(a.dependencies={...a.dependencies,...t.dependencies}),t.devDependencies&&(a.devDependencies={...a.devDependencies,...t.devDependencies}),t.scripts&&(a.scripts={...a.scripts,...t.scripts}),await i(e,`${JSON.stringify(a,null,2)}\n`,`utf-8`)}async function f(e,t){for(let n of t)await r(o(e,n),{force:!0,recursive:!0})}function p(e,t){return s(e,{cwd:t?.cwd,stdio:`pipe`,encoding:`utf-8`})}async function m(t,n){await e(t,n,`utf-8`)}export{u as a,l as i,d as n,p as r,f as t};
|
|
2
|
+
//# sourceMappingURL=utils-DHetVfSn.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-DHetVfSn.mjs","names":["writeFile","fsWriteFile"],"sources":["../src/utils.ts"],"sourcesContent":["import { execSync } from 'node:child_process'\nimport { appendFile, writeFile as fsWriteFile, mkdir, readFile, rm } from 'node:fs/promises'\nimport { dirname, join } from 'node:path'\n\n/** Write a file, creating parent directories as needed */\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await mkdir(dirname(filePath), { recursive: true })\n await fsWriteFile(filePath, content, 'utf-8')\n}\n\n/** Read and parse package.json, merge in new deps/scripts, write back */\nexport async function mergePackageJson(\n pkgPath: string,\n merge: {\n type?: string\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n scripts?: Record<string, string>\n },\n): Promise<void> {\n const raw = await readFile(pkgPath, 'utf-8')\n const pkg = JSON.parse(raw)\n\n if (merge.type) {\n pkg.type = merge.type\n }\n if (merge.dependencies) {\n pkg.dependencies = { ...pkg.dependencies, ...merge.dependencies }\n }\n if (merge.devDependencies) {\n pkg.devDependencies = { ...pkg.devDependencies, ...merge.devDependencies }\n }\n if (merge.scripts) {\n pkg.scripts = { ...pkg.scripts, ...merge.scripts }\n }\n\n await fsWriteFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`, 'utf-8')\n}\n\n/** Delete files (silently ignores missing) */\nexport async function deleteFiles(basePath: string, files: string[]): Promise<void> {\n for (const file of files) {\n await rm(join(basePath, file), { force: true, recursive: true })\n }\n}\n\n/** Run a shell command synchronously */\nexport function runCommand(cmd: string, options?: { cwd?: string }): string {\n return execSync(cmd, {\n cwd: options?.cwd,\n stdio: 'pipe',\n encoding: 'utf-8',\n })\n}\n\n/** Append content to a file */\nexport async function appendToFile(filePath: string, content: string): Promise<void> {\n await appendFile(filePath, content, 'utf-8')\n}\n"],"mappings":"gbAKA,eAAsBA,EAAU,EAAkB,EAAgC,CAChF,MAAM,EAAM,EAAQ,EAAS,CAAE,CAAE,UAAW,GAAM,CAAC,CACnD,MAAMC,EAAY,EAAU,EAAS,QAAQ,CAI/C,eAAsB,EACpB,EACA,EAMe,CACf,IAAM,EAAM,MAAM,EAAS,EAAS,QAAQ,CACtC,EAAM,KAAK,MAAM,EAAI,CAEvB,EAAM,OACR,EAAI,KAAO,EAAM,MAEf,EAAM,eACR,EAAI,aAAe,CAAE,GAAG,EAAI,aAAc,GAAG,EAAM,aAAc,EAE/D,EAAM,kBACR,EAAI,gBAAkB,CAAE,GAAG,EAAI,gBAAiB,GAAG,EAAM,gBAAiB,EAExE,EAAM,UACR,EAAI,QAAU,CAAE,GAAG,EAAI,QAAS,GAAG,EAAM,QAAS,EAGpD,MAAMA,EAAY,EAAS,GAAG,KAAK,UAAU,EAAK,KAAM,EAAE,CAAC,IAAK,QAAQ,CAI1E,eAAsB,EAAY,EAAkB,EAAgC,CAClF,IAAK,IAAM,KAAQ,EACjB,MAAM,EAAG,EAAK,EAAU,EAAK,CAAE,CAAE,MAAO,GAAM,UAAW,GAAM,CAAC,CAKpE,SAAgB,EAAW,EAAa,EAAoC,CAC1E,OAAO,EAAS,EAAK,CACnB,IAAK,GAAS,IACd,MAAO,OACP,SAAU,QACX,CAAC,CAIJ,eAAsB,EAAa,EAAkB,EAAgC,CACnF,MAAM,EAAW,EAAU,EAAS,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murumets-ee/create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,18 +13,25 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"templates/*.tar.gz"
|
|
17
18
|
],
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@clack/prompts": "^0.10.0",
|
|
20
|
-
"picocolors": "^1.1.0"
|
|
21
|
+
"picocolors": "^1.1.0",
|
|
22
|
+
"tar": "^7.4.3"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
25
|
+
"@types/node": "^20",
|
|
26
|
+
"@types/tar": "^6.1.13",
|
|
23
27
|
"tsdown": "^0.21.7",
|
|
28
|
+
"tsx": "^4.19.2",
|
|
24
29
|
"typescript": "^5.7.3"
|
|
25
30
|
},
|
|
26
31
|
"scripts": {
|
|
27
|
-
"build": "tsdown",
|
|
32
|
+
"build": "tsdown && tsx scripts/build-templates.ts",
|
|
33
|
+
"build:code": "tsdown",
|
|
34
|
+
"build:templates": "tsx scripts/build-templates.ts",
|
|
28
35
|
"dev": "tsdown --watch",
|
|
29
36
|
"test": "vitest"
|
|
30
37
|
}
|
|
Binary file
|
|
Binary file
|
package/dist/utils-Bmw75lEa.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dirname as e,join as t}from"node:path";import{execSync as n}from"node:child_process";import{appendFile as r,mkdir as i,readFile as a,rm as o,writeFile as s}from"node:fs/promises";var c=Object.defineProperty,l=((e,t)=>{let n={};for(var r in e)c(n,r,{get:e[r],enumerable:!0});return t||c(n,Symbol.toStringTag,{value:`Module`}),n})({appendToFile:()=>m,deleteFiles:()=>f,mergePackageJson:()=>d,runCommand:()=>p,writeFile:()=>u});async function u(t,n){await i(e(t),{recursive:!0}),await s(t,n,`utf-8`)}async function d(e,t){let n=await a(e,`utf-8`),r=JSON.parse(n);t.type&&(r.type=t.type),t.dependencies&&(r.dependencies={...r.dependencies,...t.dependencies}),t.devDependencies&&(r.devDependencies={...r.devDependencies,...t.devDependencies}),t.scripts&&(r.scripts={...r.scripts,...t.scripts}),await s(e,`${JSON.stringify(r,null,2)}\n`,`utf-8`)}async function f(e,n){for(let r of n)await o(t(e,r),{force:!0,recursive:!0})}function p(e,t){return n(e,{cwd:t?.cwd,stdio:`pipe`,encoding:`utf-8`})}async function m(e,t){await r(e,t,`utf-8`)}export{l as a,p as i,f as n,u as o,d as r,m as t};
|
|
2
|
-
//# sourceMappingURL=utils-Bmw75lEa.mjs.map
|