Skip to content

Commit 4b49527

Browse files
author
RSamaium
committed
chore: release v5.0.0-alpha.38
1 parent 457187d commit 4b49527

File tree

16 files changed

+31
-22
lines changed

16 files changed

+31
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rpgjs",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"scripts": {
55
"build": "tsx bin/build.ts",
66
"dev": "tsx bin/dev.ts",

packages/action-battle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpgjs/action-battle",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"scripts": {

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpgjs/client",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"description": "RPGJS is a framework for creating RPG/MMORPG games",
55
"main": "dist/index.js",
66
"types": "./dist/index.d.ts",

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpgjs/common",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"main": "./dist/index.js",
55
"types": "./dist/index.d.ts",
66
"publishConfig": {

packages/create-rpgjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-rpgjs",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"description": "Official CLI to scaffold RPGJS projects",
55
"type": "module",
66
"bin": {

packages/create-rpgjs/src/core/template-source.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ import path from 'node:path'
44
import { spawn } from 'node:child_process'
55
import { resolveTemplateDir } from '../utils/fs.js'
66

7-
function cloneRepository(url, destination) {
8-
return new Promise((resolve, reject) => {
7+
type TemplateSourceOptions = {
8+
templateName?: string
9+
templateUrl?: string
10+
}
11+
12+
function cloneRepository(url: string, destination: string): Promise<void> {
13+
return new Promise<void>((resolve, reject) => {
914
const child = spawn('git', ['clone', '--depth', '1', url, destination], {
1015
stdio: ['ignore', 'inherit', 'pipe'],
1116
shell: process.platform === 'win32'
@@ -29,7 +34,7 @@ function cloneRepository(url, destination) {
2934
})
3035
}
3136

32-
export async function resolveTemplateSource(options = {}) {
37+
export async function resolveTemplateSource(options: TemplateSourceOptions = {}) {
3338
if (!options.templateUrl) {
3439
return {
3540
templateDir: resolveTemplateDir(options.templateName || 'base'),

packages/create-rpgjs/src/utils/package-manager.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import path from 'node:path'
22
import { access } from 'node:fs/promises'
33

4-
export function detectPackageManager() {
4+
export type PackageManager = 'pnpm' | 'yarn' | 'npm'
5+
6+
export function detectPackageManager(): PackageManager {
57
const userAgent = process.env.npm_config_user_agent || ''
68
if (userAgent.startsWith('pnpm/')) return 'pnpm'
79
if (userAgent.startsWith('yarn/')) return 'yarn'
810
if (userAgent.startsWith('npm/')) return 'npm'
911
return 'npm'
1012
}
1113

12-
async function exists(file) {
14+
async function exists(file: string): Promise<boolean> {
1315
try {
1416
await access(file)
1517
return true
@@ -18,14 +20,14 @@ async function exists(file) {
1820
}
1921
}
2022

21-
export async function detectPackageManagerFromLockfile(projectDir) {
23+
export async function detectPackageManagerFromLockfile(projectDir: string): Promise<PackageManager> {
2224
if (await exists(path.join(projectDir, 'pnpm-lock.yaml'))) return 'pnpm'
2325
if (await exists(path.join(projectDir, 'yarn.lock'))) return 'yarn'
2426
if (await exists(path.join(projectDir, 'package-lock.json'))) return 'npm'
2527
return detectPackageManager()
2628
}
2729

28-
export function installCommand(packageManager) {
30+
export function installCommand(packageManager: PackageManager): [string, string[]] {
2931
if (packageManager === 'pnpm') return ['pnpm', ['install']]
3032
if (packageManager === 'yarn') return ['yarn', ['install']]
3133
return ['npm', ['install']]

packages/create-rpgjs/src/utils/process.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { spawn } from 'node:child_process'
22

3-
export function runCommand(command, args, options = {}) {
4-
return new Promise((resolve, reject) => {
3+
type RunCommandOptions = Parameters<typeof spawn>[2]
4+
5+
export function runCommand(command: string, args: string[], options: RunCommandOptions = {}): Promise<void> {
6+
return new Promise<void>((resolve, reject) => {
57
const child = spawn(command, args, {
68
stdio: 'inherit',
79
shell: process.platform === 'win32',

packages/physic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpgjs/physic",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"type": "module",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpgjs/server",
3-
"version": "5.0.0-alpha.37",
3+
"version": "5.0.0-alpha.38",
44
"main": "./dist/index.js",
55
"types": "./dist/index.d.ts",
66
"publishConfig": {

0 commit comments

Comments
 (0)