@configjs/cli 1.1.9 → 1.1.11
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/README.fr.md +8 -3
- package/README.md +14 -3
- package/dist/{check-IOMRDWLB.js → check-PEWUERVP.js} +2 -2
- package/dist/{remove-XQBB4NC3.js → chunk-2HZGGA67.js} +81 -61
- package/dist/{chunk-QBMH2K7B.js → chunk-3WLFBAII.js} +57 -0
- package/dist/{chunk-ABHFQM5U.js → chunk-AP23JQSL.js} +59 -37
- package/dist/{chunk-ATUTE7PE.js → chunk-O2IJKLMT.js} +1 -1
- package/dist/{chunk-6WWDHX4E.js → chunk-ZAGZRB7Y.js} +666 -374
- package/dist/cli.js +19 -7
- package/dist/{list-TDMIAZPQ.js → list-3M2L5RYT.js} +1 -1
- package/dist/{nextjs-command-W53FZE7U.js → nextjs-command-CANKBSNF.js} +4 -4
- package/dist/{nextjs-installer-TJXAUIQK.js → nextjs-installer-TQTRTWTQ.js} +1 -1
- package/dist/{nextjs-setup-YYXNONJ6.js → nextjs-setup-I5JJ43KS.js} +1 -1
- package/dist/{react-command-NHCD2L7R.js → react-command-BFJWFYWC.js} +4 -4
- package/dist/remove-JCK32XHZ.js +75 -0
- package/dist/svelte-command-DHI62P2P.js +72 -0
- package/dist/svelte-installer-HWNNV2YK.js +65 -0
- package/dist/svelte-setup-2IJCXART.js +38 -0
- package/dist/{vite-installer-J7BO22KD.js → vite-installer-PPES2JQY.js} +1 -1
- package/dist/{vite-setup-B5TXMX72.js → vite-setup-GOJ73AYC.js} +1 -1
- package/dist/{vue-command-GYKDHJRJ.js → vue-command-R7ZY5GED.js} +4 -4
- package/dist/{vue-installer-3AWLLT53.js → vue-installer-XTKXJNTQ.js} +1 -1
- package/dist/{vue-setup-JLZVVRSJ.js → vue-setup-3QAOL6JM.js} +1 -1
- package/package.json +1 -1
|
@@ -2938,9 +2938,78 @@ function getIndexContentJS4() {
|
|
|
2938
2938
|
`;
|
|
2939
2939
|
}
|
|
2940
2940
|
|
|
2941
|
+
// src/plugins/forms/svelte-superforms.ts
|
|
2942
|
+
var logger9 = getModuleLogger();
|
|
2943
|
+
var svelteFormsPlugin = {
|
|
2944
|
+
name: "sveltekit-superforms",
|
|
2945
|
+
displayName: "SvelteKit Superforms",
|
|
2946
|
+
description: "Gestion des formulaires avec validation c\xF4t\xE9 serveur et client",
|
|
2947
|
+
category: "forms" /* FORMS */,
|
|
2948
|
+
version: "^2.17.0",
|
|
2949
|
+
frameworks: ["svelte"],
|
|
2950
|
+
detect: (ctx) => {
|
|
2951
|
+
return ctx.dependencies["sveltekit-superforms"] !== void 0;
|
|
2952
|
+
},
|
|
2953
|
+
async install(ctx) {
|
|
2954
|
+
if (this.detect?.(ctx)) {
|
|
2955
|
+
logger9.info("SvelteKit Superforms is already installed");
|
|
2956
|
+
return {
|
|
2957
|
+
packages: {},
|
|
2958
|
+
success: true,
|
|
2959
|
+
message: "SvelteKit Superforms already installed"
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
try {
|
|
2963
|
+
const packages = ["sveltekit-superforms"];
|
|
2964
|
+
await installPackages(packages, {
|
|
2965
|
+
dev: false,
|
|
2966
|
+
packageManager: ctx.packageManager,
|
|
2967
|
+
projectRoot: ctx.projectRoot,
|
|
2968
|
+
exact: false,
|
|
2969
|
+
silent: false
|
|
2970
|
+
});
|
|
2971
|
+
logger9.info(`Installed ${packages.length} package(s)`);
|
|
2972
|
+
return {
|
|
2973
|
+
packages: {
|
|
2974
|
+
dependencies: packages
|
|
2975
|
+
},
|
|
2976
|
+
success: true,
|
|
2977
|
+
message: "SvelteKit Superforms installed successfully"
|
|
2978
|
+
};
|
|
2979
|
+
} catch (error) {
|
|
2980
|
+
logger9.error(`Failed to install SvelteKit Superforms: ${String(error)}`);
|
|
2981
|
+
return {
|
|
2982
|
+
packages: {},
|
|
2983
|
+
success: false,
|
|
2984
|
+
message: `Installation failed: ${String(error)}`
|
|
2985
|
+
};
|
|
2986
|
+
}
|
|
2987
|
+
},
|
|
2988
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
2989
|
+
async configure(_ctx) {
|
|
2990
|
+
try {
|
|
2991
|
+
logger9.info(
|
|
2992
|
+
"SvelteKit Superforms is ready to use, import from sveltekit-superforms"
|
|
2993
|
+
);
|
|
2994
|
+
return {
|
|
2995
|
+
success: true,
|
|
2996
|
+
message: "SvelteKit Superforms configured successfully",
|
|
2997
|
+
files: []
|
|
2998
|
+
};
|
|
2999
|
+
} catch (error) {
|
|
3000
|
+
logger9.error(`Configuration failed: ${String(error)}`);
|
|
3001
|
+
return {
|
|
3002
|
+
success: false,
|
|
3003
|
+
message: `Configuration failed: ${String(error)}`,
|
|
3004
|
+
files: []
|
|
3005
|
+
};
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
};
|
|
3009
|
+
|
|
2941
3010
|
// src/plugins/http/axios.ts
|
|
2942
3011
|
import { resolve as resolve8, join as join9 } from "path";
|
|
2943
|
-
var
|
|
3012
|
+
var logger10 = getModuleLogger();
|
|
2944
3013
|
var axiosPlugin = {
|
|
2945
3014
|
name: "axios",
|
|
2946
3015
|
displayName: "Axios",
|
|
@@ -2959,7 +3028,7 @@ var axiosPlugin = {
|
|
|
2959
3028
|
*/
|
|
2960
3029
|
async install(ctx) {
|
|
2961
3030
|
if (this.detect?.(ctx)) {
|
|
2962
|
-
|
|
3031
|
+
logger10.info("Axios is already installed");
|
|
2963
3032
|
return {
|
|
2964
3033
|
packages: {},
|
|
2965
3034
|
success: true,
|
|
@@ -2975,7 +3044,7 @@ var axiosPlugin = {
|
|
|
2975
3044
|
exact: false,
|
|
2976
3045
|
silent: false
|
|
2977
3046
|
});
|
|
2978
|
-
|
|
3047
|
+
logger10.info("Successfully installed Axios");
|
|
2979
3048
|
return {
|
|
2980
3049
|
packages: {
|
|
2981
3050
|
dependencies: packages
|
|
@@ -2984,7 +3053,7 @@ var axiosPlugin = {
|
|
|
2984
3053
|
message: `Installed ${packages.join(", ")}`
|
|
2985
3054
|
};
|
|
2986
3055
|
} catch (error) {
|
|
2987
|
-
|
|
3056
|
+
logger10.error("Failed to install Axios:", error);
|
|
2988
3057
|
return {
|
|
2989
3058
|
packages: {},
|
|
2990
3059
|
success: false,
|
|
@@ -3018,7 +3087,7 @@ var axiosPlugin = {
|
|
|
3018
3087
|
content: apiContent,
|
|
3019
3088
|
backup: false
|
|
3020
3089
|
});
|
|
3021
|
-
|
|
3090
|
+
logger10.info(`Created Axios instance: ${apiPath}`);
|
|
3022
3091
|
if (ctx.typescript) {
|
|
3023
3092
|
const typesPath = join9(libDir, "api-types.ts");
|
|
3024
3093
|
const typesContent = getApiTypesContentTS();
|
|
@@ -3029,7 +3098,7 @@ var axiosPlugin = {
|
|
|
3029
3098
|
content: typesContent,
|
|
3030
3099
|
backup: false
|
|
3031
3100
|
});
|
|
3032
|
-
|
|
3101
|
+
logger10.info(`Created API types: ${typesPath}`);
|
|
3033
3102
|
}
|
|
3034
3103
|
return {
|
|
3035
3104
|
files,
|
|
@@ -3037,7 +3106,7 @@ var axiosPlugin = {
|
|
|
3037
3106
|
message: "Axios configured successfully"
|
|
3038
3107
|
};
|
|
3039
3108
|
} catch (error) {
|
|
3040
|
-
|
|
3109
|
+
logger10.error("Failed to configure Axios:", error);
|
|
3041
3110
|
return {
|
|
3042
3111
|
files,
|
|
3043
3112
|
success: false,
|
|
@@ -3052,9 +3121,9 @@ var axiosPlugin = {
|
|
|
3052
3121
|
const backupManager = getRollbackManager(_ctx);
|
|
3053
3122
|
try {
|
|
3054
3123
|
await backupManager.restoreAll();
|
|
3055
|
-
|
|
3124
|
+
logger10.info("Axios configuration rolled back");
|
|
3056
3125
|
} catch (error) {
|
|
3057
|
-
|
|
3126
|
+
logger10.error("Failed to rollback Axios configuration:", error);
|
|
3058
3127
|
throw error;
|
|
3059
3128
|
}
|
|
3060
3129
|
}
|
|
@@ -3275,7 +3344,7 @@ export interface ApiError {
|
|
|
3275
3344
|
|
|
3276
3345
|
// src/plugins/http/tanstack-query.ts
|
|
3277
3346
|
import { resolve as resolve9, join as join10 } from "path";
|
|
3278
|
-
var
|
|
3347
|
+
var logger11 = getModuleLogger();
|
|
3279
3348
|
var tanstackQueryPlugin = {
|
|
3280
3349
|
name: "@tanstack/react-query",
|
|
3281
3350
|
displayName: "TanStack Query",
|
|
@@ -3294,7 +3363,7 @@ var tanstackQueryPlugin = {
|
|
|
3294
3363
|
*/
|
|
3295
3364
|
async install(ctx) {
|
|
3296
3365
|
if (this.detect?.(ctx)) {
|
|
3297
|
-
|
|
3366
|
+
logger11.info("TanStack Query is already installed");
|
|
3298
3367
|
return {
|
|
3299
3368
|
packages: {},
|
|
3300
3369
|
success: true,
|
|
@@ -3310,7 +3379,7 @@ var tanstackQueryPlugin = {
|
|
|
3310
3379
|
exact: false,
|
|
3311
3380
|
silent: false
|
|
3312
3381
|
});
|
|
3313
|
-
|
|
3382
|
+
logger11.info("Successfully installed TanStack Query");
|
|
3314
3383
|
return {
|
|
3315
3384
|
packages: {
|
|
3316
3385
|
dependencies: packages
|
|
@@ -3319,7 +3388,7 @@ var tanstackQueryPlugin = {
|
|
|
3319
3388
|
message: `Installed ${packages.join(", ")}`
|
|
3320
3389
|
};
|
|
3321
3390
|
} catch (error) {
|
|
3322
|
-
|
|
3391
|
+
logger11.error("Failed to install TanStack Query:", error);
|
|
3323
3392
|
return {
|
|
3324
3393
|
packages: {},
|
|
3325
3394
|
success: false,
|
|
@@ -3357,7 +3426,7 @@ var tanstackQueryPlugin = {
|
|
|
3357
3426
|
content: queryClientContent,
|
|
3358
3427
|
backup: false
|
|
3359
3428
|
});
|
|
3360
|
-
|
|
3429
|
+
logger11.info(`Created query client: ${queryClientPath}`);
|
|
3361
3430
|
const queriesDir = join10(libDir, "queries");
|
|
3362
3431
|
await ensureDirectory(queriesDir, ctx.fsAdapter);
|
|
3363
3432
|
const exampleQueryPath = join10(queriesDir, `example.${extension}`);
|
|
@@ -3369,7 +3438,7 @@ var tanstackQueryPlugin = {
|
|
|
3369
3438
|
content: exampleQueryContent,
|
|
3370
3439
|
backup: false
|
|
3371
3440
|
});
|
|
3372
|
-
|
|
3441
|
+
logger11.info(`Created example query: ${exampleQueryPath}`);
|
|
3373
3442
|
const mutationsDir = join10(libDir, "mutations");
|
|
3374
3443
|
await ensureDirectory(mutationsDir, ctx.fsAdapter);
|
|
3375
3444
|
const exampleMutationPath = join10(mutationsDir, `example.${extension}`);
|
|
@@ -3381,7 +3450,7 @@ var tanstackQueryPlugin = {
|
|
|
3381
3450
|
content: exampleMutationContent,
|
|
3382
3451
|
backup: false
|
|
3383
3452
|
});
|
|
3384
|
-
|
|
3453
|
+
logger11.info(`Created example mutation: ${exampleMutationPath}`);
|
|
3385
3454
|
const appPath = join10(srcDir, `App.${ctx.typescript ? "tsx" : "jsx"}`);
|
|
3386
3455
|
const appExists = await checkPathExists(appPath, ctx.fsAdapter);
|
|
3387
3456
|
if (appExists) {
|
|
@@ -3401,7 +3470,7 @@ var tanstackQueryPlugin = {
|
|
|
3401
3470
|
content: modifiedAppContent,
|
|
3402
3471
|
backup: true
|
|
3403
3472
|
});
|
|
3404
|
-
|
|
3473
|
+
logger11.info(
|
|
3405
3474
|
`Updated App.${ctx.typescript ? "tsx" : "jsx"} with QueryClientProvider`
|
|
3406
3475
|
);
|
|
3407
3476
|
} else {
|
|
@@ -3413,7 +3482,7 @@ var tanstackQueryPlugin = {
|
|
|
3413
3482
|
content: appContent,
|
|
3414
3483
|
backup: false
|
|
3415
3484
|
});
|
|
3416
|
-
|
|
3485
|
+
logger11.info(
|
|
3417
3486
|
`Created App.${ctx.typescript ? "tsx" : "jsx"} with QueryClientProvider`
|
|
3418
3487
|
);
|
|
3419
3488
|
}
|
|
@@ -3423,7 +3492,7 @@ var tanstackQueryPlugin = {
|
|
|
3423
3492
|
message: "TanStack Query configured successfully"
|
|
3424
3493
|
};
|
|
3425
3494
|
} catch (error) {
|
|
3426
|
-
|
|
3495
|
+
logger11.error("Failed to configure TanStack Query:", error);
|
|
3427
3496
|
return {
|
|
3428
3497
|
files,
|
|
3429
3498
|
success: false,
|
|
@@ -3438,9 +3507,9 @@ var tanstackQueryPlugin = {
|
|
|
3438
3507
|
const backupManager = getRollbackManager(_ctx);
|
|
3439
3508
|
try {
|
|
3440
3509
|
await backupManager.restoreAll();
|
|
3441
|
-
|
|
3510
|
+
logger11.info("TanStack Query configuration rolled back");
|
|
3442
3511
|
} catch (error) {
|
|
3443
|
-
|
|
3512
|
+
logger11.error("Failed to rollback TanStack Query configuration:", error);
|
|
3444
3513
|
throw error;
|
|
3445
3514
|
}
|
|
3446
3515
|
}
|
|
@@ -3744,7 +3813,7 @@ export default App
|
|
|
3744
3813
|
}
|
|
3745
3814
|
function injectQueryClientProvider(content, isTypeScript) {
|
|
3746
3815
|
if (content.includes("QueryClientProvider") && content.includes("@tanstack/react-query")) {
|
|
3747
|
-
|
|
3816
|
+
logger11.warn("QueryClientProvider already present in App file");
|
|
3748
3817
|
return content;
|
|
3749
3818
|
}
|
|
3750
3819
|
const hasQueryClientProviderImport = content.includes("from '@tanstack/react-query'") || content.includes('from "@tanstack/react-query"');
|
|
@@ -3829,7 +3898,7 @@ export default App
|
|
|
3829
3898
|
|
|
3830
3899
|
// src/plugins/http/tanstack-query-vue.ts
|
|
3831
3900
|
import { join as join11 } from "path";
|
|
3832
|
-
var
|
|
3901
|
+
var logger12 = getModuleLogger();
|
|
3833
3902
|
var tanstackVueQueryPlugin = {
|
|
3834
3903
|
name: "@tanstack/vue-query",
|
|
3835
3904
|
displayName: "TanStack Query (Vue)",
|
|
@@ -3848,7 +3917,7 @@ var tanstackVueQueryPlugin = {
|
|
|
3848
3917
|
*/
|
|
3849
3918
|
async install(ctx) {
|
|
3850
3919
|
if (this.detect?.(ctx)) {
|
|
3851
|
-
|
|
3920
|
+
logger12.info("TanStack Vue Query is already installed");
|
|
3852
3921
|
return {
|
|
3853
3922
|
packages: {},
|
|
3854
3923
|
success: true,
|
|
@@ -3864,7 +3933,7 @@ var tanstackVueQueryPlugin = {
|
|
|
3864
3933
|
exact: false,
|
|
3865
3934
|
silent: false
|
|
3866
3935
|
});
|
|
3867
|
-
|
|
3936
|
+
logger12.info("Successfully installed TanStack Vue Query");
|
|
3868
3937
|
return {
|
|
3869
3938
|
packages: {
|
|
3870
3939
|
dependencies: packages
|
|
@@ -3873,7 +3942,7 @@ var tanstackVueQueryPlugin = {
|
|
|
3873
3942
|
message: `Installed ${packages.join(", ")}`
|
|
3874
3943
|
};
|
|
3875
3944
|
} catch (error) {
|
|
3876
|
-
|
|
3945
|
+
logger12.error("Failed to install TanStack Vue Query:", error);
|
|
3877
3946
|
return {
|
|
3878
3947
|
packages: {},
|
|
3879
3948
|
success: false,
|
|
@@ -3911,7 +3980,7 @@ var tanstackVueQueryPlugin = {
|
|
|
3911
3980
|
content: queryClientContent,
|
|
3912
3981
|
backup: false
|
|
3913
3982
|
});
|
|
3914
|
-
|
|
3983
|
+
logger12.info(`Created TanStack Query client: ${queryClientPath}`);
|
|
3915
3984
|
}
|
|
3916
3985
|
const mainPath = join11(srcDir, `main.${extension}`);
|
|
3917
3986
|
const mainExists = await checkPathExists(mainPath, ctx.fsAdapter);
|
|
@@ -3930,10 +3999,10 @@ var tanstackVueQueryPlugin = {
|
|
|
3930
3999
|
content: updatedMain,
|
|
3931
4000
|
backup: true
|
|
3932
4001
|
});
|
|
3933
|
-
|
|
4002
|
+
logger12.info(`Updated main file with Vue Query: ${mainPath}`);
|
|
3934
4003
|
}
|
|
3935
4004
|
} else {
|
|
3936
|
-
|
|
4005
|
+
logger12.warn(`Main file not found: ${mainPath}`);
|
|
3937
4006
|
}
|
|
3938
4007
|
return {
|
|
3939
4008
|
files,
|
|
@@ -3941,7 +4010,7 @@ var tanstackVueQueryPlugin = {
|
|
|
3941
4010
|
message: "TanStack Vue Query configured successfully"
|
|
3942
4011
|
};
|
|
3943
4012
|
} catch (error) {
|
|
3944
|
-
|
|
4013
|
+
logger12.error("Failed to configure TanStack Vue Query:", error);
|
|
3945
4014
|
await backupManager.restoreAll();
|
|
3946
4015
|
return {
|
|
3947
4016
|
files,
|
|
@@ -3957,9 +4026,9 @@ var tanstackVueQueryPlugin = {
|
|
|
3957
4026
|
const backupManager = getRollbackManager(_ctx);
|
|
3958
4027
|
try {
|
|
3959
4028
|
await backupManager.restoreAll();
|
|
3960
|
-
|
|
4029
|
+
logger12.info("TanStack Vue Query configuration rolled back");
|
|
3961
4030
|
} catch (error) {
|
|
3962
|
-
|
|
4031
|
+
logger12.error(
|
|
3963
4032
|
"Failed to rollback TanStack Vue Query configuration:",
|
|
3964
4033
|
error
|
|
3965
4034
|
);
|
|
@@ -4016,7 +4085,7 @@ app.use(VueQueryPlugin, { queryClient })`
|
|
|
4016
4085
|
|
|
4017
4086
|
// src/plugins/i18n/vue-i18n.ts
|
|
4018
4087
|
import { join as join12 } from "path";
|
|
4019
|
-
var
|
|
4088
|
+
var logger13 = getModuleLogger();
|
|
4020
4089
|
var vueI18nPlugin = {
|
|
4021
4090
|
name: "vue-i18n",
|
|
4022
4091
|
displayName: "Vue I18n",
|
|
@@ -4035,7 +4104,7 @@ var vueI18nPlugin = {
|
|
|
4035
4104
|
*/
|
|
4036
4105
|
async install(ctx) {
|
|
4037
4106
|
if (this.detect?.(ctx)) {
|
|
4038
|
-
|
|
4107
|
+
logger13.info("vue-i18n is already installed");
|
|
4039
4108
|
return {
|
|
4040
4109
|
packages: {},
|
|
4041
4110
|
success: true,
|
|
@@ -4051,7 +4120,7 @@ var vueI18nPlugin = {
|
|
|
4051
4120
|
exact: false,
|
|
4052
4121
|
silent: false
|
|
4053
4122
|
});
|
|
4054
|
-
|
|
4123
|
+
logger13.info("Successfully installed vue-i18n");
|
|
4055
4124
|
return {
|
|
4056
4125
|
packages: {
|
|
4057
4126
|
dependencies: packages
|
|
@@ -4060,7 +4129,7 @@ var vueI18nPlugin = {
|
|
|
4060
4129
|
message: `Installed vue-i18n: ${packages.join(", ")}`
|
|
4061
4130
|
};
|
|
4062
4131
|
} catch (error) {
|
|
4063
|
-
|
|
4132
|
+
logger13.error("Failed to install vue-i18n:", error);
|
|
4064
4133
|
return {
|
|
4065
4134
|
packages: {},
|
|
4066
4135
|
success: false,
|
|
@@ -4097,7 +4166,7 @@ var vueI18nPlugin = {
|
|
|
4097
4166
|
content: messagesContent,
|
|
4098
4167
|
backup: false
|
|
4099
4168
|
});
|
|
4100
|
-
|
|
4169
|
+
logger13.info(`Created i18n messages: ${messagesPath}`);
|
|
4101
4170
|
}
|
|
4102
4171
|
const i18nIndexPath = join12(i18nDir, `index.${extension}`);
|
|
4103
4172
|
const i18nIndexExists = await checkPathExists(
|
|
@@ -4113,7 +4182,7 @@ var vueI18nPlugin = {
|
|
|
4113
4182
|
content: i18nIndexContent,
|
|
4114
4183
|
backup: false
|
|
4115
4184
|
});
|
|
4116
|
-
|
|
4185
|
+
logger13.info(`Created i18n setup: ${i18nIndexPath}`);
|
|
4117
4186
|
}
|
|
4118
4187
|
const mainPath = join12(srcDir, `main.${extension}`);
|
|
4119
4188
|
const mainExists = await checkPathExists(mainPath, ctx.fsAdapter);
|
|
@@ -4132,10 +4201,10 @@ var vueI18nPlugin = {
|
|
|
4132
4201
|
content: updatedMain,
|
|
4133
4202
|
backup: true
|
|
4134
4203
|
});
|
|
4135
|
-
|
|
4204
|
+
logger13.info(`Updated main file with i18n: ${mainPath}`);
|
|
4136
4205
|
}
|
|
4137
4206
|
} else {
|
|
4138
|
-
|
|
4207
|
+
logger13.warn(`Main file not found: ${mainPath}`);
|
|
4139
4208
|
}
|
|
4140
4209
|
return {
|
|
4141
4210
|
files,
|
|
@@ -4143,7 +4212,7 @@ var vueI18nPlugin = {
|
|
|
4143
4212
|
message: "Vue I18n configured successfully"
|
|
4144
4213
|
};
|
|
4145
4214
|
} catch (error) {
|
|
4146
|
-
|
|
4215
|
+
logger13.error("Failed to configure Vue I18n:", error);
|
|
4147
4216
|
await backupManager.restoreAll();
|
|
4148
4217
|
return {
|
|
4149
4218
|
files,
|
|
@@ -4159,9 +4228,9 @@ var vueI18nPlugin = {
|
|
|
4159
4228
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
4160
4229
|
try {
|
|
4161
4230
|
await backupManager.restoreAll();
|
|
4162
|
-
|
|
4231
|
+
logger13.info("Vue I18n configuration rolled back");
|
|
4163
4232
|
} catch (error) {
|
|
4164
|
-
|
|
4233
|
+
logger13.error("Failed to rollback Vue I18n configuration:", error);
|
|
4165
4234
|
throw error;
|
|
4166
4235
|
}
|
|
4167
4236
|
}
|
|
@@ -4235,7 +4304,7 @@ app.use(i18n)`
|
|
|
4235
4304
|
|
|
4236
4305
|
// src/plugins/nextjs/api-routes.ts
|
|
4237
4306
|
import { join as join13 } from "path";
|
|
4238
|
-
var
|
|
4307
|
+
var logger14 = getModuleLogger();
|
|
4239
4308
|
var nextjsApiRoutesPlugin = {
|
|
4240
4309
|
name: "nextjs-api-routes",
|
|
4241
4310
|
displayName: "Next.js API Routes",
|
|
@@ -4253,7 +4322,7 @@ var nextjsApiRoutesPlugin = {
|
|
|
4253
4322
|
* Pas d'installation nécessaire
|
|
4254
4323
|
*/
|
|
4255
4324
|
install(_ctx) {
|
|
4256
|
-
|
|
4325
|
+
logger14.info("API routes are files, no installation needed");
|
|
4257
4326
|
return Promise.resolve({
|
|
4258
4327
|
packages: {},
|
|
4259
4328
|
success: true,
|
|
@@ -4283,7 +4352,7 @@ var nextjsApiRoutesPlugin = {
|
|
|
4283
4352
|
const appApiExists = await checkPathExists(appApiPath, ctx.fsAdapter);
|
|
4284
4353
|
const pagesApiExists = await checkPathExists(pagesApiPath, ctx.fsAdapter);
|
|
4285
4354
|
if (appApiExists || pagesApiExists) {
|
|
4286
|
-
|
|
4355
|
+
logger14.warn("API route already exists");
|
|
4287
4356
|
return {
|
|
4288
4357
|
files: [],
|
|
4289
4358
|
success: true,
|
|
@@ -4313,14 +4382,14 @@ var nextjsApiRoutesPlugin = {
|
|
|
4313
4382
|
content: apiContent,
|
|
4314
4383
|
backup: false
|
|
4315
4384
|
});
|
|
4316
|
-
|
|
4385
|
+
logger14.info(`Created API route: ${targetPath}`);
|
|
4317
4386
|
return {
|
|
4318
4387
|
files,
|
|
4319
4388
|
success: true,
|
|
4320
4389
|
message: "Next.js API route created successfully"
|
|
4321
4390
|
};
|
|
4322
4391
|
} catch (error) {
|
|
4323
|
-
|
|
4392
|
+
logger14.error("Failed to create API route:", error);
|
|
4324
4393
|
return {
|
|
4325
4394
|
files,
|
|
4326
4395
|
success: false,
|
|
@@ -4335,9 +4404,9 @@ var nextjsApiRoutesPlugin = {
|
|
|
4335
4404
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
4336
4405
|
try {
|
|
4337
4406
|
await backupManager.restoreAll();
|
|
4338
|
-
|
|
4407
|
+
logger14.info("API route configuration rolled back");
|
|
4339
4408
|
} catch (error) {
|
|
4340
|
-
|
|
4409
|
+
logger14.error("Failed to rollback API route configuration:", error);
|
|
4341
4410
|
throw error;
|
|
4342
4411
|
}
|
|
4343
4412
|
}
|
|
@@ -4408,7 +4477,7 @@ export default function handler(
|
|
|
4408
4477
|
|
|
4409
4478
|
// src/plugins/nextjs/font-optimization.ts
|
|
4410
4479
|
import { join as join14 } from "path";
|
|
4411
|
-
var
|
|
4480
|
+
var logger15 = getModuleLogger();
|
|
4412
4481
|
var nextjsFontOptimizationPlugin = {
|
|
4413
4482
|
name: "nextjs-font-optimization",
|
|
4414
4483
|
displayName: "Next.js Font Optimization",
|
|
@@ -4426,7 +4495,7 @@ var nextjsFontOptimizationPlugin = {
|
|
|
4426
4495
|
* Pas d'installation nécessaire, next/font est inclus dans Next.js
|
|
4427
4496
|
*/
|
|
4428
4497
|
install(_ctx) {
|
|
4429
|
-
|
|
4498
|
+
logger15.info(
|
|
4430
4499
|
"Font optimization is built into Next.js, no installation needed"
|
|
4431
4500
|
);
|
|
4432
4501
|
return Promise.resolve({
|
|
@@ -4496,12 +4565,12 @@ var nextjsFontOptimizationPlugin = {
|
|
|
4496
4565
|
content: updatedContent,
|
|
4497
4566
|
backup: true
|
|
4498
4567
|
});
|
|
4499
|
-
|
|
4568
|
+
logger15.info(`Added font optimization to ${targetPath}`);
|
|
4500
4569
|
} else {
|
|
4501
|
-
|
|
4570
|
+
logger15.warn("Font optimization already configured");
|
|
4502
4571
|
}
|
|
4503
4572
|
} else {
|
|
4504
|
-
|
|
4573
|
+
logger15.warn("Could not find layout or _app file to configure fonts");
|
|
4505
4574
|
}
|
|
4506
4575
|
return {
|
|
4507
4576
|
files,
|
|
@@ -4509,7 +4578,7 @@ var nextjsFontOptimizationPlugin = {
|
|
|
4509
4578
|
message: "Next.js font optimization configured successfully"
|
|
4510
4579
|
};
|
|
4511
4580
|
} catch (error) {
|
|
4512
|
-
|
|
4581
|
+
logger15.error("Failed to configure font optimization:", error);
|
|
4513
4582
|
return {
|
|
4514
4583
|
files,
|
|
4515
4584
|
success: false,
|
|
@@ -4524,9 +4593,9 @@ var nextjsFontOptimizationPlugin = {
|
|
|
4524
4593
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
4525
4594
|
try {
|
|
4526
4595
|
await backupManager.restoreAll();
|
|
4527
|
-
|
|
4596
|
+
logger15.info("Font optimization configuration rolled back");
|
|
4528
4597
|
} catch (error) {
|
|
4529
|
-
|
|
4598
|
+
logger15.error("Failed to rollback font optimization configuration:", error);
|
|
4530
4599
|
throw error;
|
|
4531
4600
|
}
|
|
4532
4601
|
}
|
|
@@ -4589,7 +4658,7 @@ const inter = Inter({ subsets: ['latin'] })
|
|
|
4589
4658
|
|
|
4590
4659
|
// src/plugins/nextjs/image-optimization.ts
|
|
4591
4660
|
import { join as join15 } from "path";
|
|
4592
|
-
var
|
|
4661
|
+
var logger16 = getModuleLogger();
|
|
4593
4662
|
var nextjsImageOptimizationPlugin = {
|
|
4594
4663
|
name: "nextjs-image-optimization",
|
|
4595
4664
|
displayName: "Next.js Image Optimization",
|
|
@@ -4607,7 +4676,7 @@ var nextjsImageOptimizationPlugin = {
|
|
|
4607
4676
|
* Pas d'installation nécessaire, Next.js inclut déjà l'optimisation d'images
|
|
4608
4677
|
*/
|
|
4609
4678
|
install(_ctx) {
|
|
4610
|
-
|
|
4679
|
+
logger16.info(
|
|
4611
4680
|
"Image optimization is built into Next.js, no installation needed"
|
|
4612
4681
|
);
|
|
4613
4682
|
return Promise.resolve({
|
|
@@ -4648,7 +4717,7 @@ var nextjsImageOptimizationPlugin = {
|
|
|
4648
4717
|
content: updatedContent,
|
|
4649
4718
|
backup: true
|
|
4650
4719
|
});
|
|
4651
|
-
|
|
4720
|
+
logger16.info(
|
|
4652
4721
|
`Updated next.config.${extension} with image optimization`
|
|
4653
4722
|
);
|
|
4654
4723
|
}
|
|
@@ -4661,7 +4730,7 @@ var nextjsImageOptimizationPlugin = {
|
|
|
4661
4730
|
content: configContent,
|
|
4662
4731
|
backup: false
|
|
4663
4732
|
});
|
|
4664
|
-
|
|
4733
|
+
logger16.info(`Created next.config.${extension} with image optimization`);
|
|
4665
4734
|
}
|
|
4666
4735
|
return {
|
|
4667
4736
|
files,
|
|
@@ -4669,7 +4738,7 @@ var nextjsImageOptimizationPlugin = {
|
|
|
4669
4738
|
message: "Next.js image optimization configured successfully"
|
|
4670
4739
|
};
|
|
4671
4740
|
} catch (error) {
|
|
4672
|
-
|
|
4741
|
+
logger16.error("Failed to configure image optimization:", error);
|
|
4673
4742
|
return {
|
|
4674
4743
|
files,
|
|
4675
4744
|
success: false,
|
|
@@ -4684,9 +4753,9 @@ var nextjsImageOptimizationPlugin = {
|
|
|
4684
4753
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
4685
4754
|
try {
|
|
4686
4755
|
await backupManager.restoreAll();
|
|
4687
|
-
|
|
4756
|
+
logger16.info("Image optimization configuration rolled back");
|
|
4688
4757
|
} catch (error) {
|
|
4689
|
-
|
|
4758
|
+
logger16.error(
|
|
4690
4759
|
"Failed to rollback image optimization configuration:",
|
|
4691
4760
|
error
|
|
4692
4761
|
);
|
|
@@ -4729,7 +4798,7 @@ module.exports = nextConfig
|
|
|
4729
4798
|
}
|
|
4730
4799
|
function injectImageConfig(content, _extension) {
|
|
4731
4800
|
if (content.includes("images:") && content.includes("remotePatterns")) {
|
|
4732
|
-
|
|
4801
|
+
logger16.warn("Image configuration already exists in next.config");
|
|
4733
4802
|
return content;
|
|
4734
4803
|
}
|
|
4735
4804
|
let modifiedContent = content;
|
|
@@ -4777,7 +4846,7 @@ ${match}`
|
|
|
4777
4846
|
|
|
4778
4847
|
// src/plugins/nextjs/middleware.ts
|
|
4779
4848
|
import { join as join16 } from "path";
|
|
4780
|
-
var
|
|
4849
|
+
var logger17 = getModuleLogger();
|
|
4781
4850
|
var nextjsMiddlewarePlugin = {
|
|
4782
4851
|
name: "nextjs-middleware",
|
|
4783
4852
|
displayName: "Next.js Middleware",
|
|
@@ -4795,7 +4864,7 @@ var nextjsMiddlewarePlugin = {
|
|
|
4795
4864
|
* Pas d'installation nécessaire
|
|
4796
4865
|
*/
|
|
4797
4866
|
install(_ctx) {
|
|
4798
|
-
|
|
4867
|
+
logger17.info("Middleware is a file, no installation needed");
|
|
4799
4868
|
return Promise.resolve({
|
|
4800
4869
|
packages: {},
|
|
4801
4870
|
success: true,
|
|
@@ -4817,7 +4886,7 @@ var nextjsMiddlewarePlugin = {
|
|
|
4817
4886
|
ctx.fsAdapter
|
|
4818
4887
|
);
|
|
4819
4888
|
if (middlewareExists) {
|
|
4820
|
-
|
|
4889
|
+
logger17.warn("middleware.ts already exists, skipping creation");
|
|
4821
4890
|
} else {
|
|
4822
4891
|
const middlewareContent = getMiddlewareContent(extension);
|
|
4823
4892
|
await writer.createFile(middlewarePath, middlewareContent);
|
|
@@ -4827,7 +4896,7 @@ var nextjsMiddlewarePlugin = {
|
|
|
4827
4896
|
content: middlewareContent,
|
|
4828
4897
|
backup: false
|
|
4829
4898
|
});
|
|
4830
|
-
|
|
4899
|
+
logger17.info(`Created middleware.${extension}`);
|
|
4831
4900
|
}
|
|
4832
4901
|
return {
|
|
4833
4902
|
files,
|
|
@@ -4835,7 +4904,7 @@ var nextjsMiddlewarePlugin = {
|
|
|
4835
4904
|
message: "Next.js middleware created successfully"
|
|
4836
4905
|
};
|
|
4837
4906
|
} catch (error) {
|
|
4838
|
-
|
|
4907
|
+
logger17.error("Failed to create middleware:", error);
|
|
4839
4908
|
return {
|
|
4840
4909
|
files,
|
|
4841
4910
|
success: false,
|
|
@@ -4850,9 +4919,9 @@ var nextjsMiddlewarePlugin = {
|
|
|
4850
4919
|
const backupManager = getRollbackManager(_ctx);
|
|
4851
4920
|
try {
|
|
4852
4921
|
await backupManager.restoreAll();
|
|
4853
|
-
|
|
4922
|
+
logger17.info("Middleware configuration rolled back");
|
|
4854
4923
|
} catch (error) {
|
|
4855
|
-
|
|
4924
|
+
logger17.error("Failed to rollback middleware configuration:", error);
|
|
4856
4925
|
throw error;
|
|
4857
4926
|
}
|
|
4858
4927
|
}
|
|
@@ -4911,7 +4980,7 @@ export const config = {
|
|
|
4911
4980
|
|
|
4912
4981
|
// src/plugins/routing/react-router.ts
|
|
4913
4982
|
import { resolve as resolve10, join as join17 } from "path";
|
|
4914
|
-
var
|
|
4983
|
+
var logger18 = getModuleLogger();
|
|
4915
4984
|
var reactRouterPlugin = {
|
|
4916
4985
|
name: "react-router-dom",
|
|
4917
4986
|
displayName: "React Router",
|
|
@@ -4932,7 +5001,7 @@ var reactRouterPlugin = {
|
|
|
4932
5001
|
*/
|
|
4933
5002
|
async install(ctx) {
|
|
4934
5003
|
if (this.detect?.(ctx)) {
|
|
4935
|
-
|
|
5004
|
+
logger18.info("React Router is already installed");
|
|
4936
5005
|
return {
|
|
4937
5006
|
packages: {},
|
|
4938
5007
|
success: true,
|
|
@@ -4951,7 +5020,7 @@ var reactRouterPlugin = {
|
|
|
4951
5020
|
exact: false,
|
|
4952
5021
|
silent: false
|
|
4953
5022
|
});
|
|
4954
|
-
|
|
5023
|
+
logger18.info(`Successfully installed React Router v7`);
|
|
4955
5024
|
return {
|
|
4956
5025
|
packages: {
|
|
4957
5026
|
dependencies: packages
|
|
@@ -4960,7 +5029,7 @@ var reactRouterPlugin = {
|
|
|
4960
5029
|
message: `Installed ${packages.join(", ")}`
|
|
4961
5030
|
};
|
|
4962
5031
|
} catch (error) {
|
|
4963
|
-
|
|
5032
|
+
logger18.error("Failed to install React Router:", error);
|
|
4964
5033
|
return {
|
|
4965
5034
|
packages: {},
|
|
4966
5035
|
success: false,
|
|
@@ -4996,7 +5065,7 @@ var reactRouterPlugin = {
|
|
|
4996
5065
|
content: routerContent,
|
|
4997
5066
|
backup: false
|
|
4998
5067
|
});
|
|
4999
|
-
|
|
5068
|
+
logger18.info(`Created router configuration: ${routerPath}`);
|
|
5000
5069
|
const homeRoutePath = join17(routesDir, `Home.${extension}`);
|
|
5001
5070
|
const homeRouteContent = ctx.typescript ? getHomeRouteContentTS() : getHomeRouteContentJS();
|
|
5002
5071
|
await writer.createFile(homeRoutePath, homeRouteContent);
|
|
@@ -5006,7 +5075,7 @@ var reactRouterPlugin = {
|
|
|
5006
5075
|
content: homeRouteContent,
|
|
5007
5076
|
backup: false
|
|
5008
5077
|
});
|
|
5009
|
-
|
|
5078
|
+
logger18.info(`Created example route: ${homeRoutePath}`);
|
|
5010
5079
|
const appPath = join17(srcDir, `App.${extension}`);
|
|
5011
5080
|
const appExists = await checkPathExists(appPath, ctx.fsAdapter);
|
|
5012
5081
|
if (appExists) {
|
|
@@ -5026,7 +5095,7 @@ var reactRouterPlugin = {
|
|
|
5026
5095
|
content: modifiedAppContent,
|
|
5027
5096
|
backup: true
|
|
5028
5097
|
});
|
|
5029
|
-
|
|
5098
|
+
logger18.info(`Updated App.${extension} with RouterProvider`);
|
|
5030
5099
|
} else {
|
|
5031
5100
|
const appContent = ctx.typescript ? getAppContentTS2() : getAppContentJS2();
|
|
5032
5101
|
await writer.createFile(appPath, appContent);
|
|
@@ -5036,7 +5105,7 @@ var reactRouterPlugin = {
|
|
|
5036
5105
|
content: appContent,
|
|
5037
5106
|
backup: false
|
|
5038
5107
|
});
|
|
5039
|
-
|
|
5108
|
+
logger18.info(`Created App.${extension} with RouterProvider`);
|
|
5040
5109
|
}
|
|
5041
5110
|
return {
|
|
5042
5111
|
files,
|
|
@@ -5044,7 +5113,7 @@ var reactRouterPlugin = {
|
|
|
5044
5113
|
message: "React Router configured successfully"
|
|
5045
5114
|
};
|
|
5046
5115
|
} catch (error) {
|
|
5047
|
-
|
|
5116
|
+
logger18.error("Failed to configure React Router:", error);
|
|
5048
5117
|
return {
|
|
5049
5118
|
files,
|
|
5050
5119
|
success: false,
|
|
@@ -5059,9 +5128,9 @@ var reactRouterPlugin = {
|
|
|
5059
5128
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
5060
5129
|
try {
|
|
5061
5130
|
await backupManager.restoreAll();
|
|
5062
|
-
|
|
5131
|
+
logger18.info("React Router configuration rolled back");
|
|
5063
5132
|
} catch (error) {
|
|
5064
|
-
|
|
5133
|
+
logger18.error("Failed to rollback React Router configuration:", error);
|
|
5065
5134
|
throw error;
|
|
5066
5135
|
}
|
|
5067
5136
|
}
|
|
@@ -5164,7 +5233,7 @@ export default App
|
|
|
5164
5233
|
}
|
|
5165
5234
|
function injectRouterProvider(content, isTypeScript) {
|
|
5166
5235
|
if (content.includes("RouterProvider")) {
|
|
5167
|
-
|
|
5236
|
+
logger18.warn("RouterProvider already present in App file");
|
|
5168
5237
|
return content;
|
|
5169
5238
|
}
|
|
5170
5239
|
const hasRouterImport = content.includes("from 'react-router-dom'") || content.includes('from "react-router-dom"');
|
|
@@ -5265,7 +5334,7 @@ export default App
|
|
|
5265
5334
|
|
|
5266
5335
|
// src/plugins/routing/tanstack-router.ts
|
|
5267
5336
|
import { resolve as resolve11, join as join18 } from "path";
|
|
5268
|
-
var
|
|
5337
|
+
var logger19 = getModuleLogger();
|
|
5269
5338
|
var tanstackRouterPlugin = {
|
|
5270
5339
|
name: "@tanstack/react-router",
|
|
5271
5340
|
displayName: "TanStack Router",
|
|
@@ -5285,7 +5354,7 @@ var tanstackRouterPlugin = {
|
|
|
5285
5354
|
*/
|
|
5286
5355
|
async install(ctx) {
|
|
5287
5356
|
if (this.detect?.(ctx)) {
|
|
5288
|
-
|
|
5357
|
+
logger19.info("TanStack Router is already installed");
|
|
5289
5358
|
return {
|
|
5290
5359
|
packages: {},
|
|
5291
5360
|
success: true,
|
|
@@ -5301,7 +5370,7 @@ var tanstackRouterPlugin = {
|
|
|
5301
5370
|
exact: false,
|
|
5302
5371
|
silent: false
|
|
5303
5372
|
});
|
|
5304
|
-
|
|
5373
|
+
logger19.info("Successfully installed TanStack Router");
|
|
5305
5374
|
return {
|
|
5306
5375
|
packages: {
|
|
5307
5376
|
dependencies: packages
|
|
@@ -5310,7 +5379,7 @@ var tanstackRouterPlugin = {
|
|
|
5310
5379
|
message: `Installed ${packages.join(", ")}`
|
|
5311
5380
|
};
|
|
5312
5381
|
} catch (error) {
|
|
5313
|
-
|
|
5382
|
+
logger19.error("Failed to install TanStack Router:", error);
|
|
5314
5383
|
return {
|
|
5315
5384
|
packages: {},
|
|
5316
5385
|
success: false,
|
|
@@ -5350,7 +5419,7 @@ var tanstackRouterPlugin = {
|
|
|
5350
5419
|
content: rootRouteContent,
|
|
5351
5420
|
backup: false
|
|
5352
5421
|
});
|
|
5353
|
-
|
|
5422
|
+
logger19.info(`Created root route: ${rootRoutePath}`);
|
|
5354
5423
|
const indexRoutePath = join18(routesDir, `index.${extension}`);
|
|
5355
5424
|
const indexRouteContent = ctx.typescript ? getIndexRouteContentTS() : getIndexRouteContentJS();
|
|
5356
5425
|
await writer.createFile(indexRoutePath, indexRouteContent);
|
|
@@ -5360,7 +5429,7 @@ var tanstackRouterPlugin = {
|
|
|
5360
5429
|
content: indexRouteContent,
|
|
5361
5430
|
backup: false
|
|
5362
5431
|
});
|
|
5363
|
-
|
|
5432
|
+
logger19.info(`Created index route: ${indexRoutePath}`);
|
|
5364
5433
|
const aboutRoutePath = join18(routesDir, `about.${extension}`);
|
|
5365
5434
|
const aboutRouteContent = ctx.typescript ? getAboutRouteContentTS() : getAboutRouteContentJS();
|
|
5366
5435
|
await writer.createFile(aboutRoutePath, aboutRouteContent);
|
|
@@ -5370,7 +5439,7 @@ var tanstackRouterPlugin = {
|
|
|
5370
5439
|
content: aboutRouteContent,
|
|
5371
5440
|
backup: false
|
|
5372
5441
|
});
|
|
5373
|
-
|
|
5442
|
+
logger19.info(`Created about route: ${aboutRoutePath}`);
|
|
5374
5443
|
const routerPath = join18(srcDir, `router.${extension}`);
|
|
5375
5444
|
const routerContent = ctx.typescript ? getRouterContentTS2() : getRouterContentJS2();
|
|
5376
5445
|
await writer.createFile(routerPath, routerContent);
|
|
@@ -5380,7 +5449,7 @@ var tanstackRouterPlugin = {
|
|
|
5380
5449
|
content: routerContent,
|
|
5381
5450
|
backup: false
|
|
5382
5451
|
});
|
|
5383
|
-
|
|
5452
|
+
logger19.info(`Created router configuration: ${routerPath}`);
|
|
5384
5453
|
const appPath = join18(srcDir, `App.${extension}`);
|
|
5385
5454
|
const appExists = await checkPathExists(appPath, ctx.fsAdapter);
|
|
5386
5455
|
if (appExists) {
|
|
@@ -5400,7 +5469,7 @@ var tanstackRouterPlugin = {
|
|
|
5400
5469
|
content: modifiedAppContent,
|
|
5401
5470
|
backup: true
|
|
5402
5471
|
});
|
|
5403
|
-
|
|
5472
|
+
logger19.info(`Updated App.${extension} with RouterProvider`);
|
|
5404
5473
|
} else {
|
|
5405
5474
|
const appContent = ctx.typescript ? getAppContentTS3() : getAppContentJS3();
|
|
5406
5475
|
await writer.createFile(appPath, appContent);
|
|
@@ -5410,7 +5479,7 @@ var tanstackRouterPlugin = {
|
|
|
5410
5479
|
content: appContent,
|
|
5411
5480
|
backup: false
|
|
5412
5481
|
});
|
|
5413
|
-
|
|
5482
|
+
logger19.info(`Created App.${extension} with RouterProvider`);
|
|
5414
5483
|
}
|
|
5415
5484
|
return {
|
|
5416
5485
|
files,
|
|
@@ -5418,7 +5487,7 @@ var tanstackRouterPlugin = {
|
|
|
5418
5487
|
message: "TanStack Router configured successfully"
|
|
5419
5488
|
};
|
|
5420
5489
|
} catch (error) {
|
|
5421
|
-
|
|
5490
|
+
logger19.error("Failed to configure TanStack Router:", error);
|
|
5422
5491
|
return {
|
|
5423
5492
|
files,
|
|
5424
5493
|
success: false,
|
|
@@ -5433,9 +5502,9 @@ var tanstackRouterPlugin = {
|
|
|
5433
5502
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
5434
5503
|
try {
|
|
5435
5504
|
await backupManager.restoreAll();
|
|
5436
|
-
|
|
5505
|
+
logger19.info("TanStack Router configuration rolled back");
|
|
5437
5506
|
} catch (error) {
|
|
5438
|
-
|
|
5507
|
+
logger19.error("Failed to rollback TanStack Router configuration:", error);
|
|
5439
5508
|
throw error;
|
|
5440
5509
|
}
|
|
5441
5510
|
}
|
|
@@ -5671,7 +5740,7 @@ export default App
|
|
|
5671
5740
|
}
|
|
5672
5741
|
function injectRouterProvider2(content, isTypeScript) {
|
|
5673
5742
|
if (content.includes("RouterProvider")) {
|
|
5674
|
-
|
|
5743
|
+
logger19.warn("RouterProvider already present in App file");
|
|
5675
5744
|
return content;
|
|
5676
5745
|
}
|
|
5677
5746
|
const hasRouterImport = content.includes("from '@tanstack/react-router'") || content.includes('from "@tanstack/react-router"');
|
|
@@ -5772,7 +5841,7 @@ export default App
|
|
|
5772
5841
|
|
|
5773
5842
|
// src/plugins/routing/vue-router.ts
|
|
5774
5843
|
import { resolve as resolve12, join as join19 } from "path";
|
|
5775
|
-
var
|
|
5844
|
+
var logger20 = getModuleLogger();
|
|
5776
5845
|
var vueRouterPlugin = {
|
|
5777
5846
|
name: "vue-router",
|
|
5778
5847
|
displayName: "Vue Router",
|
|
@@ -5791,7 +5860,7 @@ var vueRouterPlugin = {
|
|
|
5791
5860
|
*/
|
|
5792
5861
|
async install(ctx) {
|
|
5793
5862
|
if (this.detect?.(ctx)) {
|
|
5794
|
-
|
|
5863
|
+
logger20.info("Vue Router is already installed");
|
|
5795
5864
|
return {
|
|
5796
5865
|
packages: {},
|
|
5797
5866
|
success: true,
|
|
@@ -5807,7 +5876,7 @@ var vueRouterPlugin = {
|
|
|
5807
5876
|
exact: false,
|
|
5808
5877
|
silent: false
|
|
5809
5878
|
});
|
|
5810
|
-
|
|
5879
|
+
logger20.info("Successfully installed Vue Router v4");
|
|
5811
5880
|
return {
|
|
5812
5881
|
packages: {
|
|
5813
5882
|
dependencies: packages
|
|
@@ -5816,7 +5885,7 @@ var vueRouterPlugin = {
|
|
|
5816
5885
|
message: `Installed ${packages.join(", ")}`
|
|
5817
5886
|
};
|
|
5818
5887
|
} catch (error) {
|
|
5819
|
-
|
|
5888
|
+
logger20.error("Failed to install Vue Router:", error);
|
|
5820
5889
|
return {
|
|
5821
5890
|
packages: {},
|
|
5822
5891
|
success: false,
|
|
@@ -5856,7 +5925,7 @@ var vueRouterPlugin = {
|
|
|
5856
5925
|
content: routerIndexContent,
|
|
5857
5926
|
backup: false
|
|
5858
5927
|
});
|
|
5859
|
-
|
|
5928
|
+
logger20.info(`Created router configuration: ${routerIndexPath}`);
|
|
5860
5929
|
const homeViewPath = join19(viewsDir, "HomeView.vue");
|
|
5861
5930
|
const vueApi = ctx.vueApi || "composition";
|
|
5862
5931
|
const homeViewContent = getHomeViewContent(vueApi);
|
|
@@ -5867,7 +5936,7 @@ var vueRouterPlugin = {
|
|
|
5867
5936
|
content: homeViewContent,
|
|
5868
5937
|
backup: false
|
|
5869
5938
|
});
|
|
5870
|
-
|
|
5939
|
+
logger20.info(`Created HomeView: ${homeViewPath}`);
|
|
5871
5940
|
const aboutViewPath = join19(viewsDir, "AboutView.vue");
|
|
5872
5941
|
const aboutViewContent = getAboutViewContent(vueApi);
|
|
5873
5942
|
await writer.createFile(aboutViewPath, aboutViewContent);
|
|
@@ -5877,7 +5946,7 @@ var vueRouterPlugin = {
|
|
|
5877
5946
|
content: aboutViewContent,
|
|
5878
5947
|
backup: false
|
|
5879
5948
|
});
|
|
5880
|
-
|
|
5949
|
+
logger20.info(`Created AboutView: ${aboutViewPath}`);
|
|
5881
5950
|
const mainPath = join19(srcDir, `main.${extension}`);
|
|
5882
5951
|
if (await checkPathExists(mainPath, ctx.fsAdapter)) {
|
|
5883
5952
|
const mainContent = await readFileContent(
|
|
@@ -5894,10 +5963,10 @@ var vueRouterPlugin = {
|
|
|
5894
5963
|
content: updatedMainContent,
|
|
5895
5964
|
backup: true
|
|
5896
5965
|
});
|
|
5897
|
-
|
|
5966
|
+
logger20.info(`Updated main file: ${mainPath}`);
|
|
5898
5967
|
}
|
|
5899
5968
|
} else {
|
|
5900
|
-
|
|
5969
|
+
logger20.warn(`Main file not found: ${mainPath}`);
|
|
5901
5970
|
}
|
|
5902
5971
|
const appPath = join19(srcDir, "App.vue");
|
|
5903
5972
|
if (await checkPathExists(appPath, ctx.fsAdapter)) {
|
|
@@ -5915,10 +5984,10 @@ var vueRouterPlugin = {
|
|
|
5915
5984
|
content: updatedAppContent,
|
|
5916
5985
|
backup: true
|
|
5917
5986
|
});
|
|
5918
|
-
|
|
5987
|
+
logger20.info(`Updated App.vue: ${appPath}`);
|
|
5919
5988
|
}
|
|
5920
5989
|
} else {
|
|
5921
|
-
|
|
5990
|
+
logger20.warn(`App.vue not found: ${appPath}`);
|
|
5922
5991
|
}
|
|
5923
5992
|
return {
|
|
5924
5993
|
files,
|
|
@@ -5926,7 +5995,7 @@ var vueRouterPlugin = {
|
|
|
5926
5995
|
message: "Vue Router configured successfully"
|
|
5927
5996
|
};
|
|
5928
5997
|
} catch (error) {
|
|
5929
|
-
|
|
5998
|
+
logger20.error("Failed to configure Vue Router:", error);
|
|
5930
5999
|
return {
|
|
5931
6000
|
files,
|
|
5932
6001
|
success: false,
|
|
@@ -5940,7 +6009,7 @@ var vueRouterPlugin = {
|
|
|
5940
6009
|
async rollback(_ctx) {
|
|
5941
6010
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
5942
6011
|
await backupManager.restoreAll();
|
|
5943
|
-
|
|
6012
|
+
logger20.info("Vue Router configuration rolled back");
|
|
5944
6013
|
}
|
|
5945
6014
|
};
|
|
5946
6015
|
function getRouterIndexContentTS() {
|
|
@@ -6086,7 +6155,7 @@ function updateMainFile(content, isTypeScript) {
|
|
|
6086
6155
|
const routerImport = isTypeScript ? "import router from './router'\n" : "import router from './router'\n";
|
|
6087
6156
|
const createAppMatch = content.match(/createApp\([^)]+\)/);
|
|
6088
6157
|
if (!createAppMatch) {
|
|
6089
|
-
|
|
6158
|
+
logger20.warn("Could not find createApp in main file");
|
|
6090
6159
|
return content;
|
|
6091
6160
|
}
|
|
6092
6161
|
const importRegex = /(import\s+.*?from\s+['"].*?['"];?\s*\n)/g;
|
|
@@ -6154,9 +6223,87 @@ function updateAppFile(content) {
|
|
|
6154
6223
|
return content;
|
|
6155
6224
|
}
|
|
6156
6225
|
|
|
6226
|
+
// src/plugins/routing/sveltekit.ts
|
|
6227
|
+
var logger21 = getModuleLogger();
|
|
6228
|
+
var svelteKitPlugin = {
|
|
6229
|
+
name: "@sveltejs/kit",
|
|
6230
|
+
displayName: "SvelteKit",
|
|
6231
|
+
description: "Framework fullstack pour Svelte avec routing int\xE9gr\xE9",
|
|
6232
|
+
category: "routing" /* ROUTING */,
|
|
6233
|
+
version: "^2.5.0",
|
|
6234
|
+
frameworks: ["svelte"],
|
|
6235
|
+
/**
|
|
6236
|
+
* Détecte si SvelteKit est déjà installé
|
|
6237
|
+
*/
|
|
6238
|
+
detect: (ctx) => {
|
|
6239
|
+
return ctx.dependencies["@sveltejs/kit"] !== void 0;
|
|
6240
|
+
},
|
|
6241
|
+
/**
|
|
6242
|
+
* Installe SvelteKit
|
|
6243
|
+
*/
|
|
6244
|
+
async install(ctx) {
|
|
6245
|
+
if (this.detect?.(ctx)) {
|
|
6246
|
+
logger21.info("SvelteKit is already installed");
|
|
6247
|
+
return {
|
|
6248
|
+
packages: {},
|
|
6249
|
+
success: true,
|
|
6250
|
+
message: "SvelteKit already installed"
|
|
6251
|
+
};
|
|
6252
|
+
}
|
|
6253
|
+
try {
|
|
6254
|
+
const packages = ["@sveltejs/kit", "@sveltejs/adapter-auto"];
|
|
6255
|
+
await installPackages(packages, {
|
|
6256
|
+
dev: false,
|
|
6257
|
+
packageManager: ctx.packageManager,
|
|
6258
|
+
projectRoot: ctx.projectRoot,
|
|
6259
|
+
exact: false,
|
|
6260
|
+
silent: false
|
|
6261
|
+
});
|
|
6262
|
+
logger21.info(`Installed ${packages.length} package(s)`);
|
|
6263
|
+
return {
|
|
6264
|
+
packages: {
|
|
6265
|
+
dependencies: packages
|
|
6266
|
+
},
|
|
6267
|
+
success: true,
|
|
6268
|
+
message: "SvelteKit installed successfully"
|
|
6269
|
+
};
|
|
6270
|
+
} catch (error) {
|
|
6271
|
+
logger21.error(`Failed to install SvelteKit: ${String(error)}`);
|
|
6272
|
+
return {
|
|
6273
|
+
packages: {},
|
|
6274
|
+
success: false,
|
|
6275
|
+
message: `Installation failed: ${String(error)}`
|
|
6276
|
+
};
|
|
6277
|
+
}
|
|
6278
|
+
},
|
|
6279
|
+
/**
|
|
6280
|
+
* Configure SvelteKit
|
|
6281
|
+
*/
|
|
6282
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
6283
|
+
async configure(_ctx) {
|
|
6284
|
+
try {
|
|
6285
|
+
logger21.info(
|
|
6286
|
+
"SvelteKit configuration: Already integrated in vite.config.ts"
|
|
6287
|
+
);
|
|
6288
|
+
return {
|
|
6289
|
+
success: true,
|
|
6290
|
+
message: "SvelteKit configuration already set up",
|
|
6291
|
+
files: []
|
|
6292
|
+
};
|
|
6293
|
+
} catch (error) {
|
|
6294
|
+
logger21.error(`Configuration failed: ${String(error)}`);
|
|
6295
|
+
return {
|
|
6296
|
+
success: false,
|
|
6297
|
+
message: `Configuration failed: ${String(error)}`,
|
|
6298
|
+
files: []
|
|
6299
|
+
};
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
};
|
|
6303
|
+
|
|
6157
6304
|
// src/plugins/state/jotai.ts
|
|
6158
6305
|
import { resolve as resolve13, join as join20 } from "path";
|
|
6159
|
-
var
|
|
6306
|
+
var logger22 = getModuleLogger();
|
|
6160
6307
|
var jotaiPlugin = {
|
|
6161
6308
|
name: "jotai",
|
|
6162
6309
|
displayName: "Jotai",
|
|
@@ -6176,7 +6323,7 @@ var jotaiPlugin = {
|
|
|
6176
6323
|
*/
|
|
6177
6324
|
async install(ctx) {
|
|
6178
6325
|
if (this.detect?.(ctx)) {
|
|
6179
|
-
|
|
6326
|
+
logger22.info("Jotai is already installed");
|
|
6180
6327
|
return {
|
|
6181
6328
|
packages: {},
|
|
6182
6329
|
success: true,
|
|
@@ -6192,7 +6339,7 @@ var jotaiPlugin = {
|
|
|
6192
6339
|
exact: false,
|
|
6193
6340
|
silent: false
|
|
6194
6341
|
});
|
|
6195
|
-
|
|
6342
|
+
logger22.info("Successfully installed Jotai");
|
|
6196
6343
|
return {
|
|
6197
6344
|
packages: {
|
|
6198
6345
|
dependencies: packages
|
|
@@ -6201,7 +6348,7 @@ var jotaiPlugin = {
|
|
|
6201
6348
|
message: `Installed ${packages.join(", ")}`
|
|
6202
6349
|
};
|
|
6203
6350
|
} catch (error) {
|
|
6204
|
-
|
|
6351
|
+
logger22.error("Failed to install Jotai:", error);
|
|
6205
6352
|
return {
|
|
6206
6353
|
packages: {},
|
|
6207
6354
|
success: false,
|
|
@@ -6238,7 +6385,7 @@ var jotaiPlugin = {
|
|
|
6238
6385
|
content: atomsContent,
|
|
6239
6386
|
backup: false
|
|
6240
6387
|
});
|
|
6241
|
-
|
|
6388
|
+
logger22.info(`Created atoms file: ${atomsPath}`);
|
|
6242
6389
|
const indexPath = join20(storeDir, `index.${extension}`);
|
|
6243
6390
|
const indexContent = ctx.typescript ? getIndexContentTS5() : getIndexContentJS5();
|
|
6244
6391
|
await writer.createFile(indexPath, indexContent);
|
|
@@ -6248,7 +6395,7 @@ var jotaiPlugin = {
|
|
|
6248
6395
|
content: indexContent,
|
|
6249
6396
|
backup: false
|
|
6250
6397
|
});
|
|
6251
|
-
|
|
6398
|
+
logger22.info(`Created store index: ${indexPath}`);
|
|
6252
6399
|
const appPath = join20(srcDir, `App.${ctx.typescript ? "tsx" : "jsx"}`);
|
|
6253
6400
|
const appExists = await checkPathExists(appPath, ctx.fsAdapter);
|
|
6254
6401
|
if (appExists) {
|
|
@@ -6265,7 +6412,7 @@ var jotaiPlugin = {
|
|
|
6265
6412
|
content: modifiedAppContent,
|
|
6266
6413
|
backup: true
|
|
6267
6414
|
});
|
|
6268
|
-
|
|
6415
|
+
logger22.info(
|
|
6269
6416
|
`Updated App.${ctx.typescript ? "tsx" : "jsx"} with Provider`
|
|
6270
6417
|
);
|
|
6271
6418
|
} else {
|
|
@@ -6277,7 +6424,7 @@ var jotaiPlugin = {
|
|
|
6277
6424
|
content: appContent,
|
|
6278
6425
|
backup: false
|
|
6279
6426
|
});
|
|
6280
|
-
|
|
6427
|
+
logger22.info(
|
|
6281
6428
|
`Created App.${ctx.typescript ? "tsx" : "jsx"} with Provider`
|
|
6282
6429
|
);
|
|
6283
6430
|
}
|
|
@@ -6287,7 +6434,7 @@ var jotaiPlugin = {
|
|
|
6287
6434
|
message: "Jotai configured successfully"
|
|
6288
6435
|
};
|
|
6289
6436
|
} catch (error) {
|
|
6290
|
-
|
|
6437
|
+
logger22.error("Failed to configure Jotai:", error);
|
|
6291
6438
|
return {
|
|
6292
6439
|
files,
|
|
6293
6440
|
success: false,
|
|
@@ -6302,9 +6449,9 @@ var jotaiPlugin = {
|
|
|
6302
6449
|
const backupManager = getRollbackManager(_ctx);
|
|
6303
6450
|
try {
|
|
6304
6451
|
await backupManager.restoreAll();
|
|
6305
|
-
|
|
6452
|
+
logger22.info("Jotai configuration rolled back");
|
|
6306
6453
|
} catch (error) {
|
|
6307
|
-
|
|
6454
|
+
logger22.error("Failed to rollback Jotai configuration:", error);
|
|
6308
6455
|
throw error;
|
|
6309
6456
|
}
|
|
6310
6457
|
}
|
|
@@ -6433,7 +6580,7 @@ export default App
|
|
|
6433
6580
|
}
|
|
6434
6581
|
function injectProvider(content, isTypeScript) {
|
|
6435
6582
|
if (content.includes("Provider") && content.includes("jotai")) {
|
|
6436
|
-
|
|
6583
|
+
logger22.warn("Jotai Provider already present in App file");
|
|
6437
6584
|
return content;
|
|
6438
6585
|
}
|
|
6439
6586
|
const hasProviderImport = content.includes("from 'jotai'") || content.includes('from "jotai"');
|
|
@@ -6505,7 +6652,7 @@ export default App
|
|
|
6505
6652
|
|
|
6506
6653
|
// src/plugins/state/pinia.ts
|
|
6507
6654
|
import { resolve as resolve14, join as join21 } from "path";
|
|
6508
|
-
var
|
|
6655
|
+
var logger23 = getModuleLogger();
|
|
6509
6656
|
var piniaPlugin = {
|
|
6510
6657
|
name: "pinia",
|
|
6511
6658
|
displayName: "Pinia",
|
|
@@ -6524,7 +6671,7 @@ var piniaPlugin = {
|
|
|
6524
6671
|
*/
|
|
6525
6672
|
async install(ctx) {
|
|
6526
6673
|
if (this.detect?.(ctx)) {
|
|
6527
|
-
|
|
6674
|
+
logger23.info("Pinia is already installed");
|
|
6528
6675
|
return {
|
|
6529
6676
|
packages: {},
|
|
6530
6677
|
success: true,
|
|
@@ -6532,7 +6679,7 @@ var piniaPlugin = {
|
|
|
6532
6679
|
};
|
|
6533
6680
|
}
|
|
6534
6681
|
if (ctx.vueVersion !== "3") {
|
|
6535
|
-
|
|
6682
|
+
logger23.error("Pinia requires Vue 3");
|
|
6536
6683
|
return {
|
|
6537
6684
|
packages: {},
|
|
6538
6685
|
success: false,
|
|
@@ -6548,7 +6695,7 @@ var piniaPlugin = {
|
|
|
6548
6695
|
exact: false,
|
|
6549
6696
|
silent: false
|
|
6550
6697
|
});
|
|
6551
|
-
|
|
6698
|
+
logger23.info("Successfully installed Pinia");
|
|
6552
6699
|
return {
|
|
6553
6700
|
packages: {
|
|
6554
6701
|
dependencies: packages
|
|
@@ -6557,7 +6704,7 @@ var piniaPlugin = {
|
|
|
6557
6704
|
message: `Installed ${packages.join(", ")}`
|
|
6558
6705
|
};
|
|
6559
6706
|
} catch (error) {
|
|
6560
|
-
|
|
6707
|
+
logger23.error("Failed to install Pinia:", error);
|
|
6561
6708
|
return {
|
|
6562
6709
|
packages: {},
|
|
6563
6710
|
success: false,
|
|
@@ -6592,7 +6739,7 @@ var piniaPlugin = {
|
|
|
6592
6739
|
content: storesIndexContent,
|
|
6593
6740
|
backup: false
|
|
6594
6741
|
});
|
|
6595
|
-
|
|
6742
|
+
logger23.info(`Created Pinia stores index: ${storesIndexPath}`);
|
|
6596
6743
|
const counterStorePath = join21(storesDir, `counter.${extension}`);
|
|
6597
6744
|
const counterStoreContent = ctx.typescript ? getCounterStoreContentTS(ctx.vueApi) : getCounterStoreContentJS(ctx.vueApi);
|
|
6598
6745
|
await writer.createFile(counterStorePath, counterStoreContent);
|
|
@@ -6602,7 +6749,7 @@ var piniaPlugin = {
|
|
|
6602
6749
|
content: counterStoreContent,
|
|
6603
6750
|
backup: false
|
|
6604
6751
|
});
|
|
6605
|
-
|
|
6752
|
+
logger23.info(`Created counter store: ${counterStorePath}`);
|
|
6606
6753
|
const mainPath = join21(srcDir, `main.${extension}`);
|
|
6607
6754
|
if (await checkPathExists(mainPath, ctx.fsAdapter)) {
|
|
6608
6755
|
const mainContent = await readFileContent(
|
|
@@ -6619,10 +6766,10 @@ var piniaPlugin = {
|
|
|
6619
6766
|
content: updatedMainContent,
|
|
6620
6767
|
backup: true
|
|
6621
6768
|
});
|
|
6622
|
-
|
|
6769
|
+
logger23.info(`Updated main file: ${mainPath}`);
|
|
6623
6770
|
}
|
|
6624
6771
|
} else {
|
|
6625
|
-
|
|
6772
|
+
logger23.warn(`Main file not found: ${mainPath}`);
|
|
6626
6773
|
}
|
|
6627
6774
|
return {
|
|
6628
6775
|
files,
|
|
@@ -6630,7 +6777,7 @@ var piniaPlugin = {
|
|
|
6630
6777
|
message: "Pinia configured successfully"
|
|
6631
6778
|
};
|
|
6632
6779
|
} catch (error) {
|
|
6633
|
-
|
|
6780
|
+
logger23.error("Failed to configure Pinia:", error);
|
|
6634
6781
|
return {
|
|
6635
6782
|
files,
|
|
6636
6783
|
success: false,
|
|
@@ -6644,7 +6791,7 @@ var piniaPlugin = {
|
|
|
6644
6791
|
async rollback(_ctx) {
|
|
6645
6792
|
const backupManager = getRollbackManager(_ctx);
|
|
6646
6793
|
await backupManager.restoreAll();
|
|
6647
|
-
|
|
6794
|
+
logger23.info("Pinia configuration rolled back");
|
|
6648
6795
|
}
|
|
6649
6796
|
};
|
|
6650
6797
|
function getStoresIndexContentTS() {
|
|
@@ -6760,7 +6907,7 @@ function updateMainFile2(content, isTypeScript) {
|
|
|
6760
6907
|
const piniaImport = isTypeScript ? "import pinia from './stores'\n" : "import pinia from './stores'\n";
|
|
6761
6908
|
const createAppMatch = content.match(/createApp\([^)]+\)/);
|
|
6762
6909
|
if (!createAppMatch) {
|
|
6763
|
-
|
|
6910
|
+
logger23.warn("Could not find createApp in main file");
|
|
6764
6911
|
return content;
|
|
6765
6912
|
}
|
|
6766
6913
|
const importRegex = /(import\s+.*?from\s+['"].*?['"];?\s*\n)/g;
|
|
@@ -6782,7 +6929,7 @@ app.use(pinia)`
|
|
|
6782
6929
|
|
|
6783
6930
|
// src/plugins/state/redux-toolkit.ts
|
|
6784
6931
|
import { resolve as resolve15, join as join22 } from "path";
|
|
6785
|
-
var
|
|
6932
|
+
var logger24 = getModuleLogger();
|
|
6786
6933
|
var reduxToolkitPlugin = {
|
|
6787
6934
|
name: "@reduxjs/toolkit",
|
|
6788
6935
|
displayName: "Redux Toolkit",
|
|
@@ -6802,7 +6949,7 @@ var reduxToolkitPlugin = {
|
|
|
6802
6949
|
*/
|
|
6803
6950
|
async install(ctx) {
|
|
6804
6951
|
if (this.detect?.(ctx)) {
|
|
6805
|
-
|
|
6952
|
+
logger24.info("Redux Toolkit is already installed");
|
|
6806
6953
|
return {
|
|
6807
6954
|
packages: {},
|
|
6808
6955
|
success: true,
|
|
@@ -6821,7 +6968,7 @@ var reduxToolkitPlugin = {
|
|
|
6821
6968
|
exact: false,
|
|
6822
6969
|
silent: false
|
|
6823
6970
|
});
|
|
6824
|
-
|
|
6971
|
+
logger24.info("Successfully installed Redux Toolkit");
|
|
6825
6972
|
return {
|
|
6826
6973
|
packages: {
|
|
6827
6974
|
dependencies: packages
|
|
@@ -6830,7 +6977,7 @@ var reduxToolkitPlugin = {
|
|
|
6830
6977
|
message: `Installed ${packages.join(", ")}`
|
|
6831
6978
|
};
|
|
6832
6979
|
} catch (error) {
|
|
6833
|
-
|
|
6980
|
+
logger24.error("Failed to install Redux Toolkit:", error);
|
|
6834
6981
|
return {
|
|
6835
6982
|
packages: {},
|
|
6836
6983
|
success: false,
|
|
@@ -6869,7 +7016,7 @@ var reduxToolkitPlugin = {
|
|
|
6869
7016
|
content: sliceContent,
|
|
6870
7017
|
backup: false
|
|
6871
7018
|
});
|
|
6872
|
-
|
|
7019
|
+
logger24.info(`Created counter slice: ${slicePath}`);
|
|
6873
7020
|
const storePath = join22(storeDir, `index.${extension}`);
|
|
6874
7021
|
const storeContent = ctx.typescript ? getStoreContentTS() : getStoreContentJS();
|
|
6875
7022
|
await writer.createFile(storePath, storeContent);
|
|
@@ -6879,7 +7026,7 @@ var reduxToolkitPlugin = {
|
|
|
6879
7026
|
content: storeContent,
|
|
6880
7027
|
backup: false
|
|
6881
7028
|
});
|
|
6882
|
-
|
|
7029
|
+
logger24.info(`Created Redux store: ${storePath}`);
|
|
6883
7030
|
if (ctx.typescript) {
|
|
6884
7031
|
const hooksPath = join22(storeDir, "hooks.ts");
|
|
6885
7032
|
const hooksContent = getTypedHooksContentTS();
|
|
@@ -6890,7 +7037,7 @@ var reduxToolkitPlugin = {
|
|
|
6890
7037
|
content: hooksContent,
|
|
6891
7038
|
backup: false
|
|
6892
7039
|
});
|
|
6893
|
-
|
|
7040
|
+
logger24.info(`Created typed hooks: ${hooksPath}`);
|
|
6894
7041
|
}
|
|
6895
7042
|
const appPath = join22(srcDir, `App.${ctx.typescript ? "tsx" : "jsx"}`);
|
|
6896
7043
|
const appExists = await checkPathExists(appPath, ctx.fsAdapter);
|
|
@@ -6908,7 +7055,7 @@ var reduxToolkitPlugin = {
|
|
|
6908
7055
|
content: modifiedAppContent,
|
|
6909
7056
|
backup: true
|
|
6910
7057
|
});
|
|
6911
|
-
|
|
7058
|
+
logger24.info(
|
|
6912
7059
|
`Updated App.${ctx.typescript ? "tsx" : "jsx"} with Provider`
|
|
6913
7060
|
);
|
|
6914
7061
|
} else {
|
|
@@ -6920,7 +7067,7 @@ var reduxToolkitPlugin = {
|
|
|
6920
7067
|
content: appContent,
|
|
6921
7068
|
backup: false
|
|
6922
7069
|
});
|
|
6923
|
-
|
|
7070
|
+
logger24.info(
|
|
6924
7071
|
`Created App.${ctx.typescript ? "tsx" : "jsx"} with Provider`
|
|
6925
7072
|
);
|
|
6926
7073
|
}
|
|
@@ -6930,7 +7077,7 @@ var reduxToolkitPlugin = {
|
|
|
6930
7077
|
message: "Redux Toolkit configured successfully"
|
|
6931
7078
|
};
|
|
6932
7079
|
} catch (error) {
|
|
6933
|
-
|
|
7080
|
+
logger24.error("Failed to configure Redux Toolkit:", error);
|
|
6934
7081
|
return {
|
|
6935
7082
|
files,
|
|
6936
7083
|
success: false,
|
|
@@ -6945,9 +7092,9 @@ var reduxToolkitPlugin = {
|
|
|
6945
7092
|
const backupManager = getRollbackManager(_ctx);
|
|
6946
7093
|
try {
|
|
6947
7094
|
await backupManager.restoreAll();
|
|
6948
|
-
|
|
7095
|
+
logger24.info("Redux Toolkit configuration rolled back");
|
|
6949
7096
|
} catch (error) {
|
|
6950
|
-
|
|
7097
|
+
logger24.error("Failed to rollback Redux Toolkit configuration:", error);
|
|
6951
7098
|
throw error;
|
|
6952
7099
|
}
|
|
6953
7100
|
}
|
|
@@ -7157,7 +7304,7 @@ export default App
|
|
|
7157
7304
|
}
|
|
7158
7305
|
function injectProvider2(content, isTypeScript) {
|
|
7159
7306
|
if (content.includes("<Provider")) {
|
|
7160
|
-
|
|
7307
|
+
logger24.warn("Provider already present in App file");
|
|
7161
7308
|
return content;
|
|
7162
7309
|
}
|
|
7163
7310
|
const hasReactReduxImport = content.includes("from 'react-redux'") || content.includes('from "react-redux"');
|
|
@@ -7252,7 +7399,7 @@ export default App
|
|
|
7252
7399
|
|
|
7253
7400
|
// src/plugins/state/zustand.ts
|
|
7254
7401
|
import { resolve as resolve16, join as join23 } from "path";
|
|
7255
|
-
var
|
|
7402
|
+
var logger25 = getModuleLogger();
|
|
7256
7403
|
var zustandPlugin = {
|
|
7257
7404
|
name: "zustand",
|
|
7258
7405
|
displayName: "Zustand",
|
|
@@ -7272,7 +7419,7 @@ var zustandPlugin = {
|
|
|
7272
7419
|
*/
|
|
7273
7420
|
async install(ctx) {
|
|
7274
7421
|
if (this.detect?.(ctx)) {
|
|
7275
|
-
|
|
7422
|
+
logger25.info("Zustand is already installed");
|
|
7276
7423
|
return {
|
|
7277
7424
|
packages: {},
|
|
7278
7425
|
success: true,
|
|
@@ -7288,7 +7435,7 @@ var zustandPlugin = {
|
|
|
7288
7435
|
exact: false,
|
|
7289
7436
|
silent: false
|
|
7290
7437
|
});
|
|
7291
|
-
|
|
7438
|
+
logger25.info("Successfully installed Zustand");
|
|
7292
7439
|
return {
|
|
7293
7440
|
packages: {
|
|
7294
7441
|
dependencies: packages
|
|
@@ -7297,7 +7444,7 @@ var zustandPlugin = {
|
|
|
7297
7444
|
message: `Installed ${packages.join(", ")}`
|
|
7298
7445
|
};
|
|
7299
7446
|
} catch (error) {
|
|
7300
|
-
|
|
7447
|
+
logger25.error("Failed to install Zustand:", error);
|
|
7301
7448
|
return {
|
|
7302
7449
|
packages: {},
|
|
7303
7450
|
success: false,
|
|
@@ -7331,7 +7478,7 @@ var zustandPlugin = {
|
|
|
7331
7478
|
content: storeContent,
|
|
7332
7479
|
backup: false
|
|
7333
7480
|
});
|
|
7334
|
-
|
|
7481
|
+
logger25.info(`Created Zustand store: ${storePath}`);
|
|
7335
7482
|
if (ctx.typescript) {
|
|
7336
7483
|
const hookPath = join23(storeDir, "useStore.ts");
|
|
7337
7484
|
const hookContent = getTypedHookContentTS();
|
|
@@ -7342,7 +7489,7 @@ var zustandPlugin = {
|
|
|
7342
7489
|
content: hookContent,
|
|
7343
7490
|
backup: false
|
|
7344
7491
|
});
|
|
7345
|
-
|
|
7492
|
+
logger25.info(`Created typed hook example: ${hookPath}`);
|
|
7346
7493
|
}
|
|
7347
7494
|
return {
|
|
7348
7495
|
files,
|
|
@@ -7350,7 +7497,7 @@ var zustandPlugin = {
|
|
|
7350
7497
|
message: "Zustand configured successfully"
|
|
7351
7498
|
};
|
|
7352
7499
|
} catch (error) {
|
|
7353
|
-
|
|
7500
|
+
logger25.error("Failed to configure Zustand:", error);
|
|
7354
7501
|
return {
|
|
7355
7502
|
files,
|
|
7356
7503
|
success: false,
|
|
@@ -7365,9 +7512,9 @@ var zustandPlugin = {
|
|
|
7365
7512
|
const backupManager = getRollbackManager(_ctx);
|
|
7366
7513
|
try {
|
|
7367
7514
|
await backupManager.restoreAll();
|
|
7368
|
-
|
|
7515
|
+
logger25.info("Zustand configuration rolled back");
|
|
7369
7516
|
} catch (error) {
|
|
7370
|
-
|
|
7517
|
+
logger25.error("Failed to rollback Zustand configuration:", error);
|
|
7371
7518
|
throw error;
|
|
7372
7519
|
}
|
|
7373
7520
|
}
|
|
@@ -7462,7 +7609,7 @@ export const useRemoveAllBears = () =>
|
|
|
7462
7609
|
|
|
7463
7610
|
// src/plugins/testing/react-testing-library.ts
|
|
7464
7611
|
import { join as join24 } from "path";
|
|
7465
|
-
var
|
|
7612
|
+
var logger26 = getModuleLogger();
|
|
7466
7613
|
var reactTestingLibraryPlugin = {
|
|
7467
7614
|
name: "react-testing-library",
|
|
7468
7615
|
displayName: "React Testing Library",
|
|
@@ -7481,7 +7628,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7481
7628
|
*/
|
|
7482
7629
|
async install(ctx) {
|
|
7483
7630
|
if (this.detect?.(ctx)) {
|
|
7484
|
-
|
|
7631
|
+
logger26.info("React Testing Library is already installed");
|
|
7485
7632
|
return {
|
|
7486
7633
|
packages: {},
|
|
7487
7634
|
success: true,
|
|
@@ -7501,7 +7648,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7501
7648
|
exact: false,
|
|
7502
7649
|
silent: false
|
|
7503
7650
|
});
|
|
7504
|
-
|
|
7651
|
+
logger26.info("Successfully installed React Testing Library");
|
|
7505
7652
|
return {
|
|
7506
7653
|
packages: {
|
|
7507
7654
|
devDependencies: packages
|
|
@@ -7510,7 +7657,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7510
7657
|
message: `Installed React Testing Library: ${packages.join(", ")}`
|
|
7511
7658
|
};
|
|
7512
7659
|
} catch (error) {
|
|
7513
|
-
|
|
7660
|
+
logger26.error("Failed to install React Testing Library:", error);
|
|
7514
7661
|
return {
|
|
7515
7662
|
packages: {},
|
|
7516
7663
|
success: false,
|
|
@@ -7551,7 +7698,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7551
7698
|
content: setupTestsContent,
|
|
7552
7699
|
backup: false
|
|
7553
7700
|
});
|
|
7554
|
-
|
|
7701
|
+
logger26.info(`Created setupTests file: ${setupTestsPath}`);
|
|
7555
7702
|
}
|
|
7556
7703
|
const testDir = join24(srcDir, "components", "__tests__");
|
|
7557
7704
|
await ensureDirectory(testDir, ctx.fsAdapter);
|
|
@@ -7572,7 +7719,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7572
7719
|
content: exampleTestContent,
|
|
7573
7720
|
backup: false
|
|
7574
7721
|
});
|
|
7575
|
-
|
|
7722
|
+
logger26.info(`Created example test: ${exampleTestPath}`);
|
|
7576
7723
|
}
|
|
7577
7724
|
const vitestConfigPath = join24(projectRoot, "vitest.config.ts");
|
|
7578
7725
|
const vitestConfigExists = await checkPathExists(
|
|
@@ -7580,7 +7727,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7580
7727
|
ctx.fsAdapter
|
|
7581
7728
|
);
|
|
7582
7729
|
if (vitestConfigExists) {
|
|
7583
|
-
|
|
7730
|
+
logger26.info(
|
|
7584
7731
|
"vitest.config.ts found. Make sure to add setupFiles if needed."
|
|
7585
7732
|
);
|
|
7586
7733
|
}
|
|
@@ -7590,7 +7737,7 @@ var reactTestingLibraryPlugin = {
|
|
|
7590
7737
|
message: "React Testing Library configured successfully"
|
|
7591
7738
|
};
|
|
7592
7739
|
} catch (error) {
|
|
7593
|
-
|
|
7740
|
+
logger26.error("Failed to configure React Testing Library:", error);
|
|
7594
7741
|
await backupManager.restoreAll();
|
|
7595
7742
|
return {
|
|
7596
7743
|
files,
|
|
@@ -7606,9 +7753,9 @@ var reactTestingLibraryPlugin = {
|
|
|
7606
7753
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
7607
7754
|
try {
|
|
7608
7755
|
await backupManager.restoreAll();
|
|
7609
|
-
|
|
7756
|
+
logger26.info("React Testing Library configuration rolled back");
|
|
7610
7757
|
} catch (error) {
|
|
7611
|
-
|
|
7758
|
+
logger26.error(
|
|
7612
7759
|
"Failed to rollback React Testing Library configuration:",
|
|
7613
7760
|
error
|
|
7614
7761
|
);
|
|
@@ -7697,7 +7844,7 @@ describe('Example Component', () => {
|
|
|
7697
7844
|
|
|
7698
7845
|
// src/plugins/testing/vue-testing-library.ts
|
|
7699
7846
|
import { join as join25 } from "path";
|
|
7700
|
-
var
|
|
7847
|
+
var logger27 = getModuleLogger();
|
|
7701
7848
|
var vueTestingLibraryPlugin = {
|
|
7702
7849
|
name: "@testing-library/vue",
|
|
7703
7850
|
displayName: "Testing Library (Vue)",
|
|
@@ -7716,7 +7863,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7716
7863
|
*/
|
|
7717
7864
|
async install(ctx) {
|
|
7718
7865
|
if (this.detect?.(ctx)) {
|
|
7719
|
-
|
|
7866
|
+
logger27.info("Testing Library (Vue) is already installed");
|
|
7720
7867
|
return {
|
|
7721
7868
|
packages: {},
|
|
7722
7869
|
success: true,
|
|
@@ -7736,7 +7883,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7736
7883
|
exact: false,
|
|
7737
7884
|
silent: false
|
|
7738
7885
|
});
|
|
7739
|
-
|
|
7886
|
+
logger27.info("Successfully installed Testing Library (Vue)");
|
|
7740
7887
|
return {
|
|
7741
7888
|
packages: {
|
|
7742
7889
|
devDependencies: packages
|
|
@@ -7745,7 +7892,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7745
7892
|
message: `Installed Testing Library (Vue): ${packages.join(", ")}`
|
|
7746
7893
|
};
|
|
7747
7894
|
} catch (error) {
|
|
7748
|
-
|
|
7895
|
+
logger27.error("Failed to install Testing Library (Vue):", error);
|
|
7749
7896
|
return {
|
|
7750
7897
|
packages: {},
|
|
7751
7898
|
success: false,
|
|
@@ -7780,7 +7927,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7780
7927
|
content: setupContent,
|
|
7781
7928
|
backup: false
|
|
7782
7929
|
});
|
|
7783
|
-
|
|
7930
|
+
logger27.info(`Created test setup: ${setupPath}`);
|
|
7784
7931
|
}
|
|
7785
7932
|
const testDir = join25(srcDir, "components", "__tests__");
|
|
7786
7933
|
await ensureDirectory(testDir, ctx.fsAdapter);
|
|
@@ -7798,7 +7945,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7798
7945
|
content: testContent,
|
|
7799
7946
|
backup: false
|
|
7800
7947
|
});
|
|
7801
|
-
|
|
7948
|
+
logger27.info(`Created example test: ${testPath}`);
|
|
7802
7949
|
}
|
|
7803
7950
|
const vitestConfigPath = join25(projectRoot, "vitest.config.ts");
|
|
7804
7951
|
const vitestConfigExists = await checkPathExists(
|
|
@@ -7806,7 +7953,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7806
7953
|
ctx.fsAdapter
|
|
7807
7954
|
);
|
|
7808
7955
|
if (vitestConfigExists) {
|
|
7809
|
-
|
|
7956
|
+
logger27.info(
|
|
7810
7957
|
"vitest.config.ts found. Make sure to add setupFiles if needed."
|
|
7811
7958
|
);
|
|
7812
7959
|
}
|
|
@@ -7816,7 +7963,7 @@ var vueTestingLibraryPlugin = {
|
|
|
7816
7963
|
message: "Testing Library (Vue) configured successfully"
|
|
7817
7964
|
};
|
|
7818
7965
|
} catch (error) {
|
|
7819
|
-
|
|
7966
|
+
logger27.error("Failed to configure Testing Library (Vue):", error);
|
|
7820
7967
|
await backupManager.restoreAll();
|
|
7821
7968
|
return {
|
|
7822
7969
|
files,
|
|
@@ -7832,9 +7979,9 @@ var vueTestingLibraryPlugin = {
|
|
|
7832
7979
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
7833
7980
|
try {
|
|
7834
7981
|
await backupManager.restoreAll();
|
|
7835
|
-
|
|
7982
|
+
logger27.info("Testing Library (Vue) configuration rolled back");
|
|
7836
7983
|
} catch (error) {
|
|
7837
|
-
|
|
7984
|
+
logger27.error("Failed to rollback Testing Library (Vue):", error);
|
|
7838
7985
|
throw error;
|
|
7839
7986
|
}
|
|
7840
7987
|
}
|
|
@@ -7880,7 +8027,7 @@ describe('Example component', () => {
|
|
|
7880
8027
|
|
|
7881
8028
|
// src/plugins/testing/vue-test-utils.ts
|
|
7882
8029
|
import { join as join26 } from "path";
|
|
7883
|
-
var
|
|
8030
|
+
var logger28 = getModuleLogger();
|
|
7884
8031
|
var vueTestUtilsPlugin = {
|
|
7885
8032
|
name: "@vue/test-utils",
|
|
7886
8033
|
displayName: "Vue Test Utils",
|
|
@@ -7899,7 +8046,7 @@ var vueTestUtilsPlugin = {
|
|
|
7899
8046
|
*/
|
|
7900
8047
|
async install(ctx) {
|
|
7901
8048
|
if (this.detect?.(ctx)) {
|
|
7902
|
-
|
|
8049
|
+
logger28.info("Vue Test Utils is already installed");
|
|
7903
8050
|
return {
|
|
7904
8051
|
packages: {},
|
|
7905
8052
|
success: true,
|
|
@@ -7923,7 +8070,7 @@ var vueTestUtilsPlugin = {
|
|
|
7923
8070
|
exact: false,
|
|
7924
8071
|
silent: false
|
|
7925
8072
|
});
|
|
7926
|
-
|
|
8073
|
+
logger28.info("Successfully installed Vue Test Utils");
|
|
7927
8074
|
return {
|
|
7928
8075
|
packages: {
|
|
7929
8076
|
devDependencies: packages
|
|
@@ -7932,7 +8079,7 @@ var vueTestUtilsPlugin = {
|
|
|
7932
8079
|
message: `Installed ${packages.join(", ")}`
|
|
7933
8080
|
};
|
|
7934
8081
|
} catch (error) {
|
|
7935
|
-
|
|
8082
|
+
logger28.error("Failed to install Vue Test Utils:", error);
|
|
7936
8083
|
return {
|
|
7937
8084
|
packages: {},
|
|
7938
8085
|
success: false,
|
|
@@ -7964,7 +8111,7 @@ var vueTestUtilsPlugin = {
|
|
|
7964
8111
|
content: vitestConfigContent,
|
|
7965
8112
|
backup: false
|
|
7966
8113
|
});
|
|
7967
|
-
|
|
8114
|
+
logger28.info(`Created Vitest config: ${vitestConfigPath}`);
|
|
7968
8115
|
const testsDir = join26(
|
|
7969
8116
|
ctx.projectRoot,
|
|
7970
8117
|
ctx.srcDir,
|
|
@@ -7981,7 +8128,7 @@ var vueTestUtilsPlugin = {
|
|
|
7981
8128
|
content: testContent,
|
|
7982
8129
|
backup: false
|
|
7983
8130
|
});
|
|
7984
|
-
|
|
8131
|
+
logger28.info(`Created example test: ${testFilePath}`);
|
|
7985
8132
|
const packageJsonPath = join26(ctx.projectRoot, "package.json");
|
|
7986
8133
|
await writer.modifyPackageJson(ctx.projectRoot, (pkg) => {
|
|
7987
8134
|
pkg.scripts = pkg.scripts || {};
|
|
@@ -7995,14 +8142,14 @@ var vueTestUtilsPlugin = {
|
|
|
7995
8142
|
path: normalizePath(packageJsonPath),
|
|
7996
8143
|
backup: true
|
|
7997
8144
|
});
|
|
7998
|
-
|
|
8145
|
+
logger28.info("Updated package.json with test scripts");
|
|
7999
8146
|
return {
|
|
8000
8147
|
files,
|
|
8001
8148
|
success: true,
|
|
8002
8149
|
message: "Vue Test Utils configured successfully"
|
|
8003
8150
|
};
|
|
8004
8151
|
} catch (error) {
|
|
8005
|
-
|
|
8152
|
+
logger28.error("Failed to configure Vue Test Utils:", error);
|
|
8006
8153
|
return {
|
|
8007
8154
|
files,
|
|
8008
8155
|
success: false,
|
|
@@ -8016,7 +8163,7 @@ var vueTestUtilsPlugin = {
|
|
|
8016
8163
|
async rollback(_ctx) {
|
|
8017
8164
|
const backupManager = getRollbackManager(_ctx);
|
|
8018
8165
|
await backupManager.restoreAll();
|
|
8019
|
-
|
|
8166
|
+
logger28.info("Vue Test Utils configuration rolled back");
|
|
8020
8167
|
}
|
|
8021
8168
|
};
|
|
8022
8169
|
function getVitestConfig(typescript) {
|
|
@@ -8196,9 +8343,82 @@ describe('HelloWorld', () => {
|
|
|
8196
8343
|
`;
|
|
8197
8344
|
}
|
|
8198
8345
|
|
|
8346
|
+
// src/plugins/testing/svelte-testing-library.ts
|
|
8347
|
+
var logger29 = getModuleLogger();
|
|
8348
|
+
var svelteTestingLibraryPlugin = {
|
|
8349
|
+
name: "@testing-library/svelte",
|
|
8350
|
+
displayName: "Svelte Testing Library",
|
|
8351
|
+
description: "Biblioth\xE8que de test pour composants Svelte",
|
|
8352
|
+
category: "testing" /* TESTING */,
|
|
8353
|
+
version: "^4.2.0",
|
|
8354
|
+
frameworks: ["svelte"],
|
|
8355
|
+
requires: ["vitest"],
|
|
8356
|
+
detect: (ctx) => {
|
|
8357
|
+
return ctx.devDependencies["@testing-library/svelte"] !== void 0;
|
|
8358
|
+
},
|
|
8359
|
+
async install(ctx) {
|
|
8360
|
+
if (this.detect?.(ctx)) {
|
|
8361
|
+
logger29.info("Svelte Testing Library is already installed");
|
|
8362
|
+
return {
|
|
8363
|
+
packages: {},
|
|
8364
|
+
success: true,
|
|
8365
|
+
message: "Svelte Testing Library already installed"
|
|
8366
|
+
};
|
|
8367
|
+
}
|
|
8368
|
+
try {
|
|
8369
|
+
const packages = [
|
|
8370
|
+
"@testing-library/svelte",
|
|
8371
|
+
"@testing-library/dom",
|
|
8372
|
+
"@testing-library/user-event",
|
|
8373
|
+
"@vitest/ui"
|
|
8374
|
+
];
|
|
8375
|
+
await installPackages(packages, {
|
|
8376
|
+
dev: true,
|
|
8377
|
+
packageManager: ctx.packageManager,
|
|
8378
|
+
projectRoot: ctx.projectRoot,
|
|
8379
|
+
exact: false,
|
|
8380
|
+
silent: false
|
|
8381
|
+
});
|
|
8382
|
+
logger29.info(`Installed ${packages.length} package(s)`);
|
|
8383
|
+
return {
|
|
8384
|
+
packages: {
|
|
8385
|
+
devDependencies: packages
|
|
8386
|
+
},
|
|
8387
|
+
success: true,
|
|
8388
|
+
message: "Svelte Testing Library installed successfully"
|
|
8389
|
+
};
|
|
8390
|
+
} catch (error) {
|
|
8391
|
+
logger29.error(`Failed to install Svelte Testing Library: ${String(error)}`);
|
|
8392
|
+
return {
|
|
8393
|
+
packages: {},
|
|
8394
|
+
success: false,
|
|
8395
|
+
message: `Installation failed: ${String(error)}`
|
|
8396
|
+
};
|
|
8397
|
+
}
|
|
8398
|
+
},
|
|
8399
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
8400
|
+
async configure(_ctx) {
|
|
8401
|
+
try {
|
|
8402
|
+
logger29.info("Svelte Testing Library is configured to work with Vitest");
|
|
8403
|
+
return {
|
|
8404
|
+
success: true,
|
|
8405
|
+
message: "Svelte Testing Library configured successfully",
|
|
8406
|
+
files: []
|
|
8407
|
+
};
|
|
8408
|
+
} catch (error) {
|
|
8409
|
+
logger29.error(`Configuration failed: ${String(error)}`);
|
|
8410
|
+
return {
|
|
8411
|
+
success: false,
|
|
8412
|
+
message: `Configuration failed: ${String(error)}`,
|
|
8413
|
+
files: []
|
|
8414
|
+
};
|
|
8415
|
+
}
|
|
8416
|
+
}
|
|
8417
|
+
};
|
|
8418
|
+
|
|
8199
8419
|
// src/plugins/tooling/eslint.ts
|
|
8200
8420
|
import { join as join27 } from "path";
|
|
8201
|
-
var
|
|
8421
|
+
var logger30 = getModuleLogger();
|
|
8202
8422
|
var eslintPlugin = {
|
|
8203
8423
|
name: "eslint",
|
|
8204
8424
|
displayName: "ESLint",
|
|
@@ -8217,7 +8437,7 @@ var eslintPlugin = {
|
|
|
8217
8437
|
*/
|
|
8218
8438
|
async install(ctx) {
|
|
8219
8439
|
if (this.detect?.(ctx)) {
|
|
8220
|
-
|
|
8440
|
+
logger30.info("ESLint is already installed");
|
|
8221
8441
|
return {
|
|
8222
8442
|
packages: {},
|
|
8223
8443
|
success: true,
|
|
@@ -8243,7 +8463,7 @@ var eslintPlugin = {
|
|
|
8243
8463
|
exact: false,
|
|
8244
8464
|
silent: false
|
|
8245
8465
|
});
|
|
8246
|
-
|
|
8466
|
+
logger30.info("Successfully installed ESLint");
|
|
8247
8467
|
return {
|
|
8248
8468
|
packages: {
|
|
8249
8469
|
devDependencies: packages
|
|
@@ -8252,7 +8472,7 @@ var eslintPlugin = {
|
|
|
8252
8472
|
message: `Installed ${packages.join(", ")}`
|
|
8253
8473
|
};
|
|
8254
8474
|
} catch (error) {
|
|
8255
|
-
|
|
8475
|
+
logger30.error("Failed to install ESLint:", error);
|
|
8256
8476
|
return {
|
|
8257
8477
|
packages: {},
|
|
8258
8478
|
success: false,
|
|
@@ -8280,7 +8500,7 @@ var eslintPlugin = {
|
|
|
8280
8500
|
ctx.fsAdapter
|
|
8281
8501
|
);
|
|
8282
8502
|
if (eslintConfigExists) {
|
|
8283
|
-
|
|
8503
|
+
logger30.warn("eslint.config.js already exists, skipping creation");
|
|
8284
8504
|
} else {
|
|
8285
8505
|
const eslintConfigContent = getESLintConfigContent(ctx);
|
|
8286
8506
|
await writer.createFile(eslintConfigPath, eslintConfigContent);
|
|
@@ -8290,7 +8510,7 @@ var eslintPlugin = {
|
|
|
8290
8510
|
content: eslintConfigContent,
|
|
8291
8511
|
backup: false
|
|
8292
8512
|
});
|
|
8293
|
-
|
|
8513
|
+
logger30.info(`Created ESLint config: ${eslintConfigPath}`);
|
|
8294
8514
|
}
|
|
8295
8515
|
const packageJsonPath = join27(projectRoot, "package.json");
|
|
8296
8516
|
const packageJsonExists = await checkPathExists(
|
|
@@ -8329,7 +8549,7 @@ var eslintPlugin = {
|
|
|
8329
8549
|
content: updatedContent,
|
|
8330
8550
|
backup: true
|
|
8331
8551
|
});
|
|
8332
|
-
|
|
8552
|
+
logger30.info("Updated package.json with ESLint scripts");
|
|
8333
8553
|
}
|
|
8334
8554
|
}
|
|
8335
8555
|
return {
|
|
@@ -8338,7 +8558,7 @@ var eslintPlugin = {
|
|
|
8338
8558
|
message: "ESLint configured successfully"
|
|
8339
8559
|
};
|
|
8340
8560
|
} catch (error) {
|
|
8341
|
-
|
|
8561
|
+
logger30.error("Failed to configure ESLint:", error);
|
|
8342
8562
|
await backupManager.restoreAll();
|
|
8343
8563
|
return {
|
|
8344
8564
|
files,
|
|
@@ -8354,9 +8574,9 @@ var eslintPlugin = {
|
|
|
8354
8574
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
8355
8575
|
try {
|
|
8356
8576
|
await backupManager.restoreAll();
|
|
8357
|
-
|
|
8577
|
+
logger30.info("ESLint configuration rolled back");
|
|
8358
8578
|
} catch (error) {
|
|
8359
|
-
|
|
8579
|
+
logger30.error("Failed to rollback ESLint configuration:", error);
|
|
8360
8580
|
throw error;
|
|
8361
8581
|
}
|
|
8362
8582
|
}
|
|
@@ -8459,7 +8679,7 @@ export default [
|
|
|
8459
8679
|
|
|
8460
8680
|
// src/plugins/tooling/eslint-vue.ts
|
|
8461
8681
|
import { join as join28 } from "path";
|
|
8462
|
-
var
|
|
8682
|
+
var logger31 = getModuleLogger();
|
|
8463
8683
|
var eslintVuePlugin = {
|
|
8464
8684
|
name: "eslint-plugin-vue",
|
|
8465
8685
|
displayName: "ESLint Vue",
|
|
@@ -8478,7 +8698,7 @@ var eslintVuePlugin = {
|
|
|
8478
8698
|
*/
|
|
8479
8699
|
async install(ctx) {
|
|
8480
8700
|
if (this.detect?.(ctx)) {
|
|
8481
|
-
|
|
8701
|
+
logger31.info("ESLint Vue is already installed");
|
|
8482
8702
|
return {
|
|
8483
8703
|
packages: {},
|
|
8484
8704
|
success: true,
|
|
@@ -8501,7 +8721,7 @@ var eslintVuePlugin = {
|
|
|
8501
8721
|
exact: false,
|
|
8502
8722
|
silent: false
|
|
8503
8723
|
});
|
|
8504
|
-
|
|
8724
|
+
logger31.info("Successfully installed ESLint Vue");
|
|
8505
8725
|
return {
|
|
8506
8726
|
packages: {
|
|
8507
8727
|
devDependencies: packages
|
|
@@ -8510,7 +8730,7 @@ var eslintVuePlugin = {
|
|
|
8510
8730
|
message: `Installed ${packages.join(", ")}`
|
|
8511
8731
|
};
|
|
8512
8732
|
} catch (error) {
|
|
8513
|
-
|
|
8733
|
+
logger31.error("Failed to install ESLint Vue:", error);
|
|
8514
8734
|
return {
|
|
8515
8735
|
packages: {},
|
|
8516
8736
|
success: false,
|
|
@@ -8552,7 +8772,7 @@ var eslintVuePlugin = {
|
|
|
8552
8772
|
content: updatedContent,
|
|
8553
8773
|
backup: true
|
|
8554
8774
|
});
|
|
8555
|
-
|
|
8775
|
+
logger31.info(`Updated ESLint config: ${eslintConfigPath}`);
|
|
8556
8776
|
}
|
|
8557
8777
|
} else {
|
|
8558
8778
|
const eslintConfigContent = getESLintVueConfigContent(ctx);
|
|
@@ -8563,7 +8783,7 @@ var eslintVuePlugin = {
|
|
|
8563
8783
|
content: eslintConfigContent,
|
|
8564
8784
|
backup: false
|
|
8565
8785
|
});
|
|
8566
|
-
|
|
8786
|
+
logger31.info(`Created ESLint Vue config: ${eslintConfigPath}`);
|
|
8567
8787
|
}
|
|
8568
8788
|
return {
|
|
8569
8789
|
files,
|
|
@@ -8571,7 +8791,7 @@ var eslintVuePlugin = {
|
|
|
8571
8791
|
message: "ESLint Vue configured successfully"
|
|
8572
8792
|
};
|
|
8573
8793
|
} catch (error) {
|
|
8574
|
-
|
|
8794
|
+
logger31.error("Failed to configure ESLint Vue:", error);
|
|
8575
8795
|
return {
|
|
8576
8796
|
files,
|
|
8577
8797
|
success: false,
|
|
@@ -8585,7 +8805,7 @@ var eslintVuePlugin = {
|
|
|
8585
8805
|
async rollback(_ctx) {
|
|
8586
8806
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
8587
8807
|
await backupManager.restoreAll();
|
|
8588
|
-
|
|
8808
|
+
logger31.info("ESLint Vue configuration rolled back");
|
|
8589
8809
|
}
|
|
8590
8810
|
};
|
|
8591
8811
|
function getESLintVueConfigContent(ctx) {
|
|
@@ -8673,7 +8893,7 @@ function updateESLintConfig(existingContent, ctx) {
|
|
|
8673
8893
|
// src/plugins/tooling/husky.ts
|
|
8674
8894
|
import { join as join29 } from "path";
|
|
8675
8895
|
import { execa } from "execa";
|
|
8676
|
-
var
|
|
8896
|
+
var logger32 = getModuleLogger();
|
|
8677
8897
|
var huskyPlugin = {
|
|
8678
8898
|
name: "husky",
|
|
8679
8899
|
displayName: "Husky",
|
|
@@ -8692,7 +8912,7 @@ var huskyPlugin = {
|
|
|
8692
8912
|
*/
|
|
8693
8913
|
async install(ctx) {
|
|
8694
8914
|
if (this.detect?.(ctx)) {
|
|
8695
|
-
|
|
8915
|
+
logger32.info("Husky is already installed");
|
|
8696
8916
|
return {
|
|
8697
8917
|
packages: {},
|
|
8698
8918
|
success: true,
|
|
@@ -8707,7 +8927,7 @@ var huskyPlugin = {
|
|
|
8707
8927
|
exact: false,
|
|
8708
8928
|
silent: false
|
|
8709
8929
|
});
|
|
8710
|
-
|
|
8930
|
+
logger32.info("Successfully installed Husky");
|
|
8711
8931
|
return {
|
|
8712
8932
|
packages: {
|
|
8713
8933
|
devDependencies: ["husky"]
|
|
@@ -8716,7 +8936,7 @@ var huskyPlugin = {
|
|
|
8716
8936
|
message: "Installed husky"
|
|
8717
8937
|
};
|
|
8718
8938
|
} catch (error) {
|
|
8719
|
-
|
|
8939
|
+
logger32.error("Failed to install Husky:", error);
|
|
8720
8940
|
return {
|
|
8721
8941
|
packages: {},
|
|
8722
8942
|
success: false,
|
|
@@ -8743,7 +8963,7 @@ var huskyPlugin = {
|
|
|
8743
8963
|
const gitDir = join29(projectRoot, ".git");
|
|
8744
8964
|
const gitExists = await checkPathExists(gitDir, ctx.fsAdapter);
|
|
8745
8965
|
if (!gitExists) {
|
|
8746
|
-
|
|
8966
|
+
logger32.warn(
|
|
8747
8967
|
".git directory not found. Husky hooks will be skipped. Initialize Git and run npm run prepare to set up Husky."
|
|
8748
8968
|
);
|
|
8749
8969
|
return {
|
|
@@ -8768,7 +8988,7 @@ var huskyPlugin = {
|
|
|
8768
8988
|
content: preCommitContent,
|
|
8769
8989
|
backup: false
|
|
8770
8990
|
});
|
|
8771
|
-
|
|
8991
|
+
logger32.info(`Created pre-commit hook: ${preCommitPath}`);
|
|
8772
8992
|
}
|
|
8773
8993
|
const prePushPath = join29(huskyDir, "pre-push");
|
|
8774
8994
|
const prePushExists = await checkPathExists(prePushPath, ctx.fsAdapter);
|
|
@@ -8781,7 +9001,7 @@ var huskyPlugin = {
|
|
|
8781
9001
|
content: prePushContent,
|
|
8782
9002
|
backup: false
|
|
8783
9003
|
});
|
|
8784
|
-
|
|
9004
|
+
logger32.info(`Created pre-push hook: ${prePushPath}`);
|
|
8785
9005
|
}
|
|
8786
9006
|
const packageJsonPath = join29(projectRoot, "package.json");
|
|
8787
9007
|
const packageJsonExists = await checkPathExists(
|
|
@@ -8810,7 +9030,7 @@ var huskyPlugin = {
|
|
|
8810
9030
|
content: updatedContent,
|
|
8811
9031
|
backup: true
|
|
8812
9032
|
});
|
|
8813
|
-
|
|
9033
|
+
logger32.info("Updated package.json with Husky prepare script");
|
|
8814
9034
|
}
|
|
8815
9035
|
}
|
|
8816
9036
|
try {
|
|
@@ -8818,9 +9038,9 @@ var huskyPlugin = {
|
|
|
8818
9038
|
cwd: projectRoot,
|
|
8819
9039
|
stdio: "inherit"
|
|
8820
9040
|
});
|
|
8821
|
-
|
|
9041
|
+
logger32.info("Husky initialized successfully");
|
|
8822
9042
|
} catch {
|
|
8823
|
-
|
|
9043
|
+
logger32.warn(
|
|
8824
9044
|
"Failed to run husky init automatically. You may need to run it manually: npx husky init"
|
|
8825
9045
|
);
|
|
8826
9046
|
}
|
|
@@ -8830,7 +9050,7 @@ var huskyPlugin = {
|
|
|
8830
9050
|
message: "Husky configured successfully"
|
|
8831
9051
|
};
|
|
8832
9052
|
} catch (error) {
|
|
8833
|
-
|
|
9053
|
+
logger32.error("Failed to configure Husky:", error);
|
|
8834
9054
|
await backupManager.restoreAll();
|
|
8835
9055
|
return {
|
|
8836
9056
|
files,
|
|
@@ -8846,9 +9066,9 @@ var huskyPlugin = {
|
|
|
8846
9066
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
8847
9067
|
try {
|
|
8848
9068
|
await backupManager.restoreAll();
|
|
8849
|
-
|
|
9069
|
+
logger32.info("Husky configuration rolled back");
|
|
8850
9070
|
} catch (error) {
|
|
8851
|
-
|
|
9071
|
+
logger32.error("Failed to rollback Husky configuration:", error);
|
|
8852
9072
|
throw error;
|
|
8853
9073
|
}
|
|
8854
9074
|
}
|
|
@@ -8871,7 +9091,7 @@ npm run test:unit
|
|
|
8871
9091
|
|
|
8872
9092
|
// src/plugins/tooling/commitlint.ts
|
|
8873
9093
|
import { join as join30 } from "path";
|
|
8874
|
-
var
|
|
9094
|
+
var logger33 = getModuleLogger();
|
|
8875
9095
|
var commitlintPlugin = {
|
|
8876
9096
|
name: "@commitlint/cli",
|
|
8877
9097
|
displayName: "Commitlint",
|
|
@@ -8890,7 +9110,7 @@ var commitlintPlugin = {
|
|
|
8890
9110
|
*/
|
|
8891
9111
|
async install(ctx) {
|
|
8892
9112
|
if (this.detect?.(ctx)) {
|
|
8893
|
-
|
|
9113
|
+
logger33.info("Commitlint is already installed");
|
|
8894
9114
|
return {
|
|
8895
9115
|
packages: {},
|
|
8896
9116
|
success: true,
|
|
@@ -8909,7 +9129,7 @@ var commitlintPlugin = {
|
|
|
8909
9129
|
exact: false,
|
|
8910
9130
|
silent: false
|
|
8911
9131
|
});
|
|
8912
|
-
|
|
9132
|
+
logger33.info("Successfully installed Commitlint");
|
|
8913
9133
|
return {
|
|
8914
9134
|
packages: {
|
|
8915
9135
|
devDependencies: packages
|
|
@@ -8918,7 +9138,7 @@ var commitlintPlugin = {
|
|
|
8918
9138
|
message: `Installed Commitlint: ${packages.join(", ")}`
|
|
8919
9139
|
};
|
|
8920
9140
|
} catch (error) {
|
|
8921
|
-
|
|
9141
|
+
logger33.error("Failed to install Commitlint:", error);
|
|
8922
9142
|
return {
|
|
8923
9143
|
packages: {},
|
|
8924
9144
|
success: false,
|
|
@@ -8953,7 +9173,7 @@ var commitlintPlugin = {
|
|
|
8953
9173
|
content: configContent,
|
|
8954
9174
|
backup: false
|
|
8955
9175
|
});
|
|
8956
|
-
|
|
9176
|
+
logger33.info(`Created commitlint config: ${configPath}`);
|
|
8957
9177
|
}
|
|
8958
9178
|
await writer.modifyPackageJson(projectRoot, (pkg) => {
|
|
8959
9179
|
pkg.scripts = pkg.scripts || {};
|
|
@@ -8985,7 +9205,7 @@ var commitlintPlugin = {
|
|
|
8985
9205
|
content: commitMsgContent,
|
|
8986
9206
|
backup: false
|
|
8987
9207
|
});
|
|
8988
|
-
|
|
9208
|
+
logger33.info(`Created commit-msg hook: ${commitMsgPath}`);
|
|
8989
9209
|
} else {
|
|
8990
9210
|
const existingContent = await readFileContent(
|
|
8991
9211
|
commitMsgPath,
|
|
@@ -9003,11 +9223,11 @@ var commitlintPlugin = {
|
|
|
9003
9223
|
content: updatedContent,
|
|
9004
9224
|
backup: true
|
|
9005
9225
|
});
|
|
9006
|
-
|
|
9226
|
+
logger33.info(`Updated commit-msg hook: ${commitMsgPath}`);
|
|
9007
9227
|
}
|
|
9008
9228
|
}
|
|
9009
9229
|
} else {
|
|
9010
|
-
|
|
9230
|
+
logger33.warn(
|
|
9011
9231
|
".husky directory not found. Commit-msg hook not created. Install Husky first."
|
|
9012
9232
|
);
|
|
9013
9233
|
}
|
|
@@ -9017,7 +9237,7 @@ var commitlintPlugin = {
|
|
|
9017
9237
|
message: "Commitlint configured successfully"
|
|
9018
9238
|
};
|
|
9019
9239
|
} catch (error) {
|
|
9020
|
-
|
|
9240
|
+
logger33.error("Failed to configure Commitlint:", error);
|
|
9021
9241
|
await backupManager.restoreAll();
|
|
9022
9242
|
return {
|
|
9023
9243
|
files,
|
|
@@ -9033,9 +9253,9 @@ var commitlintPlugin = {
|
|
|
9033
9253
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
9034
9254
|
try {
|
|
9035
9255
|
await backupManager.restoreAll();
|
|
9036
|
-
|
|
9256
|
+
logger33.info("Commitlint configuration rolled back");
|
|
9037
9257
|
} catch (error) {
|
|
9038
|
-
|
|
9258
|
+
logger33.error("Failed to rollback Commitlint configuration:", error);
|
|
9039
9259
|
throw error;
|
|
9040
9260
|
}
|
|
9041
9261
|
}
|
|
@@ -9059,7 +9279,7 @@ ${getCommitMsgCommand()}
|
|
|
9059
9279
|
|
|
9060
9280
|
// src/plugins/tooling/lint-staged.ts
|
|
9061
9281
|
import { join as join31 } from "path";
|
|
9062
|
-
var
|
|
9282
|
+
var logger34 = getModuleLogger();
|
|
9063
9283
|
var lintStagedPlugin = {
|
|
9064
9284
|
name: "lint-staged",
|
|
9065
9285
|
displayName: "lint-staged",
|
|
@@ -9078,7 +9298,7 @@ var lintStagedPlugin = {
|
|
|
9078
9298
|
*/
|
|
9079
9299
|
async install(ctx) {
|
|
9080
9300
|
if (this.detect?.(ctx)) {
|
|
9081
|
-
|
|
9301
|
+
logger34.info("lint-staged is already installed");
|
|
9082
9302
|
return {
|
|
9083
9303
|
packages: {},
|
|
9084
9304
|
success: true,
|
|
@@ -9093,7 +9313,7 @@ var lintStagedPlugin = {
|
|
|
9093
9313
|
exact: false,
|
|
9094
9314
|
silent: false
|
|
9095
9315
|
});
|
|
9096
|
-
|
|
9316
|
+
logger34.info("Successfully installed lint-staged");
|
|
9097
9317
|
return {
|
|
9098
9318
|
packages: {
|
|
9099
9319
|
devDependencies: ["lint-staged"]
|
|
@@ -9102,7 +9322,7 @@ var lintStagedPlugin = {
|
|
|
9102
9322
|
message: "Installed lint-staged"
|
|
9103
9323
|
};
|
|
9104
9324
|
} catch (error) {
|
|
9105
|
-
|
|
9325
|
+
logger34.error("Failed to install lint-staged:", error);
|
|
9106
9326
|
return {
|
|
9107
9327
|
packages: {},
|
|
9108
9328
|
success: false,
|
|
@@ -9135,7 +9355,7 @@ var lintStagedPlugin = {
|
|
|
9135
9355
|
content: configContent,
|
|
9136
9356
|
backup: false
|
|
9137
9357
|
});
|
|
9138
|
-
|
|
9358
|
+
logger34.info(`Created lint-staged config: ${configPath}`);
|
|
9139
9359
|
}
|
|
9140
9360
|
await writer.modifyPackageJson(projectRoot, (pkg) => {
|
|
9141
9361
|
pkg.scripts = pkg.scripts || {};
|
|
@@ -9149,14 +9369,14 @@ var lintStagedPlugin = {
|
|
|
9149
9369
|
path: normalizePath(packageJsonPath),
|
|
9150
9370
|
backup: true
|
|
9151
9371
|
});
|
|
9152
|
-
|
|
9372
|
+
logger34.info("Updated package.json with lint-staged script");
|
|
9153
9373
|
return {
|
|
9154
9374
|
files,
|
|
9155
9375
|
success: true,
|
|
9156
9376
|
message: "lint-staged configured successfully"
|
|
9157
9377
|
};
|
|
9158
9378
|
} catch (error) {
|
|
9159
|
-
|
|
9379
|
+
logger34.error("Failed to configure lint-staged:", error);
|
|
9160
9380
|
await backupManager.restoreAll();
|
|
9161
9381
|
return {
|
|
9162
9382
|
files,
|
|
@@ -9172,9 +9392,9 @@ var lintStagedPlugin = {
|
|
|
9172
9392
|
const backupManager = getRollbackManager(_ctx);
|
|
9173
9393
|
try {
|
|
9174
9394
|
await backupManager.restoreAll();
|
|
9175
|
-
|
|
9395
|
+
logger34.info("lint-staged configuration rolled back");
|
|
9176
9396
|
} catch (error) {
|
|
9177
|
-
|
|
9397
|
+
logger34.error("Failed to rollback lint-staged configuration:", error);
|
|
9178
9398
|
throw error;
|
|
9179
9399
|
}
|
|
9180
9400
|
}
|
|
@@ -9189,7 +9409,7 @@ function getLintStagedConfig() {
|
|
|
9189
9409
|
|
|
9190
9410
|
// src/plugins/tooling/prettier.ts
|
|
9191
9411
|
import { join as join32 } from "path";
|
|
9192
|
-
var
|
|
9412
|
+
var logger35 = getModuleLogger();
|
|
9193
9413
|
var prettierPlugin = {
|
|
9194
9414
|
name: "prettier",
|
|
9195
9415
|
displayName: "Prettier",
|
|
@@ -9208,7 +9428,7 @@ var prettierPlugin = {
|
|
|
9208
9428
|
*/
|
|
9209
9429
|
async install(ctx) {
|
|
9210
9430
|
if (this.detect?.(ctx)) {
|
|
9211
|
-
|
|
9431
|
+
logger35.info("Prettier is already installed");
|
|
9212
9432
|
return {
|
|
9213
9433
|
packages: {},
|
|
9214
9434
|
success: true,
|
|
@@ -9223,7 +9443,7 @@ var prettierPlugin = {
|
|
|
9223
9443
|
exact: false,
|
|
9224
9444
|
silent: false
|
|
9225
9445
|
});
|
|
9226
|
-
|
|
9446
|
+
logger35.info("Successfully installed Prettier");
|
|
9227
9447
|
return {
|
|
9228
9448
|
packages: {
|
|
9229
9449
|
devDependencies: ["prettier"]
|
|
@@ -9232,7 +9452,7 @@ var prettierPlugin = {
|
|
|
9232
9452
|
message: "Installed prettier"
|
|
9233
9453
|
};
|
|
9234
9454
|
} catch (error) {
|
|
9235
|
-
|
|
9455
|
+
logger35.error("Failed to install Prettier:", error);
|
|
9236
9456
|
return {
|
|
9237
9457
|
packages: {},
|
|
9238
9458
|
success: false,
|
|
@@ -9261,7 +9481,7 @@ var prettierPlugin = {
|
|
|
9261
9481
|
ctx.fsAdapter
|
|
9262
9482
|
);
|
|
9263
9483
|
if (prettierrcExists) {
|
|
9264
|
-
|
|
9484
|
+
logger35.warn(".prettierrc.json already exists, skipping creation");
|
|
9265
9485
|
} else {
|
|
9266
9486
|
const prettierrcContent = getPrettierConfigContent();
|
|
9267
9487
|
await writer.createFile(prettierrcPath, prettierrcContent);
|
|
@@ -9271,7 +9491,7 @@ var prettierPlugin = {
|
|
|
9271
9491
|
content: prettierrcContent,
|
|
9272
9492
|
backup: false
|
|
9273
9493
|
});
|
|
9274
|
-
|
|
9494
|
+
logger35.info(`Created Prettier config: ${prettierrcPath}`);
|
|
9275
9495
|
}
|
|
9276
9496
|
const prettierignorePath = join32(projectRoot, ".prettierignore");
|
|
9277
9497
|
const prettierignoreExists = await checkPathExists(
|
|
@@ -9279,7 +9499,7 @@ var prettierPlugin = {
|
|
|
9279
9499
|
ctx.fsAdapter
|
|
9280
9500
|
);
|
|
9281
9501
|
if (prettierignoreExists) {
|
|
9282
|
-
|
|
9502
|
+
logger35.warn(".prettierignore already exists, skipping creation");
|
|
9283
9503
|
} else {
|
|
9284
9504
|
const prettierignoreContent = getPrettierIgnoreContent();
|
|
9285
9505
|
await writer.createFile(prettierignorePath, prettierignoreContent);
|
|
@@ -9289,7 +9509,7 @@ var prettierPlugin = {
|
|
|
9289
9509
|
content: prettierignoreContent,
|
|
9290
9510
|
backup: false
|
|
9291
9511
|
});
|
|
9292
|
-
|
|
9512
|
+
logger35.info(`Created .prettierignore: ${prettierignorePath}`);
|
|
9293
9513
|
}
|
|
9294
9514
|
const packageJsonPath = join32(projectRoot, "package.json");
|
|
9295
9515
|
const packageJsonExists = await checkPathExists(
|
|
@@ -9328,7 +9548,7 @@ var prettierPlugin = {
|
|
|
9328
9548
|
content: updatedContent,
|
|
9329
9549
|
backup: true
|
|
9330
9550
|
});
|
|
9331
|
-
|
|
9551
|
+
logger35.info("Updated package.json with Prettier scripts");
|
|
9332
9552
|
}
|
|
9333
9553
|
}
|
|
9334
9554
|
return {
|
|
@@ -9337,7 +9557,7 @@ var prettierPlugin = {
|
|
|
9337
9557
|
message: "Prettier configured successfully"
|
|
9338
9558
|
};
|
|
9339
9559
|
} catch (error) {
|
|
9340
|
-
|
|
9560
|
+
logger35.error("Failed to configure Prettier:", error);
|
|
9341
9561
|
await backupManager.restoreAll();
|
|
9342
9562
|
return {
|
|
9343
9563
|
files,
|
|
@@ -9353,9 +9573,9 @@ var prettierPlugin = {
|
|
|
9353
9573
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
9354
9574
|
try {
|
|
9355
9575
|
await backupManager.restoreAll();
|
|
9356
|
-
|
|
9576
|
+
logger35.info("Prettier configuration rolled back");
|
|
9357
9577
|
} catch (error) {
|
|
9358
|
-
|
|
9578
|
+
logger35.error("Failed to rollback Prettier configuration:", error);
|
|
9359
9579
|
throw error;
|
|
9360
9580
|
}
|
|
9361
9581
|
}
|
|
@@ -9393,7 +9613,7 @@ pnpm-lock.yaml
|
|
|
9393
9613
|
|
|
9394
9614
|
// src/plugins/tooling/unplugin-auto-import.ts
|
|
9395
9615
|
import { join as join33 } from "path";
|
|
9396
|
-
var
|
|
9616
|
+
var logger36 = getModuleLogger();
|
|
9397
9617
|
var unpluginAutoImportPlugin = {
|
|
9398
9618
|
name: "unplugin-auto-import",
|
|
9399
9619
|
displayName: "Auto Import (Vue)",
|
|
@@ -9413,7 +9633,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9413
9633
|
*/
|
|
9414
9634
|
async install(ctx) {
|
|
9415
9635
|
if (this.detect?.(ctx)) {
|
|
9416
|
-
|
|
9636
|
+
logger36.info("unplugin-auto-import is already installed");
|
|
9417
9637
|
return {
|
|
9418
9638
|
packages: {},
|
|
9419
9639
|
success: true,
|
|
@@ -9429,7 +9649,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9429
9649
|
exact: false,
|
|
9430
9650
|
silent: false
|
|
9431
9651
|
});
|
|
9432
|
-
|
|
9652
|
+
logger36.info("Successfully installed unplugin-auto-import");
|
|
9433
9653
|
return {
|
|
9434
9654
|
packages: {
|
|
9435
9655
|
devDependencies: packages
|
|
@@ -9438,7 +9658,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9438
9658
|
message: `Installed unplugin-auto-import: ${packages.join(", ")}`
|
|
9439
9659
|
};
|
|
9440
9660
|
} catch (error) {
|
|
9441
|
-
|
|
9661
|
+
logger36.error("Failed to install unplugin-auto-import:", error);
|
|
9442
9662
|
return {
|
|
9443
9663
|
packages: {},
|
|
9444
9664
|
success: false,
|
|
@@ -9481,7 +9701,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9481
9701
|
content: updatedContent,
|
|
9482
9702
|
backup: true
|
|
9483
9703
|
});
|
|
9484
|
-
|
|
9704
|
+
logger36.info(`Updated ${viteConfigPath} with Auto Import plugin`);
|
|
9485
9705
|
}
|
|
9486
9706
|
} else {
|
|
9487
9707
|
const viteConfigContent = getViteConfigContent();
|
|
@@ -9492,7 +9712,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9492
9712
|
content: viteConfigContent,
|
|
9493
9713
|
backup: false
|
|
9494
9714
|
});
|
|
9495
|
-
|
|
9715
|
+
logger36.info(`Created ${viteConfigPath} with Auto Import plugin`);
|
|
9496
9716
|
}
|
|
9497
9717
|
return {
|
|
9498
9718
|
files,
|
|
@@ -9500,7 +9720,7 @@ var unpluginAutoImportPlugin = {
|
|
|
9500
9720
|
message: "unplugin-auto-import configured successfully"
|
|
9501
9721
|
};
|
|
9502
9722
|
} catch (error) {
|
|
9503
|
-
|
|
9723
|
+
logger36.error("Failed to configure unplugin-auto-import:", error);
|
|
9504
9724
|
await backupManager.restoreAll();
|
|
9505
9725
|
return {
|
|
9506
9726
|
files,
|
|
@@ -9516,9 +9736,9 @@ var unpluginAutoImportPlugin = {
|
|
|
9516
9736
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
9517
9737
|
try {
|
|
9518
9738
|
await backupManager.restoreAll();
|
|
9519
|
-
|
|
9739
|
+
logger36.info("unplugin-auto-import configuration rolled back");
|
|
9520
9740
|
} catch (error) {
|
|
9521
|
-
|
|
9741
|
+
logger36.error(
|
|
9522
9742
|
"Failed to rollback unplugin-auto-import configuration:",
|
|
9523
9743
|
error
|
|
9524
9744
|
);
|
|
@@ -9580,7 +9800,7 @@ function injectAutoImportPlugin(content) {
|
|
|
9580
9800
|
|
|
9581
9801
|
// src/plugins/tooling/unplugin-vue-components.ts
|
|
9582
9802
|
import { join as join34 } from "path";
|
|
9583
|
-
var
|
|
9803
|
+
var logger37 = getModuleLogger();
|
|
9584
9804
|
var unpluginVueComponentsPlugin = {
|
|
9585
9805
|
name: "unplugin-vue-components",
|
|
9586
9806
|
displayName: "Auto Components (Vue)",
|
|
@@ -9600,7 +9820,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9600
9820
|
*/
|
|
9601
9821
|
async install(ctx) {
|
|
9602
9822
|
if (this.detect?.(ctx)) {
|
|
9603
|
-
|
|
9823
|
+
logger37.info("unplugin-vue-components is already installed");
|
|
9604
9824
|
return {
|
|
9605
9825
|
packages: {},
|
|
9606
9826
|
success: true,
|
|
@@ -9616,7 +9836,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9616
9836
|
exact: false,
|
|
9617
9837
|
silent: false
|
|
9618
9838
|
});
|
|
9619
|
-
|
|
9839
|
+
logger37.info("Successfully installed unplugin-vue-components");
|
|
9620
9840
|
return {
|
|
9621
9841
|
packages: {
|
|
9622
9842
|
devDependencies: packages
|
|
@@ -9625,7 +9845,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9625
9845
|
message: `Installed unplugin-vue-components: ${packages.join(", ")}`
|
|
9626
9846
|
};
|
|
9627
9847
|
} catch (error) {
|
|
9628
|
-
|
|
9848
|
+
logger37.error("Failed to install unplugin-vue-components:", error);
|
|
9629
9849
|
return {
|
|
9630
9850
|
packages: {},
|
|
9631
9851
|
success: false,
|
|
@@ -9668,7 +9888,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9668
9888
|
content: updatedContent,
|
|
9669
9889
|
backup: true
|
|
9670
9890
|
});
|
|
9671
|
-
|
|
9891
|
+
logger37.info(`Updated ${viteConfigPath} with Vue Components plugin`);
|
|
9672
9892
|
}
|
|
9673
9893
|
} else {
|
|
9674
9894
|
const viteConfigContent = getViteConfigContent2();
|
|
@@ -9679,7 +9899,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9679
9899
|
content: viteConfigContent,
|
|
9680
9900
|
backup: false
|
|
9681
9901
|
});
|
|
9682
|
-
|
|
9902
|
+
logger37.info(`Created ${viteConfigPath} with Vue Components plugin`);
|
|
9683
9903
|
}
|
|
9684
9904
|
return {
|
|
9685
9905
|
files,
|
|
@@ -9687,7 +9907,7 @@ var unpluginVueComponentsPlugin = {
|
|
|
9687
9907
|
message: "unplugin-vue-components configured successfully"
|
|
9688
9908
|
};
|
|
9689
9909
|
} catch (error) {
|
|
9690
|
-
|
|
9910
|
+
logger37.error("Failed to configure unplugin-vue-components:", error);
|
|
9691
9911
|
await backupManager.restoreAll();
|
|
9692
9912
|
return {
|
|
9693
9913
|
files,
|
|
@@ -9703,9 +9923,9 @@ var unpluginVueComponentsPlugin = {
|
|
|
9703
9923
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
9704
9924
|
try {
|
|
9705
9925
|
await backupManager.restoreAll();
|
|
9706
|
-
|
|
9926
|
+
logger37.info("unplugin-vue-components configuration rolled back");
|
|
9707
9927
|
} catch (error) {
|
|
9708
|
-
|
|
9928
|
+
logger37.error(
|
|
9709
9929
|
"Failed to rollback unplugin-vue-components configuration:",
|
|
9710
9930
|
error
|
|
9711
9931
|
);
|
|
@@ -9765,7 +9985,7 @@ function injectComponentsPlugin(content) {
|
|
|
9765
9985
|
|
|
9766
9986
|
// src/plugins/tooling/vue-tsc.ts
|
|
9767
9987
|
import { join as join35 } from "path";
|
|
9768
|
-
var
|
|
9988
|
+
var logger38 = getModuleLogger();
|
|
9769
9989
|
var vueTscPlugin = {
|
|
9770
9990
|
name: "vue-tsc",
|
|
9771
9991
|
displayName: "vue-tsc",
|
|
@@ -9785,7 +10005,7 @@ var vueTscPlugin = {
|
|
|
9785
10005
|
*/
|
|
9786
10006
|
async install(ctx) {
|
|
9787
10007
|
if (this.detect?.(ctx)) {
|
|
9788
|
-
|
|
10008
|
+
logger38.info("vue-tsc is already installed");
|
|
9789
10009
|
return {
|
|
9790
10010
|
packages: {},
|
|
9791
10011
|
success: true,
|
|
@@ -9801,7 +10021,7 @@ var vueTscPlugin = {
|
|
|
9801
10021
|
exact: false,
|
|
9802
10022
|
silent: false
|
|
9803
10023
|
});
|
|
9804
|
-
|
|
10024
|
+
logger38.info("Successfully installed vue-tsc");
|
|
9805
10025
|
return {
|
|
9806
10026
|
packages: {
|
|
9807
10027
|
devDependencies: packages
|
|
@@ -9810,7 +10030,7 @@ var vueTscPlugin = {
|
|
|
9810
10030
|
message: `Installed vue-tsc: ${packages.join(", ")}`
|
|
9811
10031
|
};
|
|
9812
10032
|
} catch (error) {
|
|
9813
|
-
|
|
10033
|
+
logger38.error("Failed to install vue-tsc:", error);
|
|
9814
10034
|
return {
|
|
9815
10035
|
packages: {},
|
|
9816
10036
|
success: false,
|
|
@@ -9840,14 +10060,14 @@ var vueTscPlugin = {
|
|
|
9840
10060
|
path: normalizePath(packageJsonPath),
|
|
9841
10061
|
backup: true
|
|
9842
10062
|
});
|
|
9843
|
-
|
|
10063
|
+
logger38.info("Updated package.json with vue-tsc typecheck script");
|
|
9844
10064
|
return {
|
|
9845
10065
|
files,
|
|
9846
10066
|
success: true,
|
|
9847
10067
|
message: "vue-tsc configured successfully"
|
|
9848
10068
|
};
|
|
9849
10069
|
} catch (error) {
|
|
9850
|
-
|
|
10070
|
+
logger38.error("Failed to configure vue-tsc:", error);
|
|
9851
10071
|
return {
|
|
9852
10072
|
files,
|
|
9853
10073
|
success: false,
|
|
@@ -9861,13 +10081,13 @@ var vueTscPlugin = {
|
|
|
9861
10081
|
async rollback(_ctx) {
|
|
9862
10082
|
const backupManager = getRollbackManager(_ctx);
|
|
9863
10083
|
await backupManager.restoreAll();
|
|
9864
|
-
|
|
10084
|
+
logger38.info("vue-tsc configuration rolled back");
|
|
9865
10085
|
}
|
|
9866
10086
|
};
|
|
9867
10087
|
|
|
9868
10088
|
// src/plugins/ui/radix-ui.ts
|
|
9869
10089
|
import { join as join36 } from "path";
|
|
9870
|
-
var
|
|
10090
|
+
var logger39 = getModuleLogger();
|
|
9871
10091
|
var radixUiPlugin = {
|
|
9872
10092
|
name: "radix-ui",
|
|
9873
10093
|
displayName: "Radix UI",
|
|
@@ -9886,7 +10106,7 @@ var radixUiPlugin = {
|
|
|
9886
10106
|
*/
|
|
9887
10107
|
async install(ctx) {
|
|
9888
10108
|
if (this.detect?.(ctx)) {
|
|
9889
|
-
|
|
10109
|
+
logger39.info("Radix UI is already installed");
|
|
9890
10110
|
return {
|
|
9891
10111
|
packages: {},
|
|
9892
10112
|
success: true,
|
|
@@ -9913,7 +10133,7 @@ var radixUiPlugin = {
|
|
|
9913
10133
|
exact: false,
|
|
9914
10134
|
silent: false
|
|
9915
10135
|
});
|
|
9916
|
-
|
|
10136
|
+
logger39.info("Successfully installed Radix UI primitives");
|
|
9917
10137
|
return {
|
|
9918
10138
|
packages: {
|
|
9919
10139
|
dependencies: packages
|
|
@@ -9922,7 +10142,7 @@ var radixUiPlugin = {
|
|
|
9922
10142
|
message: `Installed Radix UI primitives: ${packages.length} packages`
|
|
9923
10143
|
};
|
|
9924
10144
|
} catch (error) {
|
|
9925
|
-
|
|
10145
|
+
logger39.error("Failed to install Radix UI:", error);
|
|
9926
10146
|
return {
|
|
9927
10147
|
packages: {},
|
|
9928
10148
|
success: false,
|
|
@@ -9957,7 +10177,7 @@ var radixUiPlugin = {
|
|
|
9957
10177
|
content: dialogContent,
|
|
9958
10178
|
backup: false
|
|
9959
10179
|
});
|
|
9960
|
-
|
|
10180
|
+
logger39.info(`Created Dialog component: ${dialogPath}`);
|
|
9961
10181
|
const dropdownMenuPath = join36(radixDir, `DropdownMenu.${extension}`);
|
|
9962
10182
|
const dropdownMenuContent = ctx.typescript ? getDropdownMenuContentTS() : getDropdownMenuContentJS();
|
|
9963
10183
|
await writer.createFile(dropdownMenuPath, dropdownMenuContent);
|
|
@@ -9967,7 +10187,7 @@ var radixUiPlugin = {
|
|
|
9967
10187
|
content: dropdownMenuContent,
|
|
9968
10188
|
backup: false
|
|
9969
10189
|
});
|
|
9970
|
-
|
|
10190
|
+
logger39.info(`Created DropdownMenu component: ${dropdownMenuPath}`);
|
|
9971
10191
|
const indexPath = join36(radixDir, `index.${ctx.typescript ? "ts" : "js"}`);
|
|
9972
10192
|
const indexContent = ctx.typescript ? getIndexContentTS6() : getIndexContentJS6();
|
|
9973
10193
|
await writer.createFile(indexPath, indexContent);
|
|
@@ -9977,14 +10197,14 @@ var radixUiPlugin = {
|
|
|
9977
10197
|
content: indexContent,
|
|
9978
10198
|
backup: false
|
|
9979
10199
|
});
|
|
9980
|
-
|
|
10200
|
+
logger39.info(`Created Radix UI components index: ${indexPath}`);
|
|
9981
10201
|
return {
|
|
9982
10202
|
files,
|
|
9983
10203
|
success: true,
|
|
9984
10204
|
message: "Radix UI configured successfully"
|
|
9985
10205
|
};
|
|
9986
10206
|
} catch (error) {
|
|
9987
|
-
|
|
10207
|
+
logger39.error("Failed to configure Radix UI:", error);
|
|
9988
10208
|
await backupManager.restoreAll();
|
|
9989
10209
|
return {
|
|
9990
10210
|
files,
|
|
@@ -10000,9 +10220,9 @@ var radixUiPlugin = {
|
|
|
10000
10220
|
const backupManager = getRollbackManager(_ctx);
|
|
10001
10221
|
try {
|
|
10002
10222
|
await backupManager.restoreAll();
|
|
10003
|
-
|
|
10223
|
+
logger39.info("Radix UI configuration rolled back");
|
|
10004
10224
|
} catch (error) {
|
|
10005
|
-
|
|
10225
|
+
logger39.error("Failed to rollback Radix UI configuration:", error);
|
|
10006
10226
|
throw error;
|
|
10007
10227
|
}
|
|
10008
10228
|
}
|
|
@@ -10597,7 +10817,7 @@ export {
|
|
|
10597
10817
|
|
|
10598
10818
|
// src/plugins/ui/react-hot-toast.ts
|
|
10599
10819
|
import { join as join37 } from "path";
|
|
10600
|
-
var
|
|
10820
|
+
var logger40 = getModuleLogger();
|
|
10601
10821
|
var reactHotToastPlugin = {
|
|
10602
10822
|
name: "react-hot-toast",
|
|
10603
10823
|
displayName: "React Hot Toast",
|
|
@@ -10616,7 +10836,7 @@ var reactHotToastPlugin = {
|
|
|
10616
10836
|
*/
|
|
10617
10837
|
async install(ctx) {
|
|
10618
10838
|
if (this.detect?.(ctx)) {
|
|
10619
|
-
|
|
10839
|
+
logger40.info("React Hot Toast is already installed");
|
|
10620
10840
|
return {
|
|
10621
10841
|
packages: {},
|
|
10622
10842
|
success: true,
|
|
@@ -10632,7 +10852,7 @@ var reactHotToastPlugin = {
|
|
|
10632
10852
|
exact: false,
|
|
10633
10853
|
silent: false
|
|
10634
10854
|
});
|
|
10635
|
-
|
|
10855
|
+
logger40.info("Successfully installed React Hot Toast");
|
|
10636
10856
|
return {
|
|
10637
10857
|
packages: {
|
|
10638
10858
|
dependencies: packages
|
|
@@ -10641,7 +10861,7 @@ var reactHotToastPlugin = {
|
|
|
10641
10861
|
message: `Installed React Hot Toast: ${packages.join(", ")}`
|
|
10642
10862
|
};
|
|
10643
10863
|
} catch (error) {
|
|
10644
|
-
|
|
10864
|
+
logger40.error("Failed to install React Hot Toast:", error);
|
|
10645
10865
|
return {
|
|
10646
10866
|
packages: {},
|
|
10647
10867
|
success: false,
|
|
@@ -10691,9 +10911,9 @@ var reactHotToastPlugin = {
|
|
|
10691
10911
|
content: updatedContent,
|
|
10692
10912
|
backup: true
|
|
10693
10913
|
});
|
|
10694
|
-
|
|
10914
|
+
logger40.info(`Added Toaster to ${targetPath}`);
|
|
10695
10915
|
} else {
|
|
10696
|
-
|
|
10916
|
+
logger40.warn("Toaster already configured in the app");
|
|
10697
10917
|
}
|
|
10698
10918
|
} else {
|
|
10699
10919
|
const newAppPath = join37(srcDir, `App.${extension}`);
|
|
@@ -10705,7 +10925,7 @@ var reactHotToastPlugin = {
|
|
|
10705
10925
|
content: newAppContent,
|
|
10706
10926
|
backup: false
|
|
10707
10927
|
});
|
|
10708
|
-
|
|
10928
|
+
logger40.info(`Created App.${extension} with Toaster`);
|
|
10709
10929
|
}
|
|
10710
10930
|
return {
|
|
10711
10931
|
files,
|
|
@@ -10713,7 +10933,7 @@ var reactHotToastPlugin = {
|
|
|
10713
10933
|
message: "React Hot Toast configured successfully"
|
|
10714
10934
|
};
|
|
10715
10935
|
} catch (error) {
|
|
10716
|
-
|
|
10936
|
+
logger40.error("Failed to configure React Hot Toast:", error);
|
|
10717
10937
|
await backupManager.restoreAll();
|
|
10718
10938
|
return {
|
|
10719
10939
|
files,
|
|
@@ -10729,9 +10949,9 @@ var reactHotToastPlugin = {
|
|
|
10729
10949
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
10730
10950
|
try {
|
|
10731
10951
|
await backupManager.restoreAll();
|
|
10732
|
-
|
|
10952
|
+
logger40.info("React Hot Toast configuration rolled back");
|
|
10733
10953
|
} catch (error) {
|
|
10734
|
-
|
|
10954
|
+
logger40.error("Failed to rollback React Hot Toast configuration:", error);
|
|
10735
10955
|
throw error;
|
|
10736
10956
|
}
|
|
10737
10957
|
}
|
|
@@ -10794,7 +11014,7 @@ export default App
|
|
|
10794
11014
|
|
|
10795
11015
|
// src/plugins/ui/react-hot-toast-nextjs.ts
|
|
10796
11016
|
import { join as join38 } from "path";
|
|
10797
|
-
var
|
|
11017
|
+
var logger41 = getModuleLogger();
|
|
10798
11018
|
var reactHotToastNextjsPlugin = {
|
|
10799
11019
|
name: "react-hot-toast-nextjs",
|
|
10800
11020
|
displayName: "React Hot Toast (Next.js)",
|
|
@@ -10813,7 +11033,7 @@ var reactHotToastNextjsPlugin = {
|
|
|
10813
11033
|
*/
|
|
10814
11034
|
async install(ctx) {
|
|
10815
11035
|
if (this.detect?.(ctx)) {
|
|
10816
|
-
|
|
11036
|
+
logger41.info("React Hot Toast is already installed");
|
|
10817
11037
|
return {
|
|
10818
11038
|
packages: {},
|
|
10819
11039
|
success: true,
|
|
@@ -10829,7 +11049,7 @@ var reactHotToastNextjsPlugin = {
|
|
|
10829
11049
|
exact: false,
|
|
10830
11050
|
silent: false
|
|
10831
11051
|
});
|
|
10832
|
-
|
|
11052
|
+
logger41.info("Successfully installed React Hot Toast");
|
|
10833
11053
|
return {
|
|
10834
11054
|
packages: {
|
|
10835
11055
|
dependencies: packages
|
|
@@ -10838,7 +11058,7 @@ var reactHotToastNextjsPlugin = {
|
|
|
10838
11058
|
message: `Installed React Hot Toast: ${packages.join(", ")}`
|
|
10839
11059
|
};
|
|
10840
11060
|
} catch (error) {
|
|
10841
|
-
|
|
11061
|
+
logger41.error("Failed to install React Hot Toast:", error);
|
|
10842
11062
|
return {
|
|
10843
11063
|
packages: {},
|
|
10844
11064
|
success: false,
|
|
@@ -10916,9 +11136,9 @@ var reactHotToastNextjsPlugin = {
|
|
|
10916
11136
|
content: updatedContent,
|
|
10917
11137
|
backup: targetContent ? true : false
|
|
10918
11138
|
});
|
|
10919
|
-
|
|
11139
|
+
logger41.info(`Added Toaster to ${targetPath}`);
|
|
10920
11140
|
} else {
|
|
10921
|
-
|
|
11141
|
+
logger41.warn("Toaster already configured");
|
|
10922
11142
|
}
|
|
10923
11143
|
}
|
|
10924
11144
|
return {
|
|
@@ -10927,7 +11147,7 @@ var reactHotToastNextjsPlugin = {
|
|
|
10927
11147
|
message: "React Hot Toast configured successfully for Next.js"
|
|
10928
11148
|
};
|
|
10929
11149
|
} catch (error) {
|
|
10930
|
-
|
|
11150
|
+
logger41.error("Failed to configure React Hot Toast:", error);
|
|
10931
11151
|
await backupManager.restoreAll();
|
|
10932
11152
|
return {
|
|
10933
11153
|
files,
|
|
@@ -10943,9 +11163,9 @@ var reactHotToastNextjsPlugin = {
|
|
|
10943
11163
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
10944
11164
|
try {
|
|
10945
11165
|
await backupManager.restoreAll();
|
|
10946
|
-
|
|
11166
|
+
logger41.info("React Hot Toast configuration rolled back");
|
|
10947
11167
|
} catch (error) {
|
|
10948
|
-
|
|
11168
|
+
logger41.error("Failed to rollback React Hot Toast configuration:", error);
|
|
10949
11169
|
throw error;
|
|
10950
11170
|
}
|
|
10951
11171
|
}
|
|
@@ -11093,7 +11313,7 @@ export default function App({ Component, pageProps }) {
|
|
|
11093
11313
|
|
|
11094
11314
|
// src/plugins/ui/react-icons.ts
|
|
11095
11315
|
import { join as join39 } from "path";
|
|
11096
|
-
var
|
|
11316
|
+
var logger42 = getModuleLogger();
|
|
11097
11317
|
var reactIconsPlugin = {
|
|
11098
11318
|
name: "react-icons",
|
|
11099
11319
|
displayName: "React Icons",
|
|
@@ -11112,7 +11332,7 @@ var reactIconsPlugin = {
|
|
|
11112
11332
|
*/
|
|
11113
11333
|
async install(ctx) {
|
|
11114
11334
|
if (this.detect?.(ctx)) {
|
|
11115
|
-
|
|
11335
|
+
logger42.info("React Icons is already installed");
|
|
11116
11336
|
return {
|
|
11117
11337
|
packages: {},
|
|
11118
11338
|
success: true,
|
|
@@ -11128,7 +11348,7 @@ var reactIconsPlugin = {
|
|
|
11128
11348
|
exact: false,
|
|
11129
11349
|
silent: false
|
|
11130
11350
|
});
|
|
11131
|
-
|
|
11351
|
+
logger42.info("Successfully installed React Icons");
|
|
11132
11352
|
return {
|
|
11133
11353
|
packages: {
|
|
11134
11354
|
dependencies: packages
|
|
@@ -11137,7 +11357,7 @@ var reactIconsPlugin = {
|
|
|
11137
11357
|
message: `Installed React Icons: ${packages.join(", ")}`
|
|
11138
11358
|
};
|
|
11139
11359
|
} catch (error) {
|
|
11140
|
-
|
|
11360
|
+
logger42.error("Failed to install React Icons:", error);
|
|
11141
11361
|
return {
|
|
11142
11362
|
packages: {},
|
|
11143
11363
|
success: false,
|
|
@@ -11173,7 +11393,7 @@ var reactIconsPlugin = {
|
|
|
11173
11393
|
content: iconExampleContent,
|
|
11174
11394
|
backup: false
|
|
11175
11395
|
});
|
|
11176
|
-
|
|
11396
|
+
logger42.info(`Created icon example: ${iconExamplePath}`);
|
|
11177
11397
|
const indexPath = join39(iconsDir, `index.${ctx.typescript ? "ts" : "js"}`);
|
|
11178
11398
|
const indexContent = ctx.typescript ? getIndexContentTS7() : getIndexContentJS7();
|
|
11179
11399
|
await writer.createFile(indexPath, indexContent);
|
|
@@ -11183,14 +11403,14 @@ var reactIconsPlugin = {
|
|
|
11183
11403
|
content: indexContent,
|
|
11184
11404
|
backup: false
|
|
11185
11405
|
});
|
|
11186
|
-
|
|
11406
|
+
logger42.info(`Created icons index: ${indexPath}`);
|
|
11187
11407
|
return {
|
|
11188
11408
|
files,
|
|
11189
11409
|
success: true,
|
|
11190
11410
|
message: "React Icons configured successfully"
|
|
11191
11411
|
};
|
|
11192
11412
|
} catch (error) {
|
|
11193
|
-
|
|
11413
|
+
logger42.error("Failed to configure React Icons:", error);
|
|
11194
11414
|
await backupManager.restoreAll();
|
|
11195
11415
|
return {
|
|
11196
11416
|
files,
|
|
@@ -11206,9 +11426,9 @@ var reactIconsPlugin = {
|
|
|
11206
11426
|
const backupManager = getRollbackManager(_ctx);
|
|
11207
11427
|
try {
|
|
11208
11428
|
await backupManager.restoreAll();
|
|
11209
|
-
|
|
11429
|
+
logger42.info("React Icons configuration rolled back");
|
|
11210
11430
|
} catch (error) {
|
|
11211
|
-
|
|
11431
|
+
logger42.error("Failed to rollback React Icons configuration:", error);
|
|
11212
11432
|
throw error;
|
|
11213
11433
|
}
|
|
11214
11434
|
}
|
|
@@ -11291,7 +11511,7 @@ export { MdHome, MdSettings, MdSearch } from 'react-icons/md'
|
|
|
11291
11511
|
|
|
11292
11512
|
// src/plugins/ui/shadcn-ui.ts
|
|
11293
11513
|
import { join as join40 } from "path";
|
|
11294
|
-
var
|
|
11514
|
+
var logger43 = getModuleLogger();
|
|
11295
11515
|
var shadcnUiPlugin = {
|
|
11296
11516
|
name: "shadcn-ui",
|
|
11297
11517
|
displayName: "Shadcn/ui",
|
|
@@ -11316,7 +11536,7 @@ var shadcnUiPlugin = {
|
|
|
11316
11536
|
*/
|
|
11317
11537
|
async install(ctx) {
|
|
11318
11538
|
if (this.detect?.(ctx)) {
|
|
11319
|
-
|
|
11539
|
+
logger43.info("Shadcn/ui dependencies are already installed");
|
|
11320
11540
|
return {
|
|
11321
11541
|
packages: {},
|
|
11322
11542
|
success: true,
|
|
@@ -11346,7 +11566,7 @@ var shadcnUiPlugin = {
|
|
|
11346
11566
|
exact: false,
|
|
11347
11567
|
silent: false
|
|
11348
11568
|
});
|
|
11349
|
-
|
|
11569
|
+
logger43.info("Successfully installed Shadcn/ui dependencies");
|
|
11350
11570
|
return {
|
|
11351
11571
|
packages: {
|
|
11352
11572
|
dependencies: packages
|
|
@@ -11355,7 +11575,7 @@ var shadcnUiPlugin = {
|
|
|
11355
11575
|
message: `Installed Shadcn/ui dependencies: ${packages.join(", ")}`
|
|
11356
11576
|
};
|
|
11357
11577
|
} catch (error) {
|
|
11358
|
-
|
|
11578
|
+
logger43.error("Failed to install Shadcn/ui dependencies:", error);
|
|
11359
11579
|
return {
|
|
11360
11580
|
packages: {},
|
|
11361
11581
|
success: false,
|
|
@@ -11386,7 +11606,7 @@ var shadcnUiPlugin = {
|
|
|
11386
11606
|
ctx.fsAdapter
|
|
11387
11607
|
);
|
|
11388
11608
|
if (componentsJsonExists) {
|
|
11389
|
-
|
|
11609
|
+
logger43.warn("components.json already exists, skipping creation");
|
|
11390
11610
|
} else {
|
|
11391
11611
|
const componentsJsonContent = getComponentsJsonContent(ctx);
|
|
11392
11612
|
await writer.createFile(componentsJsonPath, componentsJsonContent);
|
|
@@ -11396,14 +11616,14 @@ var shadcnUiPlugin = {
|
|
|
11396
11616
|
content: componentsJsonContent,
|
|
11397
11617
|
backup: false
|
|
11398
11618
|
});
|
|
11399
|
-
|
|
11619
|
+
logger43.info(`Created components.json: ${componentsJsonPath}`);
|
|
11400
11620
|
}
|
|
11401
11621
|
const libDir = join40(srcDir, "lib");
|
|
11402
11622
|
await ensureDirectory(libDir, ctx.fsAdapter);
|
|
11403
11623
|
const utilsPath = join40(libDir, `utils.${ctx.typescript ? "ts" : "js"}`);
|
|
11404
11624
|
const utilsExists = await checkPathExists(utilsPath, ctx.fsAdapter);
|
|
11405
11625
|
if (utilsExists) {
|
|
11406
|
-
|
|
11626
|
+
logger43.warn(
|
|
11407
11627
|
"utils.ts already exists, checking if cn function is present"
|
|
11408
11628
|
);
|
|
11409
11629
|
const existingContent = await readFileContent(
|
|
@@ -11421,7 +11641,7 @@ var shadcnUiPlugin = {
|
|
|
11421
11641
|
content: updatedContent,
|
|
11422
11642
|
backup: true
|
|
11423
11643
|
});
|
|
11424
|
-
|
|
11644
|
+
logger43.info("Added cn function to utils.ts");
|
|
11425
11645
|
}
|
|
11426
11646
|
} else {
|
|
11427
11647
|
const utilsContent = ctx.typescript ? getUtilsContentTS() : getUtilsContentJS();
|
|
@@ -11432,7 +11652,7 @@ var shadcnUiPlugin = {
|
|
|
11432
11652
|
content: utilsContent,
|
|
11433
11653
|
backup: false
|
|
11434
11654
|
});
|
|
11435
|
-
|
|
11655
|
+
logger43.info(`Created utils file: ${utilsPath}`);
|
|
11436
11656
|
}
|
|
11437
11657
|
const uiDir = join40(srcDir, "components", "ui");
|
|
11438
11658
|
await ensureDirectory(uiDir, ctx.fsAdapter);
|
|
@@ -11447,7 +11667,7 @@ var shadcnUiPlugin = {
|
|
|
11447
11667
|
content: buttonContent,
|
|
11448
11668
|
backup: false
|
|
11449
11669
|
});
|
|
11450
|
-
|
|
11670
|
+
logger43.info(`Created Button component: ${buttonPath}`);
|
|
11451
11671
|
}
|
|
11452
11672
|
const cssPath = join40(srcDir, "index.css");
|
|
11453
11673
|
const cssExists = await checkPathExists(cssPath, ctx.fsAdapter);
|
|
@@ -11467,7 +11687,7 @@ var shadcnUiPlugin = {
|
|
|
11467
11687
|
content: updatedCss,
|
|
11468
11688
|
backup: true
|
|
11469
11689
|
});
|
|
11470
|
-
|
|
11690
|
+
logger43.info("Added Shadcn/ui CSS variables to index.css");
|
|
11471
11691
|
}
|
|
11472
11692
|
}
|
|
11473
11693
|
return {
|
|
@@ -11476,7 +11696,7 @@ var shadcnUiPlugin = {
|
|
|
11476
11696
|
message: "Shadcn/ui configured successfully"
|
|
11477
11697
|
};
|
|
11478
11698
|
} catch (error) {
|
|
11479
|
-
|
|
11699
|
+
logger43.error("Failed to configure Shadcn/ui:", error);
|
|
11480
11700
|
await backupManager.restoreAll();
|
|
11481
11701
|
return {
|
|
11482
11702
|
files,
|
|
@@ -11492,9 +11712,9 @@ var shadcnUiPlugin = {
|
|
|
11492
11712
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
11493
11713
|
try {
|
|
11494
11714
|
await backupManager.restoreAll();
|
|
11495
|
-
|
|
11715
|
+
logger43.info("Shadcn/ui configuration rolled back");
|
|
11496
11716
|
} catch (error) {
|
|
11497
|
-
|
|
11717
|
+
logger43.error("Failed to rollback Shadcn/ui configuration:", error);
|
|
11498
11718
|
throw error;
|
|
11499
11719
|
}
|
|
11500
11720
|
}
|
|
@@ -11764,7 +11984,7 @@ function getShadcnCSSVariables() {
|
|
|
11764
11984
|
|
|
11765
11985
|
// src/plugins/ui/shadcn-ui-nextjs.ts
|
|
11766
11986
|
import { join as join41 } from "path";
|
|
11767
|
-
var
|
|
11987
|
+
var logger44 = getModuleLogger();
|
|
11768
11988
|
var shadcnUiNextjsPlugin = {
|
|
11769
11989
|
name: "shadcn-ui-nextjs",
|
|
11770
11990
|
displayName: "Shadcn/ui (Next.js)",
|
|
@@ -11784,7 +12004,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11784
12004
|
*/
|
|
11785
12005
|
async install(ctx) {
|
|
11786
12006
|
if (this.detect?.(ctx)) {
|
|
11787
|
-
|
|
12007
|
+
logger44.info("Shadcn/ui dependencies are already installed");
|
|
11788
12008
|
return {
|
|
11789
12009
|
packages: {},
|
|
11790
12010
|
success: true,
|
|
@@ -11814,7 +12034,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11814
12034
|
exact: false,
|
|
11815
12035
|
silent: false
|
|
11816
12036
|
});
|
|
11817
|
-
|
|
12037
|
+
logger44.info("Successfully installed Shadcn/ui dependencies");
|
|
11818
12038
|
return {
|
|
11819
12039
|
packages: {
|
|
11820
12040
|
dependencies: packages
|
|
@@ -11823,7 +12043,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11823
12043
|
message: `Installed Shadcn/ui dependencies: ${packages.join(", ")}`
|
|
11824
12044
|
};
|
|
11825
12045
|
} catch (error) {
|
|
11826
|
-
|
|
12046
|
+
logger44.error("Failed to install Shadcn/ui dependencies:", error);
|
|
11827
12047
|
return {
|
|
11828
12048
|
packages: {},
|
|
11829
12049
|
success: false,
|
|
@@ -11853,7 +12073,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11853
12073
|
ctx.fsAdapter
|
|
11854
12074
|
);
|
|
11855
12075
|
if (componentsJsonExists) {
|
|
11856
|
-
|
|
12076
|
+
logger44.warn("components.json already exists, skipping creation");
|
|
11857
12077
|
} else {
|
|
11858
12078
|
const componentsJsonContent = getComponentsJsonContentNextjs(ctx);
|
|
11859
12079
|
await writer.createFile(componentsJsonPath, componentsJsonContent);
|
|
@@ -11863,14 +12083,14 @@ var shadcnUiNextjsPlugin = {
|
|
|
11863
12083
|
content: componentsJsonContent,
|
|
11864
12084
|
backup: false
|
|
11865
12085
|
});
|
|
11866
|
-
|
|
12086
|
+
logger44.info(`Created components.json: ${componentsJsonPath}`);
|
|
11867
12087
|
}
|
|
11868
12088
|
const libDir = join41(baseDir, "lib");
|
|
11869
12089
|
await ensureDirectory(libDir, ctx.fsAdapter);
|
|
11870
12090
|
const utilsPath = join41(libDir, `utils.${ctx.typescript ? "ts" : "js"}`);
|
|
11871
12091
|
const utilsExists = await checkPathExists(utilsPath, ctx.fsAdapter);
|
|
11872
12092
|
if (utilsExists) {
|
|
11873
|
-
|
|
12093
|
+
logger44.warn(
|
|
11874
12094
|
"utils.ts already exists, checking if cn function is present"
|
|
11875
12095
|
);
|
|
11876
12096
|
const existingContent = await readFileContent(
|
|
@@ -11888,7 +12108,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11888
12108
|
content: updatedContent,
|
|
11889
12109
|
backup: true
|
|
11890
12110
|
});
|
|
11891
|
-
|
|
12111
|
+
logger44.info("Added cn function to utils.ts");
|
|
11892
12112
|
}
|
|
11893
12113
|
} else {
|
|
11894
12114
|
const utilsContent = ctx.typescript ? getUtilsContentTS2() : getUtilsContentJS2();
|
|
@@ -11899,7 +12119,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11899
12119
|
content: utilsContent,
|
|
11900
12120
|
backup: false
|
|
11901
12121
|
});
|
|
11902
|
-
|
|
12122
|
+
logger44.info(`Created utils file: ${utilsPath}`);
|
|
11903
12123
|
}
|
|
11904
12124
|
const uiDir = join41(baseDir, "components", "ui");
|
|
11905
12125
|
await ensureDirectory(uiDir, ctx.fsAdapter);
|
|
@@ -11914,7 +12134,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11914
12134
|
content: buttonContent,
|
|
11915
12135
|
backup: false
|
|
11916
12136
|
});
|
|
11917
|
-
|
|
12137
|
+
logger44.info(`Created Button component: ${buttonPath}`);
|
|
11918
12138
|
}
|
|
11919
12139
|
const cssFiles = [
|
|
11920
12140
|
join41(projectRoot, "app", "globals.css"),
|
|
@@ -11940,7 +12160,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11940
12160
|
content: updatedCss,
|
|
11941
12161
|
backup: true
|
|
11942
12162
|
});
|
|
11943
|
-
|
|
12163
|
+
logger44.info(`Added Shadcn/ui CSS variables to ${cssPath}`);
|
|
11944
12164
|
}
|
|
11945
12165
|
break;
|
|
11946
12166
|
}
|
|
@@ -11951,7 +12171,7 @@ var shadcnUiNextjsPlugin = {
|
|
|
11951
12171
|
message: "Shadcn/ui configured successfully for Next.js"
|
|
11952
12172
|
};
|
|
11953
12173
|
} catch (error) {
|
|
11954
|
-
|
|
12174
|
+
logger44.error("Failed to configure Shadcn/ui:", error);
|
|
11955
12175
|
return {
|
|
11956
12176
|
files,
|
|
11957
12177
|
success: false,
|
|
@@ -11966,9 +12186,9 @@ var shadcnUiNextjsPlugin = {
|
|
|
11966
12186
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
11967
12187
|
try {
|
|
11968
12188
|
await backupManager.restoreAll();
|
|
11969
|
-
|
|
12189
|
+
logger44.info("Shadcn/ui configuration rolled back");
|
|
11970
12190
|
} catch (error) {
|
|
11971
|
-
|
|
12191
|
+
logger44.error("Failed to rollback Shadcn/ui configuration:", error);
|
|
11972
12192
|
throw error;
|
|
11973
12193
|
}
|
|
11974
12194
|
}
|
|
@@ -12240,7 +12460,7 @@ function getShadcnCSSVariables2() {
|
|
|
12240
12460
|
|
|
12241
12461
|
// src/plugins/ui/vuetify.ts
|
|
12242
12462
|
import { join as join42 } from "path";
|
|
12243
|
-
var
|
|
12463
|
+
var logger45 = getModuleLogger();
|
|
12244
12464
|
var vuetifyPlugin = {
|
|
12245
12465
|
name: "vuetify",
|
|
12246
12466
|
displayName: "Vuetify",
|
|
@@ -12259,7 +12479,7 @@ var vuetifyPlugin = {
|
|
|
12259
12479
|
*/
|
|
12260
12480
|
async install(ctx) {
|
|
12261
12481
|
if (this.detect?.(ctx)) {
|
|
12262
|
-
|
|
12482
|
+
logger45.info("Vuetify is already installed");
|
|
12263
12483
|
return {
|
|
12264
12484
|
packages: {},
|
|
12265
12485
|
success: true,
|
|
@@ -12300,7 +12520,7 @@ var vuetifyPlugin = {
|
|
|
12300
12520
|
silent: false
|
|
12301
12521
|
});
|
|
12302
12522
|
}
|
|
12303
|
-
|
|
12523
|
+
logger45.info("Successfully installed Vuetify");
|
|
12304
12524
|
return {
|
|
12305
12525
|
packages: {
|
|
12306
12526
|
dependencies: packages,
|
|
@@ -12310,7 +12530,7 @@ var vuetifyPlugin = {
|
|
|
12310
12530
|
message: `Installed ${packages.concat(devPackages).join(", ")}`
|
|
12311
12531
|
};
|
|
12312
12532
|
} catch (error) {
|
|
12313
|
-
|
|
12533
|
+
logger45.error("Failed to install Vuetify:", error);
|
|
12314
12534
|
return {
|
|
12315
12535
|
packages: {},
|
|
12316
12536
|
success: false,
|
|
@@ -12344,7 +12564,7 @@ var vuetifyPlugin = {
|
|
|
12344
12564
|
content: vuetifyConfigContent,
|
|
12345
12565
|
backup: false
|
|
12346
12566
|
});
|
|
12347
|
-
|
|
12567
|
+
logger45.info(`Created Vuetify config: ${vuetifyConfigPath}`);
|
|
12348
12568
|
const componentsDir = join42(ctx.projectRoot, ctx.srcDir, "components");
|
|
12349
12569
|
await ensureDirectory(componentsDir, ctx.fsAdapter);
|
|
12350
12570
|
const componentPath = join42(componentsDir, "HelloVuetify.vue");
|
|
@@ -12356,7 +12576,7 @@ var vuetifyPlugin = {
|
|
|
12356
12576
|
content: componentContent,
|
|
12357
12577
|
backup: false
|
|
12358
12578
|
});
|
|
12359
|
-
|
|
12579
|
+
logger45.info(`Created example component: ${componentPath}`);
|
|
12360
12580
|
const mainPath = join42(ctx.projectRoot, ctx.srcDir, `main.${extension}`);
|
|
12361
12581
|
const mainExists = await checkPathExists(mainPath, ctx.fsAdapter);
|
|
12362
12582
|
if (mainExists) {
|
|
@@ -12372,7 +12592,7 @@ var vuetifyPlugin = {
|
|
|
12372
12592
|
path: normalizePath(mainPath),
|
|
12373
12593
|
backup: true
|
|
12374
12594
|
});
|
|
12375
|
-
|
|
12595
|
+
logger45.info(`Updated ${mainPath} to import Vuetify`);
|
|
12376
12596
|
}
|
|
12377
12597
|
const viteConfigPath = join42(ctx.projectRoot, `vite.config.${extension}`);
|
|
12378
12598
|
const viteConfigExists = await checkPathExists(
|
|
@@ -12394,7 +12614,7 @@ var vuetifyPlugin = {
|
|
|
12394
12614
|
path: normalizePath(viteConfigPath),
|
|
12395
12615
|
backup: true
|
|
12396
12616
|
});
|
|
12397
|
-
|
|
12617
|
+
logger45.info(`Updated ${viteConfigPath} to include Vuetify plugin`);
|
|
12398
12618
|
}
|
|
12399
12619
|
return {
|
|
12400
12620
|
files,
|
|
@@ -12402,7 +12622,7 @@ var vuetifyPlugin = {
|
|
|
12402
12622
|
message: "Vuetify configured successfully"
|
|
12403
12623
|
};
|
|
12404
12624
|
} catch (error) {
|
|
12405
|
-
|
|
12625
|
+
logger45.error("Failed to configure Vuetify:", error);
|
|
12406
12626
|
return {
|
|
12407
12627
|
files,
|
|
12408
12628
|
success: false,
|
|
@@ -12416,7 +12636,7 @@ var vuetifyPlugin = {
|
|
|
12416
12636
|
async rollback(_ctx) {
|
|
12417
12637
|
const backupManager = new BackupManager(_ctx.fsAdapter);
|
|
12418
12638
|
await backupManager.restoreAll();
|
|
12419
|
-
|
|
12639
|
+
logger45.info("Vuetify configuration rolled back");
|
|
12420
12640
|
}
|
|
12421
12641
|
};
|
|
12422
12642
|
function getVuetifyConfig(typescript) {
|
|
@@ -12590,9 +12810,77 @@ function updateViteConfig(content) {
|
|
|
12590
12810
|
return content;
|
|
12591
12811
|
}
|
|
12592
12812
|
|
|
12813
|
+
// src/plugins/ui/skeleton-ui.ts
|
|
12814
|
+
var logger46 = getModuleLogger();
|
|
12815
|
+
var skeletonUiPlugin = {
|
|
12816
|
+
name: "@skeletonlabs/skeleton",
|
|
12817
|
+
displayName: "Skeleton UI",
|
|
12818
|
+
description: "Composants UI l\xE9gers et personnalisables pour Svelte",
|
|
12819
|
+
category: "ui" /* UI */,
|
|
12820
|
+
version: "^2.12.0",
|
|
12821
|
+
frameworks: ["svelte"],
|
|
12822
|
+
requires: ["tailwindcss"],
|
|
12823
|
+
detect: (ctx) => {
|
|
12824
|
+
return ctx.dependencies["@skeletonlabs/skeleton"] !== void 0;
|
|
12825
|
+
},
|
|
12826
|
+
async install(ctx) {
|
|
12827
|
+
if (this.detect?.(ctx)) {
|
|
12828
|
+
logger46.info("Skeleton UI is already installed");
|
|
12829
|
+
return {
|
|
12830
|
+
packages: {},
|
|
12831
|
+
success: true,
|
|
12832
|
+
message: "Skeleton UI already installed"
|
|
12833
|
+
};
|
|
12834
|
+
}
|
|
12835
|
+
try {
|
|
12836
|
+
const packages = ["@skeletonlabs/skeleton", "@skeletonlabs/tw-plugin"];
|
|
12837
|
+
await installPackages(packages, {
|
|
12838
|
+
dev: false,
|
|
12839
|
+
packageManager: ctx.packageManager,
|
|
12840
|
+
projectRoot: ctx.projectRoot,
|
|
12841
|
+
exact: false,
|
|
12842
|
+
silent: false
|
|
12843
|
+
});
|
|
12844
|
+
logger46.info(`Installed ${packages.length} package(s)`);
|
|
12845
|
+
return {
|
|
12846
|
+
packages: {
|
|
12847
|
+
dependencies: packages
|
|
12848
|
+
},
|
|
12849
|
+
success: true,
|
|
12850
|
+
message: "Skeleton UI installed successfully"
|
|
12851
|
+
};
|
|
12852
|
+
} catch (error) {
|
|
12853
|
+
logger46.error(`Failed to install Skeleton UI: ${String(error)}`);
|
|
12854
|
+
return {
|
|
12855
|
+
packages: {},
|
|
12856
|
+
success: false,
|
|
12857
|
+
message: `Installation failed: ${String(error)}`
|
|
12858
|
+
};
|
|
12859
|
+
}
|
|
12860
|
+
},
|
|
12861
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
12862
|
+
async configure(_ctx) {
|
|
12863
|
+
try {
|
|
12864
|
+
logger46.info("Skeleton UI is configured to work with TailwindCSS");
|
|
12865
|
+
return {
|
|
12866
|
+
success: true,
|
|
12867
|
+
message: "Skeleton UI configured successfully",
|
|
12868
|
+
files: []
|
|
12869
|
+
};
|
|
12870
|
+
} catch (error) {
|
|
12871
|
+
logger46.error(`Configuration failed: ${String(error)}`);
|
|
12872
|
+
return {
|
|
12873
|
+
success: false,
|
|
12874
|
+
message: `Configuration failed: ${String(error)}`,
|
|
12875
|
+
files: []
|
|
12876
|
+
};
|
|
12877
|
+
}
|
|
12878
|
+
}
|
|
12879
|
+
};
|
|
12880
|
+
|
|
12593
12881
|
// src/plugins/utils/date-fns.ts
|
|
12594
12882
|
import { join as join43 } from "path";
|
|
12595
|
-
var
|
|
12883
|
+
var logger47 = getModuleLogger();
|
|
12596
12884
|
var dateFnsPlugin = {
|
|
12597
12885
|
name: "date-fns",
|
|
12598
12886
|
displayName: "date-fns",
|
|
@@ -12611,7 +12899,7 @@ var dateFnsPlugin = {
|
|
|
12611
12899
|
*/
|
|
12612
12900
|
async install(ctx) {
|
|
12613
12901
|
if (this.detect?.(ctx)) {
|
|
12614
|
-
|
|
12902
|
+
logger47.info("date-fns is already installed");
|
|
12615
12903
|
return {
|
|
12616
12904
|
packages: {},
|
|
12617
12905
|
success: true,
|
|
@@ -12627,7 +12915,7 @@ var dateFnsPlugin = {
|
|
|
12627
12915
|
exact: false,
|
|
12628
12916
|
silent: false
|
|
12629
12917
|
});
|
|
12630
|
-
|
|
12918
|
+
logger47.info("Successfully installed date-fns");
|
|
12631
12919
|
return {
|
|
12632
12920
|
packages: {
|
|
12633
12921
|
dependencies: packages
|
|
@@ -12636,7 +12924,7 @@ var dateFnsPlugin = {
|
|
|
12636
12924
|
message: `Installed date-fns: ${packages.join(", ")}`
|
|
12637
12925
|
};
|
|
12638
12926
|
} catch (error) {
|
|
12639
|
-
|
|
12927
|
+
logger47.error("Failed to install date-fns:", error);
|
|
12640
12928
|
return {
|
|
12641
12929
|
packages: {},
|
|
12642
12930
|
success: false,
|
|
@@ -12671,14 +12959,14 @@ var dateFnsPlugin = {
|
|
|
12671
12959
|
content: dateUtilsContent,
|
|
12672
12960
|
backup: false
|
|
12673
12961
|
});
|
|
12674
|
-
|
|
12962
|
+
logger47.info(`Created date utilities: ${dateUtilsPath}`);
|
|
12675
12963
|
return {
|
|
12676
12964
|
files,
|
|
12677
12965
|
success: true,
|
|
12678
12966
|
message: "date-fns configured successfully"
|
|
12679
12967
|
};
|
|
12680
12968
|
} catch (error) {
|
|
12681
|
-
|
|
12969
|
+
logger47.error("Failed to configure date-fns:", error);
|
|
12682
12970
|
await backupManager.restoreAll();
|
|
12683
12971
|
return {
|
|
12684
12972
|
files,
|
|
@@ -12694,9 +12982,9 @@ var dateFnsPlugin = {
|
|
|
12694
12982
|
const backupManager = getRollbackManager(_ctx);
|
|
12695
12983
|
try {
|
|
12696
12984
|
await backupManager.restoreAll();
|
|
12697
|
-
|
|
12985
|
+
logger47.info("date-fns configuration rolled back");
|
|
12698
12986
|
} catch (error) {
|
|
12699
|
-
|
|
12987
|
+
logger47.error("Failed to rollback date-fns configuration:", error);
|
|
12700
12988
|
throw error;
|
|
12701
12989
|
}
|
|
12702
12990
|
}
|
|
@@ -12878,7 +13166,7 @@ export function getMinutesDifference(date1, date2) {
|
|
|
12878
13166
|
|
|
12879
13167
|
// src/plugins/utils/vueuse.ts
|
|
12880
13168
|
import { resolve as resolve17, join as join44 } from "path";
|
|
12881
|
-
var
|
|
13169
|
+
var logger48 = getModuleLogger();
|
|
12882
13170
|
var vueusePlugin = {
|
|
12883
13171
|
name: "@vueuse/core",
|
|
12884
13172
|
displayName: "VueUse",
|
|
@@ -12897,7 +13185,7 @@ var vueusePlugin = {
|
|
|
12897
13185
|
*/
|
|
12898
13186
|
async install(ctx) {
|
|
12899
13187
|
if (this.detect?.(ctx)) {
|
|
12900
|
-
|
|
13188
|
+
logger48.info("VueUse is already installed");
|
|
12901
13189
|
return {
|
|
12902
13190
|
packages: {},
|
|
12903
13191
|
success: true,
|
|
@@ -12913,7 +13201,7 @@ var vueusePlugin = {
|
|
|
12913
13201
|
exact: false,
|
|
12914
13202
|
silent: false
|
|
12915
13203
|
});
|
|
12916
|
-
|
|
13204
|
+
logger48.info("Successfully installed VueUse");
|
|
12917
13205
|
return {
|
|
12918
13206
|
packages: {
|
|
12919
13207
|
dependencies: packages
|
|
@@ -12922,7 +13210,7 @@ var vueusePlugin = {
|
|
|
12922
13210
|
message: `Installed ${packages.join(", ")}`
|
|
12923
13211
|
};
|
|
12924
13212
|
} catch (error) {
|
|
12925
|
-
|
|
13213
|
+
logger48.error("Failed to install VueUse:", error);
|
|
12926
13214
|
return {
|
|
12927
13215
|
packages: {},
|
|
12928
13216
|
success: false,
|
|
@@ -12953,14 +13241,14 @@ var vueusePlugin = {
|
|
|
12953
13241
|
content: exampleContent,
|
|
12954
13242
|
backup: false
|
|
12955
13243
|
});
|
|
12956
|
-
|
|
13244
|
+
logger48.info(`Created VueUse example: ${examplePath}`);
|
|
12957
13245
|
return {
|
|
12958
13246
|
files,
|
|
12959
13247
|
success: true,
|
|
12960
13248
|
message: "VueUse configured successfully"
|
|
12961
13249
|
};
|
|
12962
13250
|
} catch (error) {
|
|
12963
|
-
|
|
13251
|
+
logger48.error("Failed to configure VueUse:", error);
|
|
12964
13252
|
return {
|
|
12965
13253
|
files,
|
|
12966
13254
|
success: false,
|
|
@@ -12974,7 +13262,7 @@ var vueusePlugin = {
|
|
|
12974
13262
|
async rollback(_ctx) {
|
|
12975
13263
|
const backupManager = getRollbackManager(_ctx);
|
|
12976
13264
|
await backupManager.restoreAll();
|
|
12977
|
-
|
|
13265
|
+
logger48.info("VueUse configuration rolled back");
|
|
12978
13266
|
}
|
|
12979
13267
|
};
|
|
12980
13268
|
function getExampleContentTS2() {
|
|
@@ -13037,7 +13325,7 @@ export function useExample() {
|
|
|
13037
13325
|
}
|
|
13038
13326
|
|
|
13039
13327
|
// src/plugins/registry.ts
|
|
13040
|
-
var
|
|
13328
|
+
var logger49 = getModuleLogger();
|
|
13041
13329
|
var pluginRegistry = [
|
|
13042
13330
|
// ANIMATION
|
|
13043
13331
|
framerMotionPlugin,
|
|
@@ -13050,6 +13338,7 @@ var pluginRegistry = [
|
|
|
13050
13338
|
// FORMS
|
|
13051
13339
|
reactHookFormPlugin,
|
|
13052
13340
|
zodPlugin,
|
|
13341
|
+
svelteFormsPlugin,
|
|
13053
13342
|
// HTTP
|
|
13054
13343
|
axiosPlugin,
|
|
13055
13344
|
tanstackQueryPlugin,
|
|
@@ -13065,6 +13354,7 @@ var pluginRegistry = [
|
|
|
13065
13354
|
reactRouterPlugin,
|
|
13066
13355
|
tanstackRouterPlugin,
|
|
13067
13356
|
vueRouterPlugin,
|
|
13357
|
+
svelteKitPlugin,
|
|
13068
13358
|
// STATE
|
|
13069
13359
|
jotaiPlugin,
|
|
13070
13360
|
piniaPlugin,
|
|
@@ -13074,6 +13364,7 @@ var pluginRegistry = [
|
|
|
13074
13364
|
reactTestingLibraryPlugin,
|
|
13075
13365
|
vueTestingLibraryPlugin,
|
|
13076
13366
|
vueTestUtilsPlugin,
|
|
13367
|
+
svelteTestingLibraryPlugin,
|
|
13077
13368
|
// TOOLING
|
|
13078
13369
|
eslintPlugin,
|
|
13079
13370
|
eslintVuePlugin,
|
|
@@ -13092,6 +13383,7 @@ var pluginRegistry = [
|
|
|
13092
13383
|
shadcnUiPlugin,
|
|
13093
13384
|
shadcnUiNextjsPlugin,
|
|
13094
13385
|
vuetifyPlugin,
|
|
13386
|
+
skeletonUiPlugin,
|
|
13095
13387
|
// UTILS
|
|
13096
13388
|
dateFnsPlugin,
|
|
13097
13389
|
vueusePlugin
|
|
@@ -13107,14 +13399,14 @@ function validatePlugin(plugin) {
|
|
|
13107
13399
|
];
|
|
13108
13400
|
for (const field of requiredFields) {
|
|
13109
13401
|
if (!(field in plugin) || plugin[field] === void 0) {
|
|
13110
|
-
|
|
13402
|
+
logger49.error(`Plugin validation failed: missing field '${field}'`, {
|
|
13111
13403
|
plugin: plugin.name
|
|
13112
13404
|
});
|
|
13113
13405
|
return false;
|
|
13114
13406
|
}
|
|
13115
13407
|
}
|
|
13116
13408
|
if (!Object.values(Category).includes(plugin.category)) {
|
|
13117
|
-
|
|
13409
|
+
logger49.error(
|
|
13118
13410
|
`Plugin validation failed: invalid category '${plugin.category}'`,
|
|
13119
13411
|
{
|
|
13120
13412
|
plugin: plugin.name
|
|
@@ -13123,7 +13415,7 @@ function validatePlugin(plugin) {
|
|
|
13123
13415
|
return false;
|
|
13124
13416
|
}
|
|
13125
13417
|
if (!Array.isArray(plugin.frameworks) || plugin.frameworks.length === 0) {
|
|
13126
|
-
|
|
13418
|
+
logger49.error(
|
|
13127
13419
|
`Plugin validation failed: 'frameworks' must be a non-empty array`,
|
|
13128
13420
|
{
|
|
13129
13421
|
plugin: plugin.name
|
|
@@ -13132,13 +13424,13 @@ function validatePlugin(plugin) {
|
|
|
13132
13424
|
return false;
|
|
13133
13425
|
}
|
|
13134
13426
|
if (typeof plugin.install !== "function") {
|
|
13135
|
-
|
|
13427
|
+
logger49.error(`Plugin validation failed: 'install' must be a function`, {
|
|
13136
13428
|
plugin: plugin.name
|
|
13137
13429
|
});
|
|
13138
13430
|
return false;
|
|
13139
13431
|
}
|
|
13140
13432
|
if (typeof plugin.configure !== "function") {
|
|
13141
|
-
|
|
13433
|
+
logger49.error(`Plugin validation failed: 'configure' must be a function`, {
|
|
13142
13434
|
plugin: plugin.name
|
|
13143
13435
|
});
|
|
13144
13436
|
return false;
|
|
@@ -13156,7 +13448,7 @@ function validateRegistry(plugins) {
|
|
|
13156
13448
|
}
|
|
13157
13449
|
}
|
|
13158
13450
|
if (invalidPlugins.length > 0) {
|
|
13159
|
-
|
|
13451
|
+
logger49.warn(`Some plugins failed validation and were excluded:`, {
|
|
13160
13452
|
invalidPlugins,
|
|
13161
13453
|
total: plugins.length,
|
|
13162
13454
|
valid: validPlugins.length
|