Skip to content

feat(create-typink): add flexibility in package manager when initializing project#201

Merged
sinzii merged 24 commits intomainfrom
feature/package-manager
Aug 10, 2025
Merged

feat(create-typink): add flexibility in package manager when initializing project#201
sinzii merged 24 commits intomainfrom
feature/package-manager

Conversation

@1cedrus
Copy link
Member

@1cedrus 1cedrus commented Aug 2, 2025

  • This PR addresses a task in Improve create-typink cli for ink! v6 #194 by adding flexibility to the package manager used when calling create-typink. Previously, it defaulted to yarn; now it automatically detects the package manager the user intends to use.
  • If the package manager cannot be detected automatically, it defaults to using npm.
  • Examples with currently supported package managers:
    • $ npm create typink
    • $ yarn create typink
    • $ bun create typink
    • $ pnpm create typink

@1cedrus 1cedrus marked this pull request as ready for review August 2, 2025 11:27
Base automatically changed from feature/typink-improvements to main August 3, 2025 09:32
Copilot AI review requested due to automatic review settings August 3, 2025 09:54

This comment was marked as outdated.

@1cedrus 1cedrus requested review from Copilot and sinzii and removed request for Copilot August 4, 2025 15:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the create-typink CLI tool to automatically detect and use the package manager that the user invoked the tool with, instead of defaulting to yarn. The tool now supports npm, yarn, pnpm, and bun package managers with automatic detection based on the user agent environment variable.

  • Adds package manager detection via user agent parsing
  • Updates installation commands and help messages to use the detected package manager
  • Simplifies project structure by removing workspace configuration and moving contracts to src/contracts

Reviewed Changes

Copilot reviewed 28 out of 123 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/create-typink/src/utils/string.ts Adds pkgFromUserAgent function for parsing package manager from user agent
packages/create-typink/src/utils/render.ts Updates help messages to use detected package manager instead of hardcoded yarn
packages/create-typink/src/types.ts Adds PkgManagerInfo interface and updates BaseOptions to include package manager
packages/create-typink/src/utils/options.ts Sets default package manager to npm in options
packages/create-typink/src/index.ts Implements package manager detection and assignment to options
packages/create-typink/src/tasks/installPackages.ts Updates package installation to use detected package manager
packages/create-typink/src/createProject.ts Updates task title to show detected package manager
Template files Restructures project from workspace to single package, moves contracts to src/contracts, updates imports
Comments suppressed due to low confidence (1)

1cedrus and others added 5 commits August 4, 2025 23:33
# Conflicts:
#	packages/create-typink/src/templates/legacy/default/contracts/package.json
#	packages/create-typink/src/templates/legacy/default/package.json.template.ejs
#	packages/create-typink/src/templates/v6/default/contracts/package.json
#	packages/create-typink/src/templates/v6/default/package.json.template.ejs
@1cedrus 1cedrus force-pushed the feature/package-manager branch from cbdf9e9 to 247153b Compare August 8, 2025 02:58
Copy link
Member

@sinzii sinzii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking neat to me, I've made some minor changes, let's go with this first! Thanks!

@sinzii sinzii merged commit 090cd5b into main Aug 10, 2025
5 checks passed
@sinzii sinzii deleted the feature/package-manager branch August 10, 2025 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants