ebely 0.0.4 → 0.0.5
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/bin/ebely.mjs +6 -2
- package/package.json +1 -1
package/bin/ebely.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { cp, mkdir, readdir, readFile, writeFile } from 'node:fs/promises'
|
|
3
3
|
import { existsSync } from 'node:fs'
|
|
4
|
-
import { basename, dirname, join, resolve, sep } from 'node:path'
|
|
4
|
+
import { basename, dirname, join, relative, resolve, sep } from 'node:path'
|
|
5
5
|
import { fileURLToPath } from 'node:url'
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
@@ -97,9 +97,13 @@ async function createProject({ dir }) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// Копируем шаблон целиком, кроме node_modules.
|
|
100
|
+
// Важно: фильтруем по пути ОТНОСИТЕЛЬНО шаблона, а не по абсолютному —
|
|
101
|
+
// иначе при установке через npx/npm весь путь пакета лежит внутри
|
|
102
|
+
// node_modules, фильтр отбрасывает корень шаблона и не копируется ничего.
|
|
100
103
|
await cp(templateSrc, target, {
|
|
101
104
|
recursive: true,
|
|
102
|
-
filter: (src) =>
|
|
105
|
+
filter: (src) =>
|
|
106
|
+
!relative(templateSrc, src).split(sep).includes('node_modules'),
|
|
103
107
|
})
|
|
104
108
|
|
|
105
109
|
// package.json: имя по папке + реальная версия ebely вместо workspace:*.
|