diff --git a/.changeset/better-geese-scream.md b/.changeset/better-geese-scream.md deleted file mode 100644 index 6a60952..0000000 --- a/.changeset/better-geese-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -refactor: restructure json translation for better organization diff --git a/.changeset/bitter-rats-fail.md b/.changeset/bitter-rats-fail.md deleted file mode 100644 index 9de84b3..0000000 --- a/.changeset/bitter-rats-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -fix(scaffolding): Remove partially created project directory on failure diff --git a/.changeset/clean-pants-yawn.md b/.changeset/clean-pants-yawn.md deleted file mode 100644 index c7fd684..0000000 --- a/.changeset/clean-pants-yawn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -fix(config): Update config command alias from 'cf' to 'conf' diff --git a/.changeset/crazy-eggs-jump.md b/.changeset/crazy-eggs-jump.md deleted file mode 100644 index b1b40e1..0000000 --- a/.changeset/crazy-eggs-jump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -refactor(utils): Complete utility reorganization and introduce core abstractions diff --git a/.changeset/empty-badgers-wish.md b/.changeset/empty-badgers-wish.md deleted file mode 100644 index 1b56c6f..0000000 --- a/.changeset/empty-badgers-wish.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(config): Implement schema validation when loading configuration diff --git a/.changeset/flat-ideas-stand.md b/.changeset/flat-ideas-stand.md deleted file mode 100644 index fb01942..0000000 --- a/.changeset/flat-ideas-stand.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat: Introduces the new `dk info` command (alias `dk in`) to display comprehensive diagnostic information about the CLI environment. This command reports the CLI version, runtime details (Node.js/Bun), OS, and the existence and location of both global (`~/.devkitrc`) and local (`.devkit.json`) configuration files. diff --git a/.changeset/four-pens-serve.md b/.changeset/four-pens-serve.md deleted file mode 100644 index e42cc69..0000000 --- a/.changeset/four-pens-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(.github): configure GitHub Discussions for community feedback diff --git a/.changeset/great-eels-grab.md b/.changeset/great-eels-grab.md deleted file mode 100644 index a861cd1..0000000 --- a/.changeset/great-eels-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(config): Add --yes/-y option to dk init for non-interactive overwrite diff --git a/.changeset/hungry-hornets-sin.md b/.changeset/hungry-hornets-sin.md deleted file mode 100644 index 316f766..0000000 --- a/.changeset/hungry-hornets-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(cli): Improve `add-template` command with interactive flow. Add validation to the `add-template` command to check if a repository or local path exists before saving the template to the configuration. diff --git a/.changeset/late-plums-march.md b/.changeset/late-plums-march.md deleted file mode 100644 index ed2aebf..0000000 --- a/.changeset/late-plums-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -refactor(cli): implement dynamic help text generation diff --git a/.changeset/late-sloths-flash.md b/.changeset/late-sloths-flash.md deleted file mode 100644 index adf2956..0000000 --- a/.changeset/late-sloths-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": major ---- - -feat: Centralize configuration management under new 'dk config' command and enhance 'dk list' diff --git a/.changeset/mean-bushes-help.md b/.changeset/mean-bushes-help.md deleted file mode 100644 index 8a096d6..0000000 --- a/.changeset/mean-bushes-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -feat: Add short aliases (pm, lang, cache) for configuration keys diff --git a/.changeset/mean-suits-invite.md b/.changeset/mean-suits-invite.md deleted file mode 100644 index ff3e732..0000000 --- a/.changeset/mean-suits-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(option): update 'dk list' filtering to '--where' with new advanced syntax diff --git a/.changeset/rude-carpets-hammer.md b/.changeset/rude-carpets-hammer.md deleted file mode 100644 index a1361f6..0000000 --- a/.changeset/rude-carpets-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": patch ---- - -refactor: Move `chalk` and `ora` to a single, centralized file for better code organization. diff --git a/.changeset/short-deer-sort.md b/.changeset/short-deer-sort.md deleted file mode 100644 index 9a2d5cf..0000000 --- a/.changeset/short-deer-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat: refactoring configuration command logic into dedicated, reusable files and adding comprehensive unit tests for init, remove, and update commands, including new wildcard (\*) template resolution. diff --git a/.changeset/silent-worms-hear.md b/.changeset/silent-worms-hear.md deleted file mode 100644 index 99e9479..0000000 --- a/.changeset/silent-worms-hear.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat: Add --include-defaults to list commands; enhance template config with {pm} token diff --git a/.changeset/social-cars-go.md b/.changeset/social-cars-go.md deleted file mode 100644 index 545bb96..0000000 --- a/.changeset/social-cars-go.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(cli): Add support for language aliases (js, ts, n) in all relevant commands diff --git a/.changeset/tiny-dogs-do.md b/.changeset/tiny-dogs-do.md deleted file mode 100644 index e5fb4ae..0000000 --- a/.changeset/tiny-dogs-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat: Add --mode option to `dk list` and strengthen logger table diff --git a/.changeset/yellow-ducks-pump.md b/.changeset/yellow-ducks-pump.md deleted file mode 100644 index 4fc8b14..0000000 --- a/.changeset/yellow-ducks-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"scaffolder-toolkit": minor ---- - -feat(list): enhance list command with filter option and improved output diff --git a/devkit-schema.json b/devkit-schema.json index dbc93e4..caa24b3 100644 --- a/devkit-schema.json +++ b/devkit-schema.json @@ -1,6 +1,6 @@ { "title": "DevKit CLI Configuration", - "description": "JSON schema for the .devkitrc configuration file, providing autocompletion and validation. Only the 'javascript' language is currently supported.", + "description": "JSON schema for the .devkitrc configuration file, providing autocompletion and validation.", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { @@ -11,7 +11,7 @@ "defaultPackageManager": { "type": "string", "description": "The default package manager to use for new projects.", - "enum": ["bun", "npm", "yarn", "deno", "pnpm"], + "enum": ["bun", "npm", "yarn", "pnpm"], "default": "bun" }, "cacheStrategy": { @@ -32,56 +32,70 @@ }, "templates": { "type": "object", - "description": "A collection of templates, currently only for JavaScript.", + "description": "A collection of templates, grouped by the canonical language key.", "properties": { "javascript": { + "$ref": "#/definitions/languageConfig" + }, + "typescript": { + "$ref": "#/definitions/languageConfig" + }, + "nodejs": { + "$ref": "#/definitions/languageConfig" + } + }, + "additionalProperties": true + } + }, + "required": ["settings", "templates"], + "additionalProperties": false, + "definitions": { + "templateConfig": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "A short description of the template." + }, + "location": { + "type": "string", + "description": "The location of the template (e.g., local path, GitHub URL, or a CLI command with the {pm} placeholder)." + }, + "alias": { + "type": "string", + "description": "A short alias for the template, used with the -t flag." + }, + "cacheStrategy": { + "type": "string", + "description": "The caching strategy for this specific template. Overrides global setting.", + "enum": ["always-refresh", "never-refresh", "daily"] + }, + "packageManager": { + "type": "string", + "description": "The package manager to use for this specific template. Overrides global setting.", + "enum": ["bun", "npm", "yarn", "pnpm"] + } + }, + "required": ["description", "location"], + "additionalProperties": false + }, + "languageConfig": { + "type": "object", + "description": "Templates for a specific programming language ecosystem.", + "properties": { + "templates": { "type": "object", - "description": "Templates for the JavaScript ecosystem.", - "properties": { - "templates": { - "type": "object", - "description": "The available templates for JavaScript.", - "patternProperties": { - "^.*$": { - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "A short description of the template." - }, - "location": { - "type": "string", - "description": "The location of the template (e.g., local path, GitHub URL, or a CLI command)." - }, - "alias": { - "type": "string", - "description": "A short alias for the template." - }, - "cacheStrategy": { - "type": "string", - "description": "The caching strategy for this specific template.", - "enum": ["always-refresh", "never-refresh", "daily"] - }, - "packageManager": { - "type": "string", - "description": "The package manager to use for this specific template.", - "enum": ["bun", "npm", "yarn", "deno", "pnpm"] - } - }, - "required": ["description", "location"], - "additionalProperties": false - } - }, - "additionalProperties": false + "description": "The available templates for this language.", + "patternProperties": { + "^.*$": { + "$ref": "#/definitions/templateConfig" } }, - "required": ["templates"], "additionalProperties": false } }, + "required": ["templates"], "additionalProperties": false } - }, - "required": ["settings", "templates"], - "additionalProperties": false + } } diff --git a/packages/devkit/CHANGELOG.md b/packages/devkit/CHANGELOG.md index e2f4d8d..4a9e073 100644 --- a/packages/devkit/CHANGELOG.md +++ b/packages/devkit/CHANGELOG.md @@ -1,5 +1,35 @@ # scaffolder-toolkit +## 2.0.0 + +### Major Changes + +- fb453cd: feat: Centralize configuration management under new 'dk config' command and enhance 'dk list' + +### Minor Changes + +- 6a4efa2: feat(config): Implement schema validation when loading configuration +- 71930e4: feat: Introduces the new `dk info` command (alias `dk in`) to display comprehensive diagnostic information about the CLI environment. This command reports the CLI version, runtime details (Node.js/Bun), OS, and the existence and location of both global (`~/.devkitrc`) and local (`.devkit.json`) configuration files. +- 3407be6: feat(.github): configure GitHub Discussions for community feedback +- a8a222e: feat(config): Add --yes/-y option to dk init for non-interactive overwrite +- 9dc5384: feat(cli): Improve `add-template` command with interactive flow. Add validation to the `add-template` command to check if a repository or local path exists before saving the template to the configuration. +- e0862aa: feat(option): update 'dk list' filtering to '--where' with new advanced syntax +- c5260ed: feat: refactoring configuration command logic into dedicated, reusable files and adding comprehensive unit tests for init, remove, and update commands, including new wildcard (\*) template resolution. +- 962819a: feat: Add --include-defaults to list commands; enhance template config with {pm} token +- ef9dea7: feat(cli): Add support for language aliases (js, ts, n) in all relevant commands +- 8f1a5a4: feat: Add --mode option to `dk list` and strengthen logger table +- 759300a: feat(list): enhance list command with filter option and improved output + +### Patch Changes + +- fc5d1d0: refactor: restructure json translation for better organization +- f63786d: fix(scaffolding): Remove partially created project directory on failure +- d0f0683: fix(config): Update config command alias from 'cf' to 'conf' +- dedc1cf: refactor(utils): Complete utility reorganization and introduce core abstractions +- 4e86dee: refactor(cli): implement dynamic help text generation +- 0e259c3: feat: Add short aliases (pm, lang, cache) for configuration keys +- b05f20a: refactor: Move `chalk` and `ora` to a single, centralized file for better code organization. + ## 1.0.11 ### Patch Changes diff --git a/packages/devkit/README.md b/packages/devkit/README.md index 8b153b4..9deb19a 100644 --- a/packages/devkit/README.md +++ b/packages/devkit/README.md @@ -1,5 +1,7 @@ # 🚀 Scaffolder-Toolkit (`dk`) +![License](https://img.shields.io/npm/l/scaffolder-toolkit?style=plastic) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/IT-WIBRC/dev-tools/ci.yaml?branch=develop&style=plastic) ![npm bundle size](https://img.shields.io/bundlephobia/min/dev-tools?style=plastic&color=green) ![NPM Downloads](https://img.shields.io/npm/dt/scaffolder-toolkit?style=plastic) ![NPM Version](https://img.shields.io/npm/v/scaffolder-toolkit?style=plastic) + A universal CLI for professional developers to automate project scaffolding and streamline workflows. **Scaffolder-Toolkit** (`dk`) is a powerful command-line tool designed to boost your productivity by automating repetitive tasks. Whether you're setting up a new machine or starting a new project, `dk` is your essential solution for project automation. @@ -446,7 +448,7 @@ This is the recommended approach for most developers. Simply add the `$schema` p ```json { - "$schema": "https://gist.githubusercontent.com/IT-WIBRC/baab4cc74a28af5b23936f5cf576f8e6/raw/ed7445f123554cf5ed7fc6fb727d1faae22a9bed/devkit-schema.json", + "$schema": "https://gist.githubusercontent.com/IT-WIBRC/baab4cc74a28af5b23936f5cf576f8e6/raw/ac5d88b59dd12c0714cacff88711e52e6d5f0e90/devkit-schema.json", "settings": { "language": "fr", "defaultPackageManager": "npm", @@ -482,7 +484,7 @@ For VS Code, open your **`settings.json`** file and add the following entry: "json.schemas": [ { "fileMatch": [".devkit.json", ".devkitrc"], - "url": "https://gist.githubusercontent.com/IT-WIBRC/baab4cc74a28af5b23936f5cf576f8e6/raw/ed7445f123554cf5ed7fc6fb727d1faae22a9bed/devkit-schema.json" + "url": "https://gist.githubusercontent.com/IT-WIBRC/baab4cc74a28af5b23936f5cf576f8e6/raw/ac5d88b59dd12c0714cacff88711e52e6d5f0e90/devkit-schema.json" } ] } diff --git a/packages/devkit/package.json b/packages/devkit/package.json index 54e568c..3290399 100644 --- a/packages/devkit/package.json +++ b/packages/devkit/package.json @@ -1,6 +1,6 @@ { "name": "scaffolder-toolkit", - "version": "1.0.11", + "version": "2.0.0", "description": "🚀 A universal command-line tool for developers to automate project scaffolding and streamline their workflows.", "keywords": [ "devkit",