| Server IP : 159.203.156.69 / Your IP : 216.73.217.172 Web Server : nginx/1.24.0 System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/tanviranik.com/node_modules/vinext/dist/ |
Upload File : |
//#region src/init.d.ts
/**
* vinext init — one-command project migration for Next.js apps.
*
* Automates the steps needed to run a Next.js app under vinext:
*
* 1. Run `vinext check` to show compatibility report
* 2. Install dependencies (vite, @vitejs/plugin-react, and App Router deps)
* 3. Add "type": "module" to package.json
* 4. Rename CJS config files to .cjs
* 5. Add vinext scripts to package.json
* 6. Generate vite.config.ts
* 7. Update .gitignore to include /dist/
* 8. Print summary
*
* Non-destructive: does NOT modify next.config, tsconfig, or source files.
* The project should work with both Next.js and vinext simultaneously.
*/
type InitOptions = {
/** Project root directory */root: string; /** Dev server port (default: 3001) */
port?: number; /** Skip the compatibility check step */
skipCheck?: boolean; /** Force overwrite even if vite.config.ts exists */
force?: boolean; /** @internal — override exec for testing (avoids ESM spy issues) */
_exec?: (cmd: string, opts: {
cwd: string;
stdio: string;
}) => void;
};
type InitResult = {
/** Whether dependencies were installed */installedDeps: string[]; /** Whether "type": "module" was added */
addedTypeModule: boolean; /** CJS config files that were renamed ([old, new] pairs) */
renamedConfigs: Array<[string, string]>; /** Whether scripts were added to package.json */
addedScripts: string[]; /** Whether vite.config.ts was generated */
generatedViteConfig: boolean; /** Whether vite.config.ts generation was skipped (already exists) */
skippedViteConfig: boolean; /** Whether .gitignore was updated to include /dist/ */
updatedGitignore: boolean;
};
declare function generateViteConfig(_isAppRouter: boolean): string;
/**
* Add vinext scripts to package.json without overwriting existing scripts.
* Returns the list of script names that were added.
*/
declare function addScripts(root: string, port: number): string[];
declare function getInitDeps(isAppRouter: boolean): string[];
declare function isDepInstalled(root: string, dep: string): boolean;
/**
* Check if react/react-dom need upgrading for react-server-dom-webpack compatibility.
*
* react-server-dom-webpack versions are pinned to match their React version
* (e.g. rsdw@19.2.6 requires react@^19.2.6). When a project has an older
* React (e.g. create-next-app ships react@19.2.3), we need to upgrade
* react/react-dom BEFORE installing rsdw to avoid peer-dep conflicts.
*
* Uses createRequire to resolve react's package.json through Node's module
* resolution, which works correctly across all package managers (npm, pnpm,
* yarn, Yarn PnP) and monorepo layouts with hoisting/symlinking.
*
* Returns ["react@latest", "react-dom@latest"] if upgrade is needed, [] otherwise.
*/
declare function getReactUpgradeDeps(root: string): string[];
/**
* Ensure /dist/ is listed in .gitignore. Creates the file if it doesn't exist.
* Returns true if the file was modified (or created), false if /dist/ was already present.
*/
declare function updateGitignore(root: string): boolean;
declare function init(options: InitOptions): Promise<InitResult>;
//#endregion
export { InitOptions, addScripts, generateViteConfig, getInitDeps, getReactUpgradeDeps, init, isDepInstalled, updateGitignore };
//# sourceMappingURL=init.d.ts.map