@dinii-inc/tamashii

中文文档
1.4.6发布于 2025/01/07MITTypeScriptES Module近 30 天下载 1.1万

tamashii assists in resolving internal packages within a monorepo, particularly for private repositories.

原始使用文档
文档目录8 节
  1. Installation
  2. Integration
  3. tamashii help [COMMANDS]
  4. tamashii link SOURCE
  5. tamashii refresh [PACKAGE]
  6. tamashii sync [PACKAGE]
  7. tamashii vscode
  8. tamashii zip SOURCE

tamashii

Tamashii assists in resolving internal packages within a monorepo, particularly for private repositories.

How tamashii helps your work

To use JavaScript packages within the same monorepo in a private monorepo, there are several challenges:

  • Depending on the package manager, you may need to delete the 'node_modules' directory and reinstall it to reflect the latest changes.
  • Directly specifying the package directory copies the 'node_modules' as-is, including "devDependencies", leading to changes in the resolution of dependencies depending on the environment.
  • If a build is required, setting up mechanisms to automatically execute the build for multiple dependencies is necessary.

"tamashii" resolves these challenges with just a few simple commands.

Usage

Installation

$ npm install -g @dinii-inc/tamashii
$ tamashii COMMAND
running command...
$ tamashii (--version)
@dinii-inc/tamashii/1.4.6 darwin-arm64 node-v20.8.0
$ tamashii --help [COMMAND]
USAGE
  $ tamashii COMMAND
...

Integration

$ tamashii init
$ tamashii link ../path/to/your/internal/package

It is recommended to add tamashii refresh and tamashii sync to npm scripts so that internal packages are automatically updated correctly.

{
  "scripts": {
    "preinstall": "tamashii sync",
    "prepare": "tamashii refresh"
  }
}

Commands

tamashii help [COMMANDS]

Display help for tamashii.

USAGE
  $ tamashii help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for tamashii.

See code: @oclif/plugin-help

Links package

USAGE
  $ tamashii link SOURCE [--cwd <value>] [--installFlags <value>] [--npm] [--verbose] [--yarn2]

ARGUMENTS
  SOURCE  Package path

FLAGS
  --cwd=<value>           Current working directory of the child process
  --installFlags=<value>  Flags to pass "yarn add" or "npm install"
  --npm                   Use npm instead of yarn
  --verbose               Print verbose output
  --yarn2                 Use yarn 2+ instead of yarn classic

DESCRIPTION
  Links package

EXAMPLES
  $ tamashii link ../path/to/your/internal/package

See code: src/commands/link/index.ts

tamashii refresh [PACKAGE]

Refreshes package in node_modules

USAGE
  $ tamashii refresh [PACKAGE] [--cwd <value>]

ARGUMENTS
  PACKAGE  Package name

FLAGS
  --cwd=<value>  Current working directory of the child process

DESCRIPTION
  Refreshes package in node_modules

  At times, yarn may not update the content under "node_modules" even if changes are made to locally installed packages
  using "file:[path to package]" instead of a specific version number.
  In such cases, it may be necessary to delete the entire contents of "node_modules" and then re-run "yarn install".
  This command resolves the issue by copying files directly from the source to "node_modules".

  Consider placing this command in the "prepare" section of npm scripts to ensure that the content under "node_modules"
  is always kept up to date.


EXAMPLES
  $ tamashii refresh # all packages will be refreshed

  $ tamashii refresh your-internal-package

See code: src/commands/refresh/index.ts

tamashii sync [PACKAGE]

Syncs local packages from source

USAGE
  $ tamashii sync [PACKAGE] [--cwd <value>] [--force] [--npm] [--verbose] [--yarn2]

ARGUMENTS
  PACKAGE  Target package name to sync

FLAGS
  --cwd=<value>  Current working directory of the child process
  --force        never skip even if no changes detected at source
  --npm          Use npm instead of yarn classic
  --verbose      Print verbose output
  --yarn2        Use yarn 2+ instead of yarn classic

DESCRIPTION
  Syncs local packages from source

  This updates package builds under ".tamashii" based on the source code linked via symbolic link in ".tamashii/.links".
  To reflect the latest builds in node_modules, where you have installed internal packages, you need to execute
  "tamashii refresh".

  This also prevents the copying of the "node_modules" directory within the source directory that contains
  "devDependencies".

  Consider placing this command in the "preinstall" section of npm scripts so that the required builds are prepared even
  during the initial run of yarn in the package directory where you have installed internal packages.


EXAMPLES
  $ tamashii sync # all packages will be synced

  $ tamashii sync your-internal-package

See code: src/commands/sync/index.ts

tamashii vscode

Shows instruction to make your development experience with tamashii and VSCode more comfortable

USAGE
  $ tamashii vscode

DESCRIPTION
  Shows instruction to make your development experience with tamashii and VSCode more comfortable

See code: src/commands/vscode/index.ts

tamashii zip SOURCE

Zips package

USAGE
  $ tamashii zip SOURCE

ARGUMENTS
  SOURCE  Package path

DESCRIPTION
  Zips package

EXAMPLES
  $ tamashii zip ../path/to/your/internal/package

See code: src/commands/zip/index.ts

版本与发布记录

@dinii-inc/tamashii 共发布 24 个版本,首次发布于 2023/12/29;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.4.6latest2025/01/071.8 年前
1.4.52024/06/262 年前
1.4.42024/06/262 年前
1.4.32024/05/032 年前
1.4.22024/02/042 年前
1.4.12024/02/042 年前

关于 @dinii-inc/tamashii 的常见问题

@dinii-inc/tamashii 是什么?

tamashii assists in resolving internal packages within a monorepo, particularly for private repositories.

如何安装 @dinii-inc/tamashii?

在项目目录运行 npm install @dinii-inc/tamashii,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 tamashii,可以用 npx tamashii 直接运行。

@dinii-inc/tamashii 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dinii-inc/tamashii 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dinii-inc/tamashii 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dinii-inc/tamashii 可以商用吗?

@dinii-inc/tamashii 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dinii-inc/tamashii 的下载量有多少?

根据 npm 官方下载统计,@dinii-inc/tamashii 在 2026/10/13 – 2026/11/11 这 30 天内被下载 10,623 次,日均约 354 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dinii-inc/tamashii 还在维护吗?

最新版本 1.4.6 发布于 2025/01/07(1.8 年前);至今共发布 24 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/12/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。