@rig-c/create 1.2.1 → 1.2.2
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/package.json +1 -1
- package/src/parts-sections.ts +7 -4
package/package.json
CHANGED
package/src/parts-sections.ts
CHANGED
|
@@ -46,8 +46,13 @@ export class PartsUnreadable extends Error {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const load = createRequire(import.meta.url);
|
|
50
|
+
|
|
51
|
+
/** Create's runtime-resolved dependency install, used when a project has none (running the check in this repo, or before `bun install` in a project). */
|
|
52
|
+
const checkoutNodeModules = join(import.meta.dir, '..', 'node_modules');
|
|
53
|
+
export const OWN_NODE_MODULES = existsSync(join(checkoutNodeModules, PARTS_PACKAGE, 'package.json'))
|
|
54
|
+
? checkoutNodeModules
|
|
55
|
+
: dirname(dirname(dirname(load.resolve(`${PARTS_PACKAGE}/package.json`))));
|
|
51
56
|
|
|
52
57
|
/**
|
|
53
58
|
* Where the installed package is looked for, in order: the project's own
|
|
@@ -67,8 +72,6 @@ export function locateParts(projectDir: string): string | null {
|
|
|
67
72
|
return null;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
const load = createRequire(import.meta.url);
|
|
71
|
-
|
|
72
75
|
function isSections(v: unknown): v is Sections {
|
|
73
76
|
return Array.isArray(v) && v.length > 0 && v.every((s) => typeof s === 'string');
|
|
74
77
|
}
|