Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
- name: Test Type
run: npm run test:type

- name: Test Format
run: npm run check:format:check

- name: Test Lint
run: npm run check:lint

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"types": "./dist/index.d.ts",
"files": [
"dist",
"docs",
"docs/*.md",
"docs/src",
"LICENSE",
"README.md",
"CHANGELOG.md",
Expand Down
237 changes: 0 additions & 237 deletions scripts/logger.ts

This file was deleted.

14 changes: 10 additions & 4 deletions scripts/testPlayground.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import { spawnSync } from "node:child_process";
import { undoPlayground } from "./undoPlayground.js";
import { logger } from "./logger.js";
import { Logger } from "@donneko/tyoi-logger";

const PLAYGROUND_PASS = "../test/playground";

Expand Down Expand Up @@ -32,11 +32,15 @@ function testCLI(playgroundPath: string): { args: string[]; ok: boolean }[] {

run(["help"]);
run(["info"]);
run(["init"]);
run(["init", " my-app", "--template", "basic-ts"]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove leading spaces from playground project names

When npm run test:use reaches this command, the project name argument is the literal string " my-app"; getProjectName validates names with isValidProjectName and rejects the leading space, so the new init/create playground cases below never exercise template copying. Please pass my-app without the leading space for these entries.

Useful? React with 👍 / 👎.

undo();
run(["create"]);
run(["init", " my-app", "--template", "basic-js"]);
undo();
run(["config"]);
run(["create", " my-app", "--template", "basic-ts"]);
undo();
run(["create", " my-app", "--template", "basic-js"]);
undo();
run(["config", "--template", "basic"]);
run(["run"], 3000);
run(["dev"], 3000);

Expand All @@ -48,6 +52,8 @@ function main() {

const results = testCLI(playgroundPath);

const logger = new Logger();

const summary = logger.createInfo(
(() => {
const ok = results.filter((r) => r.ok);
Expand Down
4 changes: 3 additions & 1 deletion src/cli/command/config/service/next-steps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { logger } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";

export function showNextSteps(): void {
const logger = new Logger();

logger.bar();
logger.success("次のコマンドで起動できます。");
logger.info("npx tyoi run");
Expand Down
4 changes: 3 additions & 1 deletion src/cli/command/create/service/next-steps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { logger } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";

export function showNextSteps(projectName: string): void {
const logger = new Logger();

logger.bar();
logger.success("次のコマンドで起動できます。");
logger.info(`cd ${projectName}`);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/command/dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Server } from "../../app/server.js";
import { Server } from "../../server/app/server.js";
import type { CmdMetaData } from "../types/tyoi-cli.js";

type RequestNameList = "GET:/test" | "GET:/test/a" | "GET:/a";
Expand Down
4 changes: 3 additions & 1 deletion src/cli/command/init/service/next-steps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { logger } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";

export function showNextSteps(): void {
const logger = new Logger();

logger.bar();
logger.success("次のコマンドで起動できます。");
logger.info("npm install");
Expand Down
2 changes: 1 addition & 1 deletion src/cli/command/start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { pathToFileURL } from "node:url";
import { Server } from "../../app/server.js";
import { Server } from "../../server/app/server.js";
import type { CmdMetaData } from "../types/tyoi-cli.js";
import { askSelect } from "../../service/ask-select.js";
import { scanConfigFiles } from "../../service/scan-config-files.js";
Expand Down
3 changes: 2 additions & 1 deletion src/cli/service/template-copy/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createCopyResult } from "../shell/create-copy-result.js";
import fs from "node:fs";
import path from "node:path";

import { logger } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";

type AppTemplateCopyDestination = "target" | "target-project";

Expand Down Expand Up @@ -61,6 +61,7 @@ export async function appTemplateCopy(data: AppTemplateCopyData): Promise<AppTem
const { target, base, option, pack, app } = data;

const { template, projectName } = option;
const logger = new Logger();

const templatePath = await getTemplatePath(template, base, app.templatePass);

Expand Down
6 changes: 4 additions & 2 deletions src/cli/service/template-copy/shell/create-copy-result.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { logger, type LoggerCreateData } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";

export function createCopyResult({ error, ok }: { error: string[]; ok: string[] }): {
title: string;
content: LoggerCreateData[];
content: ReturnType<Logger["createError"]>[];
} {
const logger = new Logger();

return {
title: "コピー結果",
content: [
Expand Down
3 changes: 2 additions & 1 deletion src/cli/service/template-copy/shell/project-name.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import path from "node:path";
import { askInput } from "../../../../service/ask-input.js";
import { logger } from "../../../../util/logger.js";
import { Logger } from "@donneko/tyoi-logger";
import { isValidProjectName } from "../core/is-valid-project-name.js";

export async function getProjectName(
inputName: string | undefined,
target: string
): Promise<string> {
let projectName = inputName;
const logger = new Logger();

if (!projectName) {
const defaultName = path.basename(target);
Expand Down
Loading
Loading