Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected] #13

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
28 changes: 14 additions & 14 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
node-version: [16, 18]
node-version: [18]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -43,19 +43,19 @@ jobs:
version: latest
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# - name: Get pnpm store directory
# id: pnpm-cache
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

# - uses: actions/cache@v3
# name: Setup pnpm cache
# with:
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@
},
"prettier": {},
"dependencies": {
"@changesets/cli": "^2.26.0"
"@changesets/cli": "^2.27.1"
},
"pnpm": {
"overrides": {
"esbuild": "0.20.2",
"typescript": "5.4.5"
}
},
"devDependencies": {
"@types/node": "^18.11.7",
"nodemon": "^2.0.20",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"typescript": "^5.3.3"
"@types/node": "^20.12.7",
"nodemon": "^3.1.0",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.5"
}
}
12 changes: 6 additions & 6 deletions packages/create-mustard-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@
]
},
"dependencies": {
"fs-extra": "^11.1.0",
"log-symbols": "^5.1.0",
"fs-extra": "^11.2.0",
"log-symbols": "^6.0.0",
"mustard-cli": "workspace:*"
},
"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.11.18",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.12.7",
"npm-run-all": "^4.1.5",
"ts-node": "^10.9.1",
"typescript": "^5.3.3"
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=16.0.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/docs/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default defineAppConfig({
github: "LinbuduLab/Mustard",
},
github: {
owner: "LinbuduLab",
repo: "Mustard",
branch: "main",
edit: true,
},
header: {
Expand Down
8 changes: 7 additions & 1 deletion packages/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export default defineNuxtConfig({
extends: '@nuxt-themes/docus'
extends: '@nuxt-themes/docus',
nitro: {
prerender: {
// Workaround for "Error: [404] Page not found: /manifest.json"
failOnError: false,
},
},
})
2 changes: 2 additions & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
},
"devDependencies": {
"@nuxt-themes/docus": "^1.4.7",
"consola": "^3.2.3",
"nuxt": "^3.0.0",
"pinceau": "0.15.4",
"typescript": "^5.3.3"
},
"engines": {
Expand Down
60 changes: 32 additions & 28 deletions packages/mustard-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
"url": "git+https://github.com/LinbuduLab/Mustard.git",
"directory": "packages/mustard-cli"
},
"type": "module",
"exports": {
".": {
"types": "./dist/Exports/index.d.ts",
"import": "./dist/Exports/index.js",
"require": "./dist/Exports/index.js"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"./decorator": {
"types": "./dist/Exports/Decorators.d.ts",
"import": "./dist/Exports/Decorators.js",
"require": "./dist/Exports/Decorators.js"
"require": "./dist/cjs/Exports/Decorators.js"
},
"./cli": {
"types": "./dist/Exports/ComanndLine.d.ts",
"import": "./dist/Exports/ComanndLine.js",
"require": "./dist/Exports/ComanndLine.js"
"require": "./dist/cjs/Exports/ComanndLine.js"
},
"./validator": {
"types": "./dist/Exports/Validator.d.ts",
"import": "./dist/Exports/Validator.js",
"require": "./dist/Exports/Validator.js"
"require": "./dist/cjs/Exports/Validator.js"
}
},
"main": "./dist/Exports/index.js",
"types": "./dist/Exports/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"decorator": [
Expand All @@ -45,8 +45,12 @@
]
}
},
"type": "module",
"scripts": {
"build": "tsc --declarationMap false",
"build": "rm -rf dist && pnpm run build && pnpm run build:cjs",
"build:cjs": "tsc --declarationMap false --module CommonJs --moduleResolution node --outDir dist/cjs --declaration false",
"build": "tsc --declarationMap false ",
"check": "tsc --noEmit",
"dev": "tsc --watch",
"local": "nodemon index.ts run sync --dry",
"prepublishOnly": "pnpm run pub:check && pnpm run build",
Expand All @@ -62,7 +66,7 @@
"NODE_ENV": "development"
},
"execMap": {
"ts": "ts-node-esm"
"ts": "ts-node"
},
"ext": "ts,json",
"ignore": [
Expand All @@ -77,33 +81,33 @@
]
},
"dependencies": {
"chalk": "^5.0.0",
"debug": "^4.3.4",
"fastest-levenshtein": "^1.0.16",
"find-up": "^6.3.0",
"find-up": "^7.0.0",
"lodash.groupby": "^4.6.0",
"lodash.uniqby": "^4.7.0",
"mri": "^1.2.0",
"picocolors": "^1.0.0",
"yargs-parser": "^21.1.1",
"zod": "^3.20.2"
"zod": "^3.23.4"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/lodash.groupby": "^4.6.7",
"@types/lodash.uniqby": "^4.7.7",
"@types/node": "^18.11.17",
"@types/tmp": "^0.2.3",
"@types/yargs-parser": "^21.0.0",
"@vitest/coverage-c8": "^0.29.3",
"@types/debug": "^4.1.12",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.uniqby": "^4.7.9",
"@types/node": "^20.12.7",
"@types/tmp": "^0.2.6",
"@types/yargs-parser": "^21.0.3",
"@vitest/coverage-v8": "^1.5.2",
"cross-env": "^7.0.3",
"execa": "^6.0.0",
"execa": "^8.0.1",
"lodash": "^4.17.21",
"nodemon": "^2.0.20",
"tmp": "^0.2.1",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.1",
"typescript": "^5.3.3",
"vitest": "^0.29.3"
"nodemon": "^3.1.0",
"tmp": "^0.2.3",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.5",
"vitest": "^1.5.2"
},
"peerDependencies": {
"typescript": ">=5.0.0"
Expand Down
6 changes: 4 additions & 2 deletions packages/mustard-cli/source/Commands/BuiltInCommands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chalk from "chalk";
import picocolors from "picocolors";

import { UsageInfoGenerator } from "../Components/UsageGenerator";
import { MustardConstanst } from "../Components/Constants";
Expand Down Expand Up @@ -81,7 +81,9 @@ export class BuiltInCommands {

if (!controller) return;

console.log(`V ${chalk.bold(BuiltInCommands.useController(controller))}`);
console.log(
`V ${picocolors.bold(BuiltInCommands.useController(controller))}`
);

exit && process.exit(0);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/mustard-cli/source/Errors/ValidationError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import chalk from "chalk";
import picocolors from "picocolors";

import type { ZodInvalidTypeIssue } from "zod";

Expand All @@ -16,8 +16,8 @@ export class ValidationError extends Error {
}

get message(): string {
return chalk.yellow(
`Invalid input for option ${chalk.bold(this.invalidOptionName)}`
return picocolors.yellow(
`Invalid input for option ${picocolors.bold(this.invalidOptionName)}`
);
}

Expand All @@ -27,9 +27,9 @@ export class ValidationError extends Error {
const { expected, received, message } = <ZodInvalidTypeIssue>issue;

if (expected && received) {
return `Invalid input for argument '${argName}', expected: ${chalk.green(
return `Invalid input for argument '${argName}', expected: ${picocolors.green(
expected
)}, received: ${chalk.yellow(received)}`;
)}, received: ${picocolors.yellow(received)}`;
} else {
return message ?? `Invalid input for argument '${argName}`;
}
Expand Down
19 changes: 0 additions & 19 deletions packages/mustard-cli/source/Exports/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/mustard-cli/source/__tests__/Errors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Mustard Errors", () => {
expect(error.name).toBe("CommandNotFoundError");
expect(error.message).toMatchInlineSnapshot(`
"Command not found with parsed args: {
\\"_\\": []
"_": []
}"
`);
});
Expand Down
3 changes: 2 additions & 1 deletion packages/mustard-cli/source/__tests__/Fixtures/TestHelper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export class TestHelper {
public static IntegrationExecutor = "ts-node-esm --transpile-only";
public static IntegrationExecutor =
"ts-node-esm --esm --transpileOnly --experimentalSpecifierResolution=explicit";
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MustardFactory, Context, MustardUtils } from "../../Exports";
import { MustardFactory, Context, MustardUtils } from "../..";
import {
Command,
RootCommand,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MustardFactory } from "../../../Exports/index";
import { MustardFactory } from "../../../index";
import { RootCommand, App } from "../../../Exports/Decorators";
import { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";
import type { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";

@RootCommand()
class RootCommandHandle implements CommandStruct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MustardFactory } from "../../../Exports";
import { MustardFactory } from "../../..";
import { RootCommand, App } from "../../../Exports/Decorators";
import { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";
import type { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";

@RootCommand()
class RootCommandHandle implements CommandStruct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MustardFactory } from "../../../Exports/index";
import { MustardFactory } from "../../../index";
import { RootCommand, App, Command, Option } from "../../../Exports/Decorators";
import { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";
import type { CommandStruct, MustardApp } from "../../../Exports/ComanndLine";

@Command("update", "execute update command")
class UpdateCommandHandle implements CommandStruct {
Expand Down
Loading
Loading