@futurebrand/dev-tools 2.1.2 → 2.4.0

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.
Files changed (69) hide show
  1. package/dist/bin.js +11 -0
  2. package/dist/commands/ai/add.d.ts +3 -0
  3. package/dist/commands/ai/add.js +46 -0
  4. package/dist/commands/ai/generate.d.ts +3 -0
  5. package/dist/commands/ai/generate.js +75 -0
  6. package/dist/commands/ai/index.d.ts +3 -0
  7. package/dist/commands/ai/index.js +43 -0
  8. package/dist/commands/ai/modules/figma/api.d.ts +8 -0
  9. package/dist/commands/ai/modules/figma/api.js +22 -0
  10. package/dist/commands/ai/modules/figma/index.d.ts +10 -0
  11. package/dist/commands/ai/modules/figma/index.js +95 -0
  12. package/dist/commands/ai/modules/figma/types.d.ts +40 -0
  13. package/dist/commands/ai/modules/generator/index.d.ts +17 -0
  14. package/dist/commands/ai/modules/generator/index.js +184 -0
  15. package/dist/commands/ai/modules/project-adder/index.d.ts +10 -0
  16. package/dist/commands/ai/modules/project-adder/index.js +78 -0
  17. package/dist/commands/ai/modules/state/index.d.ts +23 -0
  18. package/dist/commands/ai/modules/state/index.js +133 -0
  19. package/dist/commands/ai/modules/state/types.d.ts +29 -0
  20. package/dist/commands/ai/modules/state/types.js +2 -0
  21. package/dist/commands/ai/remove.d.ts +3 -0
  22. package/dist/commands/ai/remove.js +42 -0
  23. package/dist/commands/index.d.ts +7 -0
  24. package/dist/commands/index.js +21 -0
  25. package/dist/{bin/commands → commands}/project-setup/configs.d.ts +1 -1
  26. package/dist/{bin/commands → commands}/project-setup/configs.js +1 -0
  27. package/dist/commands/project-setup/index.js +22 -0
  28. package/dist/commands/project-setup/utils/files.d.ts +2 -0
  29. package/dist/commands/project-setup/utils/files.js +21 -0
  30. package/dist/commands/project-setup/utils/lint.d.ts +3 -0
  31. package/dist/commands/project-setup/utils/lint.js +22 -0
  32. package/dist/commands/project-setup/utils/packages.d.ts +5 -0
  33. package/dist/{bin/commands/project-setup/modules → commands/project-setup/utils}/packages.js +17 -8
  34. package/dist/modules/parallel/index.d.ts +16 -0
  35. package/dist/modules/parallel/index.js +50 -0
  36. package/dist/plugins/eslint/configs/configs.d.mts +1 -1
  37. package/dist/plugins/eslint/configs/configs.mjs +1 -1
  38. package/dist/plugins/eslint/node.mjs +1 -1
  39. package/dist/plugins/prettier/prettier.d.mts +7 -5
  40. package/dist/types/project.d.ts +20 -0
  41. package/dist/types/project.js +2 -0
  42. package/dist/utils/files.d.ts +10 -0
  43. package/dist/utils/files.js +84 -0
  44. package/dist/utils/package-manager.d.ts +4 -0
  45. package/dist/utils/package-manager.js +40 -0
  46. package/dist/utils/project-type.d.ts +2 -0
  47. package/dist/utils/project-type.js +66 -0
  48. package/dist/utils/project.d.ts +2 -0
  49. package/dist/utils/project.js +43 -0
  50. package/dist/utils/sleep.d.ts +1 -0
  51. package/dist/utils/sleep.js +6 -0
  52. package/package.json +25 -22
  53. package/dist/bin/commands/index.d.ts +0 -2
  54. package/dist/bin/commands/index.js +0 -7
  55. package/dist/bin/commands/project-setup/index.js +0 -22
  56. package/dist/bin/commands/project-setup/modules/files.d.ts +0 -2
  57. package/dist/bin/commands/project-setup/modules/files.js +0 -29
  58. package/dist/bin/commands/project-setup/modules/packages.d.ts +0 -3
  59. package/dist/bin/index.js +0 -20
  60. package/dist/bin/modules/files.d.ts +0 -6
  61. package/dist/bin/modules/files.js +0 -68
  62. package/dist/bin/modules/package-manager.d.ts +0 -1
  63. package/dist/bin/modules/package-manager.js +0 -15
  64. package/dist/bin/modules/project-type.d.ts +0 -2
  65. package/dist/bin/modules/project-type.js +0 -36
  66. package/dist/bin/types.d.ts +0 -8
  67. /package/dist/{bin/index.d.ts → bin.d.ts} +0 -0
  68. /package/dist/{bin → commands/ai/modules/figma}/types.js +0 -0
  69. /package/dist/{bin/commands → commands}/project-setup/index.d.ts +0 -0
