🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@fedify/init

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fedify/init - npm Package Compare versions

Comparing version
2.3.0-dev.1273
to
2.3.0-dev.1274
+3
-1
dist/action/mod.d.ts

@@ -16,3 +16,5 @@ import { InitCommand } from "../command.js";

* - If dry run, executes `handleDryRun`.
* - Otherwise, executes `handleHydRun`.
* - Otherwise, executes `handleHydRun`, which installs dependencies, or—when
* `--skip-install` is set—prints how to install them manually via
* `noticeSkippedInstall`.
* 7. Recommends configuration environment via `recommendConfigEnv`.

@@ -19,0 +21,0 @@ * 8. Shows how to run the project via `noticeHowToRun`.

import { set } from "../utils.js";
import askOptions from "../ask/mod.js";
import { makeDirIfHyd } from "./dir.js";
import { drawDinosaur, noticeHowToRun, noticeOptions, noticePrecommand } from "./notice.js";
import { drawDinosaur, noticeHowToRun, noticeOptions, noticePrecommand, noticeSkippedInstall } from "./notice.js";
import recommendConfigEnv from "./env.js";
import { hasCommand, installDependencies, isDry, runPrecommand } from "./utils.js";
import { hasCommand, installDependencies, isDry, isSkipInstall, runPrecommand } from "./utils.js";
import { assertNoGeneratedFileConflicts, patchFiles, recommendPatchFiles } from "./patch.js";

@@ -24,3 +24,5 @@ import recommendDependencies from "./recommend.js";

* - If dry run, executes `handleDryRun`.
* - Otherwise, executes `handleHydRun`.
* - Otherwise, executes `handleHydRun`, which installs dependencies, or—when
* `--skip-install` is set—prints how to install them manually via
* `noticeSkippedInstall`.
* 7. Recommends configuration environment via `recommendConfigEnv`.

@@ -32,4 +34,4 @@ * 8. Shows how to run the project via `noticeHowToRun`.

const handleDryRun = (data) => pipe(data, tap(when(hasCommand, noticePrecommand)), tap(recommendPatchFiles), tap(recommendDependencies));
const handleHydRun = (data) => pipe(data, tap(makeDirIfHyd), tap(assertNoGeneratedFileConflicts), tap(when(hasCommand, runPrecommand)), tap(patchFiles), tap(installDependencies));
const handleHydRun = (data) => pipe(data, tap(makeDirIfHyd), tap(assertNoGeneratedFileConflicts), tap(when(hasCommand, runPrecommand)), tap(patchFiles), tap(unless(isSkipInstall, installDependencies)), tap(when(isSkipInstall, noticeSkippedInstall)));
//#endregion
export { runInit as default };
import { colors, printMessage } from "../utils.js";
import { flow } from "es-toolkit";
import { text } from "@optique/core";
import { commandLine, text } from "@optique/core";
//#region src/action/notice.ts

@@ -70,3 +70,7 @@ /** Prints the Feddy ASCII art banner to stderr. */

`;
/** Prints a notice that dependency installation was skipped and how to install them manually. */
const noticeSkippedInstall = ({ packageManager }) => printMessage`
Dependencies were not installed. Run ${commandLine(`${packageManager} install`)} in the project directory to install them.
`;
//#endregion
export { displayFile, drawDinosaur, noticeConfigEnv, noticeDeps, noticeDepsIfExist, noticeDevDepsIfExist, noticeEnvKeyValue, noticeFilesToCreate, noticeFilesToInsert, noticeHowToRun, noticeOptions, noticePrecommand };
export { displayFile, drawDinosaur, noticeConfigEnv, noticeDeps, noticeDepsIfExist, noticeDevDepsIfExist, noticeEnvKeyValue, noticeFilesToCreate, noticeFilesToInsert, noticeHowToRun, noticeOptions, noticePrecommand, noticeSkippedInstall };

@@ -6,2 +6,4 @@ import $ from "@david/dax";

const isDry = ({ dryRun }) => dryRun;
/** Returns `true` if the current run skips dependency installation. */
const isSkipInstall = ({ skipInstall }) => skipInstall;
/** Returns `true` if the framework initializer has a precommand to execute. */

@@ -79,2 +81,2 @@ const hasCommand = (data) => !!data.initializer.command;

//#endregion
export { hasCommand, installDependencies, isDeno, isDry, joinDir, needsDenoDotenv, runPrecommand, stringifyEnvs };
export { hasCommand, installDependencies, isDeno, isDry, isSkipInstall, joinDir, needsDenoDotenv, runPrecommand, stringifyEnvs };

@@ -18,2 +18,3 @@ import * as _$_optique_core0 from "@optique/core";

readonly allowNonEmpty: boolean;
readonly skipInstall: boolean;
}, {

@@ -27,2 +28,3 @@ readonly dir: [_$_optique_core0.ValueParserResult<string> | undefined] | undefined;

readonly allowNonEmpty: _$_optique_core0.ValueParserResult<boolean> | undefined;
readonly skipInstall: _$_optique_core0.ValueParserResult<boolean> | undefined;
}>;

@@ -40,2 +42,3 @@ /**

readonly allowNonEmpty: boolean;
readonly skipInstall: boolean;
} & {

@@ -42,0 +45,0 @@ readonly command: "init";

@@ -21,3 +21,4 @@ import { KV_STORE, MESSAGE_QUEUE, PACKAGE_MANAGER, WEB_FRAMEWORK } from "./const.js";

dryRun: option("--dry-run", { description: message`Perform a trial run with no changes made.` }),
allowNonEmpty: option("--allow-non-empty", { description: message`Allow initializing in a non-empty directory when the selected framework scaffolder supports it, failing if any generated file already exists.` })
allowNonEmpty: option("--allow-non-empty", { description: message`Allow initializing in a non-empty directory when the selected framework scaffolder supports it, failing if any generated file already exists.` }),
skipInstall: option("--skip-install", { description: message`Skip installing dependencies after scaffolding the project.` })
});

@@ -24,0 +25,0 @@ /**

//#region deno.json
var version = "2.3.0-dev.1273+6b46a8b5";
var version = "2.3.0-dev.1274+8e82de77";
//#endregion
export { version };

@@ -11,4 +11,4 @@ import { PACKAGE_VERSION, readTemplate } from "../lib.js";

defaultPort: 3e3,
init: async ({ packageManager: pm }) => ({
command: getNextInitCommand(pm),
init: async ({ packageManager: pm, skipInstall }) => ({
command: getNextInitCommand(pm, skipInstall),
dependencies: {

@@ -37,6 +37,7 @@ "@fedify/next": PACKAGE_VERSION,

*/
const getNextInitCommand = (pm) => [
const getNextInitCommand = (pm, skipInstall) => [
...createNextAppCommand(pm),
".",
"--yes"
"--yes",
...skipInstall ? ["--skip-install"] : []
];

@@ -43,0 +44,0 @@ const createNextAppCommand = (pm) => pm === "deno" ? [

{
"name": "@fedify/init",
"version": "2.3.0-dev.1273+6b46a8b5",
"version": "2.3.0-dev.1274+8e82de77",
"description": "Project initializer for Fedify",

@@ -5,0 +5,0 @@ "keywords": [