@fluffjs/cli 0.1.1 → 0.1.3
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/Cli.js +11 -4
- package/Generator.js +2 -0
- package/interfaces/FluffTarget.d.ts +2 -0
- package/package.json +1 -1
- package/types/FluffConfig.js +1 -0
package/Cli.js
CHANGED
|
@@ -286,7 +286,7 @@ Examples:
|
|
|
286
286
|
async buildTarget(target, projectRoot, workspaceRoot, projectRelativePath) {
|
|
287
287
|
console.log(`🔨 Building target '${target.name}'...`);
|
|
288
288
|
const srcDir = path.resolve(projectRoot, target.srcDir);
|
|
289
|
-
const appDir = path.join(srcDir, 'app');
|
|
289
|
+
const appDir = path.join(srcDir, target.componentsDir ?? 'app');
|
|
290
290
|
const outDir = (workspaceRoot && projectRelativePath)
|
|
291
291
|
? path.join(workspaceRoot, 'dist', projectRelativePath)
|
|
292
292
|
: path.resolve(projectRoot, target.outDir);
|
|
@@ -328,6 +328,9 @@ Examples:
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
console.log(' Building with esbuild...');
|
|
331
|
+
const tsconfigRaw = target.tsConfigPath
|
|
332
|
+
? fs.readFileSync(path.resolve(projectRoot, target.tsConfigPath), 'utf-8')
|
|
333
|
+
: '{}';
|
|
331
334
|
const result = await esbuild.build({
|
|
332
335
|
entryPoints: [entryPoint],
|
|
333
336
|
bundle: true,
|
|
@@ -350,7 +353,7 @@ Examples:
|
|
|
350
353
|
],
|
|
351
354
|
external: bundleOptions.external ?? [],
|
|
352
355
|
logLevel: 'warning',
|
|
353
|
-
tsconfigRaw
|
|
356
|
+
tsconfigRaw
|
|
354
357
|
});
|
|
355
358
|
const outputs = Object.keys(result.metafile?.outputs ?? {});
|
|
356
359
|
const jsBundle = outputs.find(f => f.endsWith('.js'));
|
|
@@ -477,7 +480,7 @@ Examples:
|
|
|
477
480
|
}
|
|
478
481
|
async serveTarget(target, projectRoot, workspaceRoot, projectRelativePath) {
|
|
479
482
|
const srcDir = path.resolve(projectRoot, target.srcDir);
|
|
480
|
-
const appDir = path.join(srcDir, 'app');
|
|
483
|
+
const appDir = path.join(srcDir, target.componentsDir ?? 'app');
|
|
481
484
|
const fluffDir = path.join(this.cwd, '.fluff');
|
|
482
485
|
const serveId = randomUUID();
|
|
483
486
|
const outDir = path.join(fluffDir, serveId);
|
|
@@ -560,6 +563,9 @@ Examples:
|
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
565
|
console.log(`🚀 Starting dev server for '${target.name}'...`);
|
|
566
|
+
const tsconfigRaw = target.tsConfigPath
|
|
567
|
+
? fs.readFileSync(path.resolve(projectRoot, target.tsConfigPath), 'utf-8')
|
|
568
|
+
: '{}';
|
|
563
569
|
const ctx = await esbuild.context({
|
|
564
570
|
entryPoints: [entryPoint],
|
|
565
571
|
bundle: true,
|
|
@@ -580,7 +586,8 @@ Examples:
|
|
|
580
586
|
production: false
|
|
581
587
|
})
|
|
582
588
|
],
|
|
583
|
-
logLevel: 'info'
|
|
589
|
+
logLevel: 'info',
|
|
590
|
+
tsconfigRaw
|
|
584
591
|
});
|
|
585
592
|
await ctx.watch();
|
|
586
593
|
console.log(' Watching for changes...');
|
package/Generator.js
CHANGED
package/package.json
CHANGED