@nextsparkjs/cli 0.1.0-beta.63 → 0.1.0-beta.65
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/dist/cli.js +31 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2341,6 +2341,8 @@ async function copyProjectFiles() {
|
|
|
2341
2341
|
const itemsToCopy = [
|
|
2342
2342
|
{ src: "app", dest: "app", force: true },
|
|
2343
2343
|
{ src: "public", dest: "public", force: true },
|
|
2344
|
+
{ src: "middleware.ts", dest: "middleware.ts", force: true },
|
|
2345
|
+
// Required for EntityPermissionLayout
|
|
2344
2346
|
{ src: "next.config.mjs", dest: "next.config.mjs", force: true },
|
|
2345
2347
|
{ src: "tsconfig.json", dest: "tsconfig.json", force: true },
|
|
2346
2348
|
{ src: "postcss.config.mjs", dest: "postcss.config.mjs", force: true },
|
|
@@ -3867,6 +3869,10 @@ import { join as join10, dirname as dirname3, relative } from "path";
|
|
|
3867
3869
|
import chalk16 from "chalk";
|
|
3868
3870
|
import ora10 from "ora";
|
|
3869
3871
|
var EXCLUDED_TEMPLATE_PATTERNS = ["(templates)"];
|
|
3872
|
+
var ROOT_TEMPLATE_FILES = [
|
|
3873
|
+
"middleware.ts"
|
|
3874
|
+
// Required for EntityPermissionLayout permission validation
|
|
3875
|
+
];
|
|
3870
3876
|
var MAX_VERBOSE_FILES = 10;
|
|
3871
3877
|
var MAX_SUMMARY_FILES = 5;
|
|
3872
3878
|
function getAllFiles(dir, baseDir = dir) {
|
|
@@ -4011,6 +4017,31 @@ async function syncAppCommand(options) {
|
|
|
4011
4017
|
}
|
|
4012
4018
|
}
|
|
4013
4019
|
spinner.succeed(`Synced ${filesToUpdate.length} files (${updated} updated, ${created} created)`);
|
|
4020
|
+
const rootTemplatesDir = join10(coreDir, "templates");
|
|
4021
|
+
let rootUpdated = 0;
|
|
4022
|
+
let rootCreated = 0;
|
|
4023
|
+
for (const file of ROOT_TEMPLATE_FILES) {
|
|
4024
|
+
const sourcePath = join10(rootTemplatesDir, file);
|
|
4025
|
+
const targetPath = join10(projectRoot, file);
|
|
4026
|
+
if (existsSync10(sourcePath)) {
|
|
4027
|
+
const isNew = !existsSync10(targetPath);
|
|
4028
|
+
copyFile(sourcePath, targetPath);
|
|
4029
|
+
if (isNew) {
|
|
4030
|
+
rootCreated++;
|
|
4031
|
+
if (options.verbose) {
|
|
4032
|
+
console.log(chalk16.green(` + Created: ${file}`));
|
|
4033
|
+
}
|
|
4034
|
+
} else {
|
|
4035
|
+
rootUpdated++;
|
|
4036
|
+
if (options.verbose) {
|
|
4037
|
+
console.log(chalk16.yellow(` ~ Updated: ${file}`));
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
if (rootUpdated + rootCreated > 0) {
|
|
4043
|
+
console.log(chalk16.gray(` Root files: ${rootUpdated} updated, ${rootCreated} created`));
|
|
4044
|
+
}
|
|
4014
4045
|
}
|
|
4015
4046
|
console.log(chalk16.green("\n \u2705 Sync complete!\n"));
|
|
4016
4047
|
if (customFiles.length > 0) {
|