@@ -0,0 +1,23 @@
1
+ import type { IAIFileState, IAvailableFilters } from './types';
2
+ declare class AIState {
3
+ private filePath;
4
+ private data;
5
+ constructor();
6
+ private createOptions;
7
+ create(): Promise<void>;
8
+ fetchApi<T = any>(path: string, init?: RequestInit): Promise<T>;
9
+ init(): Promise<void>;
10
+ save(): Promise<void>;
11
+ get isReady(): boolean;
12
+ getData(): IAIFileState;
13
+ getAvailableBlocks({ generated, hidden }?: IAvailableFilters): import("./types").IBlockData[];
14
+ getAvailableBlocksNames(filters?: IAvailableFilters): string[];
15
+ setBlocks(blocks: IAIFileState['blocks']): void;
16
+ setVariables(variables: IAIFileState['variables']): void;
17
+ setColors(colors: IAIFileState['colors']): void;
18
+ setBlockGenerated(blockName: string, generated?: boolean): void;
19
+ getBlockVariants(blockName: string): any[];
20
+ setBlockHidden(blockName: string, hidden?: boolean): void;
21
+ static init(): Promise<AIState>;
22
+ }
23
+ export default AIState;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const project_1 = require("../../../../utils/project");
4
+ const inquirer_1 = require("inquirer");
5
+ const files_1 = require("../../../../utils/files");
6
+ const FILE_NAME = 'ai-state.json';
7
+ class AIState {
8
+ filePath = '';
9
+ data = null;
10
+ constructor() { }
11
+ async createOptions() {
12
+ const query = await inquirer_1.default.prompt([
13
+ {
14
+ type: 'input',
15
+ name: 'apiUrl',
16
+ message: 'What is the AI API url?',
17
+ },
18
+ {
19
+ type: 'input',
20
+ name: 'apiToken',
21
+ message: 'What is the AI API token?',
22
+ },
23
+ {
24
+ type: 'input',
25
+ name: 'page',
26
+ message: 'What is the Figma Page ID?',
27
+ },
28
+ ]);
29
+ const projects = await (0, project_1.getProjects)();
30
+ return {
31
+ configs: {
32
+ api: query.apiUrl,
33
+ token: query.apiToken,
34
+ figma: query.page,
35
+ },
36
+ projects,
37
+ blocks: [],
38
+ variables: {},
39
+ };
40
+ }
41
+ async create() {
42
+ this.data = await this.createOptions();
43
+ }
44
+ async fetchApi(path, init) {
45
+ let apiUrl = this.getData().configs.api;
46
+ if (apiUrl.endsWith('/')) {
47
+ apiUrl = apiUrl.slice(0, -1);
48
+ }
49
+ const response = await fetch(`${apiUrl}${path}`, {
50
+ ...init,
51
+ headers: {
52
+ 'Content-Type': 'application/json',
53
+ Authorization: `Bearer ${this.getData().configs.token}`,
54
+ ...init?.headers,
55
+ },
56
+ });
57
+ if (!response.ok) {
58
+ throw new Error(`Failed to fetch ${path}`);
59
+ }
60
+ const data = await response.json();
61
+ return data;
62
+ }
63
+ async init() {
64
+ this.filePath = await (0, files_1.getTempFilePath)(FILE_NAME);
65
+ if (await (0, files_1.verifyPath)(this.filePath)) {
66
+ this.data = await (0, files_1.loadJSONFile)(this.filePath);
67
+ }
68
+ }
69
+ async save() {
70
+ await (0, files_1.writeJSONFile)(this.filePath, this.data);
71
+ }
72
+ get isReady() {
73
+ return this.data !== null;
74
+ }
75
+ getData() {
76
+ if (!this.data) {
77
+ throw new Error('AI State not initialized');
78
+ }
79
+ return this.data;
80
+ }
81
+ getAvailableBlocks({ generated, hidden } = {}) {
82
+ let blocks = this.getData().blocks;
83
+ if (hidden != null || generated != null) {
84
+ blocks = blocks.filter((block) => {
85
+ if (hidden != null && block.hidden !== hidden) {
86
+ return false;
87
+ }
88
+ if (generated != null && block.generated !== generated) {
89
+ return false;
90
+ }
91
+ return true;
92
+ });
93
+ }
94
+ return blocks;
95
+ }
96
+ getAvailableBlocksNames(filters = {}) {
97
+ const blocks = this.getAvailableBlocks(filters);
98
+ return blocks.map((block) => block.name);
99
+ }
100
+ setBlocks(blocks) {
101
+ this.data.blocks = blocks;
102
+ }
103
+ setVariables(variables) {
104
+ this.data.variables = variables;
105
+ }
106
+ setColors(colors) {
107
+ this.data.colors = colors;
108
+ }
109
+ setBlockGenerated(blockName, generated = true) {
110
+ const blocks = this.getData().blocks;
111
+ const block = blocks.find((block) => block.name === blockName);
112
+ if (block) {
113
+ block.generated = generated;
114
+ }
115
+ }
116
+ getBlockVariants(blockName) {
117
+ const blocks = this.getData().blocks.find((block) => block.name === blockName);
118
+ return blocks?.variants || [];
119
+ }
120
+ setBlockHidden(blockName, hidden = true) {
121
+ const blocks = this.getData().blocks;
122
+ const block = blocks.find((block) => block.name === blockName);
123
+ if (block) {
124
+ block.hidden = hidden;
125
+ }
126
+ }
127
+ static async init() {
128
+ const state = new AIState();
129
+ await state.init();
130
+ return state;
131
+ }
132
+ }
133
+ exports.default = AIState;
@@ -0,0 +1,29 @@
1
+ import type { IProject } from '../../../../types/project';
2
+ import type { IFigmaNode } from '../figma/types';
3
+ export interface IStateConfigs {
4
+ api: string;
5
+ token: string;
6
+ figma: string;
7
+ }
8
+ export interface IBlockData {
9
+ name: string;
10
+ hidden: boolean;
11
+ generated: boolean;
12
+ variants: IFigmaNode[];
13
+ }
14
+ export interface IProjectColor {
15
+ name: string;
16
+ value: string;
17
+ description: string;
18
+ }
19
+ export interface IAvailableFilters {
20
+ hidden?: boolean;
21
+ generated?: boolean;
22
+ }
23
+ export interface IAIFileState {
24
+ configs: IStateConfigs;
25
+ blocks: IBlockData[];
26
+ projects: IProject[];
27
+ variables: Record<string, any>;
28
+ colors?: IProjectColor[];
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ declare const removeCommand: Command;
3
+ export default removeCommand;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const commander_1 = require("commander");
4
+ const inquirer_1 = require("inquirer");
5
+ const state_1 = require("./modules/state");
6
+ const removeCommand = new commander_1.Command('remove')
7
+ .alias('rm')
8
+ .alias('hide')
9
+ .description('Remove Blocks From block list')
10
+ .action(async () => {
11
+ const state = await state_1.default.init();
12
+ if (!state.isReady) {
13
+ console.error('AI State not initialized');
14
+ console.error('Run "fub ai --init" first');
15
+ return;
16
+ }
17
+ const choices = state.getAvailableBlocksNames({
18
+ hidden: false,
19
+ });
20
+ if (!choices.length) {
21
+ console.error('No blocks available to remove');
22
+ return;
23
+ }
24
+ const blockQuery = await inquirer_1.default.prompt([
25
+ {
26
+ type: 'checkbox',
27
+ name: 'blocks',
28
+ message: 'Select the blocks to delete',
29
+ choices,
30
+ },
31
+ ]);
32
+ const blocksToGenerate = blockQuery.blocks;
33
+ if (!blocksToGenerate.length) {
34
+ console.error('No blocks selected');
35
+ return;
36
+ }
37
+ for (const block of blocksToGenerate) {
38
+ state.setBlockHidden(block, true);
39
+ }
40
+ await state.save();
41
+ });
42
+ exports.default = removeCommand;
@@ -0,0 +1,7 @@
1
+ import type { Command } from 'commander';
2
+ interface CLIOptions {
3
+ version: string;
4
+ description: string;
5
+ }
6
+ export declare function addCommands(program: Command, cli: CLIOptions): void;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addCommands = addCommands;
4
+ const ai_1 = require("./ai");
5
+ const project_setup_1 = require("./project-setup");
6
+ function addCommands(program, cli) {
7
+ program
8
+ .version(cli.version)
9
+ .description(cli.description)
10
+ .option('-n, --name <type>', 'Add your name')
11
+ .action((options) => {
12
+ if (options.name) {
13
+ console.warn(`Hello ${options.name}!`);
14
+ }
15
+ else {
16
+ console.warn('Hello Futurebrand!');
17
+ }
18
+ });
19
+ program.addCommand(project_setup_1.default);
20
+ program.addCommand(ai_1.default);
21
+ }
@@ -1,4 +1,4 @@
1
- import type { ProjectType } from '../../types';
1
+ import type { ProjectType } from '../../types/project';
2
2
  export declare const UNUSED_FILES: string[];
3
3
  export declare const ESLINT_CONFIG_FILE = "eslint.config.mjs";
4
4
  export declare const PRETTIER_CONFIG_FILE = "prettier.config.mjs";
@@ -15,6 +15,7 @@ exports.PRETTIER_PLUGIN_NAME = 'PrettierConfig';
15
15
  exports.ESLINT_PLUGIN_NAMES = {
16
16
  'next.js': 'EslintNextjsConfigs',
17
17
  react: 'EslintReactjsConfigs',
18
+ strapi: 'EslintNodeConfigs',
18
19
  node: 'EslintNodeConfigs',
19
20
  };
20
21
  exports.DEV_DEPENDENCIES = [
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /* eslint-disable no-console */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const project_1 = require("../../utils/project");
6
+ const files_1 = require("./utils/files");
7
+ const lint_1 = require("./utils/lint");
8
+ const packages_1 = require("./utils/packages");
9
+ const projectSetup = new commander_1.Command('setup')
10
+ .description('Setup project with default configurations')
11
+ .action(async () => {
12
+ const projects = await (0, project_1.getProjects)();
13
+ for (const project of projects) {
14
+ console.log(`### Setting up ${project.name}...`);
15
+ console.log(`- Project path: ${project.relativePath}`);
16
+ console.log(`- Project type: ${String(project.type)}`);
17
+ await (0, files_1.deleteProjectUnusedFiles)(project);
18
+ await (0, lint_1.handleProjectLinters)(project);
19
+ await (0, packages_1.handleProjectDependencies)(project);
20
+ }
21
+ });
22
+ exports.default = projectSetup;
@@ -0,0 +1,2 @@
1
+ import type { IProject } from '../../../types/project';
2
+ export declare function deleteProjectUnusedFiles(project: IProject): Promise<void>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteProjectUnusedFiles = deleteProjectUnusedFiles;
4
+ const fs = require("node:fs/promises");
5
+ const files_1 = require("../../../utils/files");
6
+ const path = require("path");
7
+ const configs_1 = require("../configs");
8
+ async function deleteProjectUnusedFiles(project) {
9
+ for (const file of configs_1.UNUSED_FILES) {
10
+ const filePath = path.join(project.path, file);
11
+ try {
12
+ if (await (0, files_1.verifyPath)(filePath)) {
13
+ await fs.unlink(filePath);
14
+ }
15
+ }
16
+ catch (error) {
17
+ console.error(`Failed to delete ${filePath}`);
18
+ throw error;
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ import type { IProject } from '../../../types/project';
2
+ export declare function getPluginConfig(pluginImportName: string): string;
3
+ export declare function handleProjectLinters(project: IProject): Promise<void>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPluginConfig = getPluginConfig;
4
+ exports.handleProjectLinters = handleProjectLinters;
5
+ const path = require("path");
6
+ const files_1 = require("../../../utils/files");
7
+ const configs_1 = require("../configs");
8
+ function getPluginConfig(pluginImportName) {
9
+ return `import { ${pluginImportName} } from '@futurebrand/dev-tools/plugins'
10
+
11
+ export default ${pluginImportName}`;
12
+ }
13
+ async function handleProjectLinters(project) {
14
+ const projectType = project.type;
15
+ const eslintConfigName = configs_1.ESLINT_PLUGIN_NAMES[projectType];
16
+ const eslintConfig = getPluginConfig(eslintConfigName);
17
+ const prettierConfig = getPluginConfig(configs_1.PRETTIER_PLUGIN_NAME);
18
+ const eslintConfigPath = path.join(project.path, configs_1.ESLINT_CONFIG_FILE);
19
+ const prettierConfigPath = path.join(project.path, configs_1.PRETTIER_CONFIG_FILE);
20
+ await (0, files_1.writeFile)(eslintConfigPath, eslintConfig);
21
+ await (0, files_1.writeFile)(prettierConfigPath, prettierConfig);
22
+ }
@@ -0,0 +1,5 @@
1
+ import type { IProject } from '../../../types/project';
2
+ export declare function removeEslintDependencies(dependencies: Record<string, string>): void;
3
+ export declare function removeUnusedPackages(project: IProject): Promise<void>;
4
+ export declare function installDependencies(project: IProject): Promise<void>;
5
+ export declare function handleProjectDependencies(project: IProject): Promise<void>;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeEslintDependencies = removeEslintDependencies;
4
4
  exports.removeUnusedPackages = removeUnusedPackages;
5
5
  exports.installDependencies = installDependencies;
6
- const files_1 = require("../../../modules/files");
7
- const package_manager_1 = require("../../../modules/package-manager");
6
+ exports.handleProjectDependencies = handleProjectDependencies;
7
+ const package_manager_1 = require("../../../utils/package-manager");
8
8
  const child_process_1 = require("child_process");
9
9
  const configs_1 = require("../configs");
10
10
  function removeEslintDependencies(dependencies) {
@@ -16,8 +16,11 @@ function removeEslintDependencies(dependencies) {
16
16
  }
17
17
  }
18
18
  }
19
- async function removeUnusedPackages() {
20
- const PackageJson = await (0, files_1.loadPackageJson)();
19
+ async function removeUnusedPackages(project) {
20
+ const PackageJson = await (0, package_manager_1.loadPackageJson)(project.path);
21
+ if (!PackageJson) {
22
+ return;
23
+ }
21
24
  removeEslintDependencies(PackageJson.devDependencies);
22
25
  removeEslintDependencies(PackageJson.dependencies);
23
26
  for (const dependency of configs_1.DEV_DEPENDENCIES) {
@@ -30,17 +33,23 @@ async function removeUnusedPackages() {
30
33
  PackageJson.devDependencies[dependency] = 'latest';
31
34
  }
32
35
  }
33
- await (0, files_1.writePackageJson)(PackageJson);
36
+ await (0, package_manager_1.writePackageJson)(project.path, PackageJson);
34
37
  }
35
- async function installDependencies() {
36
- const packageManager = await (0, package_manager_1.getPackageManager)();
37
- const command = `${packageManager} install`;
38
+ async function installDependencies(project) {
39
+ const packageManager = await (0, package_manager_1.getPackageManager)(project.path);
40
+ const command = `cd ${project.relativePath} && ${packageManager} install`;
38
41
  return new Promise((resolve, reject) => {
39
42
  (0, child_process_1.exec)(command, (error) => {
40
43
  if (error) {
44
+ console.error(`Failed to install dependencies for ${project.name}`);
45
+ console.error(`Please run "${packageManager} install" manually`);
41
46
  reject(error);
42
47
  }
43
48
  resolve();
44
49
  });
45
50
  });
46
51
  }
52
+ async function handleProjectDependencies(project) {
53
+ await removeUnusedPackages(project);
54
+ await installDependencies(project);
55
+ }
@@ -0,0 +1,16 @@
1
+ type ParallelCallback = () => Promise<void>;
2
+ type CycleCallback = (index: number, total: number) => void;
3
+ declare class ParallelModule {
4
+ private readonly parallelCalls;
5
+ private promises;
6
+ private running;
7
+ private index;
8
+ constructor(parallelCalls: number);
9
+ add(callback: ParallelCallback): void;
10
+ private next;
11
+ private wait;
12
+ get total(): number;
13
+ execute(callback: CycleCallback): Promise<void>;
14
+ reset(): void;
15
+ }
16
+ export default ParallelModule;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sleep_1 = require("../../utils/sleep");
4
+ class ParallelModule {
5
+ parallelCalls;
6
+ promises;
7
+ running;
8
+ index;
9
+ constructor(parallelCalls) {
10
+ this.parallelCalls = parallelCalls;
11
+ this.promises = [];
12
+ this.running = 0;
13
+ this.index = 0;
14
+ }
15
+ add(callback) {
16
+ this.promises.push(callback);
17
+ }
18
+ async next(callback) {
19
+ const promise = this.promises.shift();
20
+ if (promise) {
21
+ this.running++;
22
+ await promise();
23
+ this.running--;
24
+ }
25
+ this.index++;
26
+ callback(this.index, this.total);
27
+ }
28
+ async wait() {
29
+ while (this.running >= this.parallelCalls) {
30
+ await (0, sleep_1.sleep)(0);
31
+ }
32
+ }
33
+ get total() {
34
+ return this.promises.length;
35
+ }
36
+ async execute(callback) {
37
+ while (this.promises.length > 0) {
38
+ if (this.running >= this.parallelCalls) {
39
+ await this.wait();
40
+ }
41
+ void this.next(callback);
42
+ }
43
+ }
44
+ reset() {
45
+ this.promises = [];
46
+ this.running = 0;
47
+ this.index = 0;
48
+ }
49
+ }
50
+ exports.default = ParallelModule;
@@ -1,5 +1,5 @@
1
1
  import { type ConfigArray } from 'typescript-eslint';
2
- export declare const MAX_COMPLEXITY = 15;
2
+ export declare const MAX_COMPLEXITY = 20;
3
3
  export declare const MAX_LINES = 450;
4
4
  interface IConfigParams {
5
5
  node?: boolean;
@@ -2,7 +2,7 @@ import pluginJs from '@eslint/js';
2
2
  import prettierRecommended from 'eslint-plugin-prettier/recommended';
3
3
  import globals from 'globals';
4
4
  import tseslint from 'typescript-eslint';
5
- export const MAX_COMPLEXITY = 15;
5
+ export const MAX_COMPLEXITY = 20;
6
6
  export const MAX_LINES = 450;
7
7
  export function getBaseConfig({ node = false, browser = false, typescript = true, prettier = true, }) {
8
8
  const configs = [];
@@ -23,6 +23,6 @@ export const EslintNodeConfigs = tseslint.config([
23
23
  },
24
24
  },
25
25
  {
26
- ignores: ['strapi/**/*', 'types/generated/**/*'],
26
+ ignores: ['strapi/**/*', '.strapi/**/*', 'types/generated/**/*'],
27
27
  },
28
28
  ]);
@@ -24,13 +24,14 @@ export declare const NextjsPrettierConfigs: {
24
24
  filepath?: string | undefined;
25
25
  requirePragma?: boolean | undefined;
26
26
  insertPragma?: boolean | undefined;
27
+ checkIgnorePragma?: boolean | undefined;
27
28
  proseWrap?: "always" | "never" | "preserve" | undefined;
28
29
  arrowParens?: "always" | "avoid" | undefined;
29
- htmlWhitespaceSensitivity?: "ignore" | "css" | "strict" | undefined;
30
+ htmlWhitespaceSensitivity?: "css" | "ignore" | "strict" | undefined;
30
31
  endOfLine?: "auto" | "lf" | "crlf" | "cr" | undefined;
31
32
  quoteProps?: "preserve" | "as-needed" | "consistent" | undefined;
32
33
  vueIndentScriptAndStyle?: boolean | undefined;
33
- embeddedLanguageFormatting?: "off" | "auto" | undefined;
34
+ embeddedLanguageFormatting?: "auto" | "off" | undefined;
34
35
  singleAttributePerLine?: boolean | undefined;
35
36
  experimentalOperatorPosition?: "start" | "end" | undefined;
36
37
  experimentalTernaries?: boolean | undefined;
@@ -61,14 +62,15 @@ export declare const NodePrettierConfigs: {
61
62
  filepath?: string | undefined;
62
63
  requirePragma?: boolean | undefined;
63
64
  insertPragma?: boolean | undefined;
65
+ checkIgnorePragma?: boolean | undefined;
64
66
  proseWrap?: "always" | "never" | "preserve" | undefined;
65
67
  arrowParens?: "always" | "avoid" | undefined;
66
- plugins?: (string | import("prettier").Plugin<any>)[] | undefined;
67
- htmlWhitespaceSensitivity?: "ignore" | "css" | "strict" | undefined;
68
+ plugins?: (string | URL | import("prettier").Plugin<any>)[] | undefined;
69
+ htmlWhitespaceSensitivity?: "css" | "ignore" | "strict" | undefined;
68
70
  endOfLine?: "auto" | "lf" | "crlf" | "cr" | undefined;
69
71
  quoteProps?: "preserve" | "as-needed" | "consistent" | undefined;
70
72
  vueIndentScriptAndStyle?: boolean | undefined;
71
- embeddedLanguageFormatting?: "off" | "auto" | undefined;
73
+ embeddedLanguageFormatting?: "auto" | "off" | undefined;
72
74
  singleAttributePerLine?: boolean | undefined;
73
75
  experimentalOperatorPosition?: "start" | "end" | undefined;
74
76
  experimentalTernaries?: boolean | undefined;
@@ -0,0 +1,20 @@
1
+ export type ProjectType = 'next.js' | 'react' | 'strapi' | 'node';
2
+ interface IDefaultProject {
3
+ name: string;
4
+ path: string;
5
+ relativePath: string;
6
+ type: ProjectType;
7
+ }
8
+ interface NextProject extends IDefaultProject {
9
+ type: 'next.js';
10
+ appDir: boolean;
11
+ }
12
+ export type IProject = NextProject | IDefaultProject;
13
+ export interface PackageJson {
14
+ name: string;
15
+ version: string;
16
+ scripts: Record<string, string>;
17
+ devDependencies: Record<string, string>;
18
+ dependencies: Record<string, string>;
19
+ }
20
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ export declare function verifyPath(filePath: string): Promise<boolean>;
2
+ export declare function verifyAndCreateFolder(folderPath: string): Promise<void>;
3
+ export declare function getRootPath(...paths: string[]): string;
4
+ export declare function getTempFolder(): Promise<string>;
5
+ export declare function getTempFilePath(...fileName: string[]): Promise<string>;
6
+ export declare function loadJSONFile<T = any>(filePath: string): Promise<T>;
7
+ export declare function writeJSONFile(filePath: string, data: unknown): Promise<void>;
8
+ export declare function writeRootFile(fileName: string, content: string): Promise<void>;
9
+ export declare function writeFile(filePath: string, content: string): Promise<void>;
10
+ export declare function loadFile(filePath: string): Promise<string>;