@acryldev/blends 1.7.11 → 1.7.13

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.
@@ -0,0 +1,24 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { join, resolve } from 'node:path'
3
+
4
+ /**
5
+ * The `--from` a packer hands to create: an existing folder as an absolute path, anything else (a registry id such as acrylblends.small-crm) as given.
6
+ * create takes a folder source only when it is written as one (./x, ../x, /x, C:\x), so a template name is never read as a folder; a release workflow
7
+ * passes apps/<product> bare, which create would refuse as an unknown source (product-release run 44482560217 failed that way on all six runners).
8
+ */
9
+ export function createSource(from, cwd = process.cwd()) {
10
+ const folder = resolve(cwd, from)
11
+ return existsSync(folder) ? folder : from
12
+ }
13
+
14
+ /**
15
+ * What a Blend's repository carries for itself, not for the app made from it: `.github/` (its release workflow). create copies a folder source whole,
16
+ * so the packer takes these out of the product's app and its first commit; left in, a fresh install showed the bundle's missing workflow as an unsaved
17
+ * deletion ("v2 · 1 unsaved").
18
+ */
19
+ export const REPOSITORY_ONLY = ['.github']
20
+
21
+ /** The repository-only paths present in an app folder. */
22
+ export function repositoryOnlyIn(app) {
23
+ return REPOSITORY_ONLY.filter((path) => existsSync(join(app, path)))
24
+ }