@screenly/edge-apps 0.0.3 → 0.0.4
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/scripts/cli.ts +14 -14
package/package.json
CHANGED
package/scripts/cli.ts
CHANGED
|
@@ -45,6 +45,16 @@ const commands = {
|
|
|
45
45
|
},
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Helper: Resolve a binary from the app's node_modules first, falling back to the library's
|
|
50
|
+
*/
|
|
51
|
+
function resolveBin(name: string): string {
|
|
52
|
+
const appBin = path.resolve(process.cwd(), 'node_modules', '.bin', name)
|
|
53
|
+
return fs.existsSync(appBin)
|
|
54
|
+
? appBin
|
|
55
|
+
: path.resolve(libraryRoot, 'node_modules', '.bin', name)
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
/**
|
|
49
59
|
* Helper: Get NODE_PATH with library's node_modules included
|
|
50
60
|
*/
|
|
@@ -99,19 +109,14 @@ function spawnWithSignalHandling(
|
|
|
99
109
|
*/
|
|
100
110
|
function getVitePaths(): { viteBin: string; configPath: string } {
|
|
101
111
|
return {
|
|
102
|
-
viteBin:
|
|
112
|
+
viteBin: resolveBin('vite'),
|
|
103
113
|
configPath: path.resolve(libraryRoot, 'vite.config.ts'),
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
116
|
|
|
107
117
|
async function lintCommand(args: string[]) {
|
|
108
118
|
try {
|
|
109
|
-
const eslintBin =
|
|
110
|
-
libraryRoot,
|
|
111
|
-
'node_modules',
|
|
112
|
-
'.bin',
|
|
113
|
-
'eslint',
|
|
114
|
-
)
|
|
119
|
+
const eslintBin = resolveBin('eslint')
|
|
115
120
|
|
|
116
121
|
const eslintArgs = [
|
|
117
122
|
'--config',
|
|
@@ -181,7 +186,7 @@ async function buildDevCommand(args: string[]) {
|
|
|
181
186
|
|
|
182
187
|
async function typeCheckCommand(args: string[]) {
|
|
183
188
|
try {
|
|
184
|
-
const tscBin =
|
|
189
|
+
const tscBin = resolveBin('tsc')
|
|
185
190
|
|
|
186
191
|
const tscArgs = [
|
|
187
192
|
'--noEmit',
|
|
@@ -215,12 +220,7 @@ async function convertPngsToWebP(screenshotsDir: string): Promise<void> {
|
|
|
215
220
|
|
|
216
221
|
async function screenshotsCommand(_args: string[]) {
|
|
217
222
|
try {
|
|
218
|
-
const playwrightBin =
|
|
219
|
-
process.cwd(),
|
|
220
|
-
'node_modules',
|
|
221
|
-
'.bin',
|
|
222
|
-
'playwright',
|
|
223
|
-
)
|
|
223
|
+
const playwrightBin = resolveBin('playwright')
|
|
224
224
|
const playwrightConfig = path.resolve(
|
|
225
225
|
libraryRoot,
|
|
226
226
|
'configs',
|