create-absolutejs 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { PackageManager } from '../types';
|
|
1
2
|
type FormatProjectProps = {
|
|
2
3
|
projectName: string;
|
|
3
|
-
packageManager:
|
|
4
|
+
packageManager: PackageManager;
|
|
5
|
+
installDependenciesNow: boolean;
|
|
4
6
|
};
|
|
5
|
-
export declare const formatProject: ({ projectName, packageManager }: FormatProjectProps) => void;
|
|
7
|
+
export declare const formatProject: ({ projectName, packageManager, installDependenciesNow }: FormatProjectProps) => void;
|
|
6
8
|
export {};
|
|
@@ -2,11 +2,13 @@ import { execSync } from 'child_process';
|
|
|
2
2
|
import { exit } from 'process';
|
|
3
3
|
import { spinner } from '@clack/prompts';
|
|
4
4
|
import { green, red } from 'picocolors';
|
|
5
|
-
import { formatCommands } from '../utils/commandMaps';
|
|
6
|
-
export const formatProject = ({ projectName, packageManager }) => {
|
|
5
|
+
import { formatCommands, formatNoInstallCommands } from '../utils/commandMaps';
|
|
6
|
+
export const formatProject = ({ projectName, packageManager, installDependenciesNow }) => {
|
|
7
7
|
const spin = spinner();
|
|
8
8
|
try {
|
|
9
|
-
const fmt =
|
|
9
|
+
const fmt = installDependenciesNow
|
|
10
|
+
? formatCommands[packageManager]
|
|
11
|
+
: formatNoInstallCommands[packageManager];
|
|
10
12
|
spin.start('Formatting files…');
|
|
11
13
|
execSync(fmt, { cwd: projectName, stdio: 'pipe' });
|
|
12
14
|
spin.stop(green('Files formatted'));
|
package/dist/scaffold.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { PackageManager } from '../types';
|
|
2
|
+
export declare const formatCommands: Record<PackageManager, string>;
|
|
3
|
+
export declare const formatNoInstallCommands: Record<PackageManager, string>;
|
|
2
4
|
export declare const installCommands: Record<string, string>;
|
|
@@ -4,6 +4,12 @@ export const formatCommands = {
|
|
|
4
4
|
pnpm: 'pnpm run format',
|
|
5
5
|
yarn: 'yarn format'
|
|
6
6
|
};
|
|
7
|
+
export const formatNoInstallCommands = {
|
|
8
|
+
bun: 'bunx prettier --write "./**/*.{js,ts,css,json,mjs,md,jsx,tsx,svelte,vue}"',
|
|
9
|
+
npm: 'npx prettier --write "./**/*.{js,ts,css,json,mjs,md,jsx,tsx,svelte,vue}"',
|
|
10
|
+
pnpm: 'pnpm dlx prettier --write "./**/*.{js,ts,css,json,mjs,md,jsx,tsx,svelte,vue}"',
|
|
11
|
+
yarn: 'yarn dlx prettier --write "./**/*.{js,ts,css,json,mjs,md,jsx,tsx,svelte,vue}"'
|
|
12
|
+
};
|
|
7
13
|
export const installCommands = {
|
|
8
14
|
bun: 'bun install',
|
|
9
15
|
npm: 'npm install',
|
package/package.json
CHANGED