pkg-scaffold 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 📦 pkg-scaffold v3.1.1
1
+ # 📦 pkg-scaffold v3.1.2
2
2
 
3
3
  **The Ultimate Enterprise Codebase Janitor: OXC-Powered, Type-Aware, and Self-Healing.**
4
4
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  ---
12
12
 
13
- ## 🚀 Why pkg-scaffold@3.1.1?
13
+ ## 🚀 Why pkg-scaffold@3.1.2?
14
14
 
15
15
  ### 1. Extreme Speed with OXC
16
16
  By integrating the Rust-based **OXC (Oxc-Parser & Oxc-Resolver)**, pkg-scaffold v3.1.0 achieves a **2-4x performance boost** over previous versions, matching and often exceeding the speed of Knip v6 for single-pass analysis.
@@ -97,6 +97,28 @@ Protect specific code from the janitor:
97
97
  export const internalHelper = () => { /* Safe from pruning */ };
98
98
  ```
99
99
 
100
+ ---
101
+ ## Depencies
102
+ ```json
103
+ "ansis": "^3.0.0",
104
+ "commander": "^12.0.0",
105
+ "enhanced-resolve": "^5.16.0",
106
+ "execa": "^8.0.1",
107
+ "oxc-parser": "^0.135.0",
108
+ "oxc-resolver": "^11.20.0",
109
+ "ramda": "^0.29.1",
110
+ "yocto-spinner": "^0.1.0"
111
+ ```
112
+ ---
113
+ ## DevDepencies
114
+ ```json
115
+ "@types/node": "^25.9.3",
116
+ "express": "^5.2.1",
117
+ "knip": "^6.16.1", //Used to make Plugins from knip compitable with the code
118
+ "lodash": "^4.18.1", //For Analysing
119
+ "typescript": "^6.0.3", //For Analysing
120
+ "vitepress": "^1.6.4" //For the Documentation
121
+ ```
100
122
  ---
101
123
 
102
124
  ## 📜 License
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * ============================================================================
5
- * 📦 pkg-scaffold v3.1.0: Ultimate Enterprise Codebase Janitor & Self-Healing Engine
5
+ * 📦 pkg-scaffold v3.1.2: Ultimate Enterprise Codebase Janitor & Self-Healing Engine
6
6
  * ============================================================================
7
7
  * * Eine hochgradig integrierte Code-Analyse- und Projektbootstrapping-Engine.
8
8
  * Kombiniert rekursive Erreichbarkeitsanalysen (Reachability Graphs) auf
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkg-scaffold",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "The ultimate enterprise-grade codebase janitor. Faster than Knip v6 with OXC integration, type-aware analysis, and self-healing capabilities.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,55 +0,0 @@
1
- name: Deploy VitePress site to Pages
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- permissions:
8
- contents: read
9
- pages: write
10
- id-token: write
11
-
12
- concurrency:
13
- group: "pages"
14
- cancel-in-progress: false
15
-
16
- jobs:
17
- build:
18
- runs-on: ubuntu-latest
19
- steps:
20
- - name: Checkout
21
- uses: actions/checkout@v4
22
- with:
23
- fetch-depth: 0
24
-
25
- - name: Setup Node
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: 20
29
- cache: 'npm'
30
-
31
- - name: Install dependencies
32
- run: npm install
33
-
34
- - name: Build with VitePress
35
- run: npm run docs:build
36
-
37
- - name: Setup Pages
38
- uses: actions/configure-pages@v4
39
-
40
- - name: Upload artifact
41
- uses: actions/upload-pages-artifact@v3
42
- with:
43
- path: docs/.vitepress/dist
44
-
45
- deploy:
46
- environment:
47
- name: github-pages
48
- url: ${{ steps.deployment.outputs.page_url }}
49
- needs: build
50
- runs-on: ubuntu-latest
51
- name: Deploy
52
- steps:
53
- - name: Deploy to GitHub Pages
54
- id: deployment
55
- uses: actions/deploy-pages@v4
@@ -1,20 +0,0 @@
1
- name: Publish to npm
2
- on:
3
- push:
4
- branches:
5
- - main
6
-
7
- jobs:
8
- publish:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v4
12
- - uses: actions/setup-node@v4
13
- with:
14
- node-version: 'latest'
15
- registry-url: 'https://registry.npmjs.org'
16
- - run: npm install
17
- - run: npm ci
18
- - run: npm publish --access public
19
- env:
20
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,41 +0,0 @@
1
- import { defineConfig } from 'vitepress'
2
-
3
- // https://vitepress.dev/reference/site-config
4
- export default defineConfig({
5
- title: "pkg-scaffold Documentation",
6
- base: '/pkg-scaffold/',
7
- description: "An advanced, AST-driven dependency resolution, refactoring, and self-healing engine.",
8
- themeConfig: {
9
- // https://vitepress.dev/reference/default-theme-config
10
- nav: [
11
- { text: 'Home', link: '/' },
12
- { text: 'Guide', link: '/guide' },
13
- { text: 'Reference', link: '/reference' }
14
- ],
15
-
16
- sidebar: [
17
- {
18
- text: 'Guide',
19
- items: [
20
- { text: 'Getting Started', link: '/guide' }
21
- ]
22
- },
23
- {
24
- text: 'CLI',
25
- items: [
26
- { text: 'Reference', link: '/reference' }
27
- ]
28
- }
29
- ],
30
-
31
- socialLinks: [
32
- { icon: 'github', link: 'https://github.com/DreamLongYT/pkg-scaffold' },
33
- { icon: 'npm', link: 'https://www.npmjs.com/package/pkg-scaffold'}
34
- ],
35
-
36
- footer: {
37
- message: 'Released under the MIT License.',
38
- copyright: 'Copyright © 2026 DreamLongYT'
39
- }
40
- }
41
- })
@@ -1,17 +0,0 @@
1
- // https://vitepress.dev/guide/custom-theme
2
- import { h } from 'vue'
3
- import type { Theme } from 'vitepress'
4
- import DefaultTheme from 'vitepress/theme'
5
- import './style.css'
6
-
7
- export default {
8
- extends: DefaultTheme,
9
- Layout: () => {
10
- return h(DefaultTheme.Layout, null, {
11
- // https://vitepress.dev/guide/extending-default-theme#layout-slots
12
- })
13
- },
14
- enhanceApp({ app, router, siteData }) {
15
- // ...
16
- }
17
- } satisfies Theme
@@ -1,139 +0,0 @@
1
- /**
2
- * Customize default theme styling by overriding CSS variables:
3
- * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
4
- */
5
-
6
- /**
7
- * Colors
8
- *
9
- * Each colors have exact same color scale system with 3 levels of solid
10
- * colors with different brightness, and 1 soft color.
11
- *
12
- * - `XXX-1`: The most solid color used mainly for colored text. It must
13
- * satisfy the contrast ratio against when used on top of `XXX-soft`.
14
- *
15
- * - `XXX-2`: The color used mainly for hover state of the button.
16
- *
17
- * - `XXX-3`: The color for solid background, such as bg color of the button.
18
- * It must satisfy the contrast ratio with pure white (#ffffff) text on
19
- * top of it.
20
- *
21
- * - `XXX-soft`: The color used for subtle background such as custom container
22
- * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
23
- * on top of it.
24
- *
25
- * The soft color must be semi transparent alpha channel. This is crucial
26
- * because it allows adding multiple "soft" colors on top of each other
27
- * to create a accent, such as when having inline code block inside
28
- * custom containers.
29
- *
30
- * - `default`: The color used purely for subtle indication without any
31
- * special meanings attached to it such as bg color for menu hover state.
32
- *
33
- * - `brand`: Used for primary brand colors, such as link text, button with
34
- * brand theme, etc.
35
- *
36
- * - `tip`: Used to indicate useful information. The default theme uses the
37
- * brand color for this by default.
38
- *
39
- * - `warning`: Used to indicate warning to the users. Used in custom
40
- * container, badges, etc.
41
- *
42
- * - `danger`: Used to show error, or dangerous message to the users. Used
43
- * in custom container, badges, etc.
44
- * -------------------------------------------------------------------------- */
45
-
46
- :root {
47
- --vp-c-default-1: var(--vp-c-gray-1);
48
- --vp-c-default-2: var(--vp-c-gray-2);
49
- --vp-c-default-3: var(--vp-c-gray-3);
50
- --vp-c-default-soft: var(--vp-c-gray-soft);
51
-
52
- --vp-c-brand-1: var(--vp-c-indigo-1);
53
- --vp-c-brand-2: var(--vp-c-indigo-2);
54
- --vp-c-brand-3: var(--vp-c-indigo-3);
55
- --vp-c-brand-soft: var(--vp-c-indigo-soft);
56
-
57
- --vp-c-tip-1: var(--vp-c-brand-1);
58
- --vp-c-tip-2: var(--vp-c-brand-2);
59
- --vp-c-tip-3: var(--vp-c-brand-3);
60
- --vp-c-tip-soft: var(--vp-c-brand-soft);
61
-
62
- --vp-c-warning-1: var(--vp-c-yellow-1);
63
- --vp-c-warning-2: var(--vp-c-yellow-2);
64
- --vp-c-warning-3: var(--vp-c-yellow-3);
65
- --vp-c-warning-soft: var(--vp-c-yellow-soft);
66
-
67
- --vp-c-danger-1: var(--vp-c-red-1);
68
- --vp-c-danger-2: var(--vp-c-red-2);
69
- --vp-c-danger-3: var(--vp-c-red-3);
70
- --vp-c-danger-soft: var(--vp-c-red-soft);
71
- }
72
-
73
- /**
74
- * Component: Button
75
- * -------------------------------------------------------------------------- */
76
-
77
- :root {
78
- --vp-button-brand-border: transparent;
79
- --vp-button-brand-text: var(--vp-c-white);
80
- --vp-button-brand-bg: var(--vp-c-brand-3);
81
- --vp-button-brand-hover-border: transparent;
82
- --vp-button-brand-hover-text: var(--vp-c-white);
83
- --vp-button-brand-hover-bg: var(--vp-c-brand-2);
84
- --vp-button-brand-active-border: transparent;
85
- --vp-button-brand-active-text: var(--vp-c-white);
86
- --vp-button-brand-active-bg: var(--vp-c-brand-1);
87
- }
88
-
89
- /**
90
- * Component: Home
91
- * -------------------------------------------------------------------------- */
92
-
93
- :root {
94
- --vp-home-hero-name-color: transparent;
95
- --vp-home-hero-name-background: -webkit-linear-gradient(
96
- 120deg,
97
- #bd34fe 30%,
98
- #41d1ff
99
- );
100
-
101
- --vp-home-hero-image-background-image: linear-gradient(
102
- -45deg,
103
- #bd34fe 50%,
104
- #47caff 50%
105
- );
106
- --vp-home-hero-image-filter: blur(44px);
107
- }
108
-
109
- @media (min-width: 640px) {
110
- :root {
111
- --vp-home-hero-image-filter: blur(56px);
112
- }
113
- }
114
-
115
- @media (min-width: 960px) {
116
- :root {
117
- --vp-home-hero-image-filter: blur(68px);
118
- }
119
- }
120
-
121
- /**
122
- * Component: Custom Block
123
- * -------------------------------------------------------------------------- */
124
-
125
- :root {
126
- --vp-custom-block-tip-border: transparent;
127
- --vp-custom-block-tip-text: var(--vp-c-text-1);
128
- --vp-custom-block-tip-bg: var(--vp-c-brand-soft);
129
- --vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
130
- }
131
-
132
- /**
133
- * Component: Algolia
134
- * -------------------------------------------------------------------------- */
135
-
136
- .DocSearch {
137
- --docsearch-primary-color: var(--vp-c-brand-1) !important;
138
- }
139
-
package/docs/guide.md DELETED
@@ -1,102 +0,0 @@
1
- # Getting Started with pkg-scaffold
2
-
3
- This guide will walk you through the installation and basic usage of `pkg-scaffold`. Learn how to quickly clean and optimize your project.
4
-
5
- ## Installation
6
-
7
- `pkg-scaffold` is an npm package and can be easily installed in your project. It is recommended to install it as a `devDependency`.
8
-
9
- ```bash
10
- npm install --save-dev pkg-scaffold
11
- # or
12
- yarn add --dev pkg-scaffold
13
- # or
14
- pnpm add --save-dev pkg-scaffold
15
- ```
16
-
17
- After installation, you can run `pkg-scaffold` via `npx` or by adding a script to your `package.json`.
18
-
19
- ## Basic Usage
20
-
21
- ### Dry-Run Mode (Recommended)
22
-
23
- Before making any changes to your project, it is always advisable to use the dry-run mode. This mode analyzes your project and shows you which changes *would be made* without actually applying them.
24
-
25
- ```bash
26
- npx pkg-scaffold --no-fix
27
- ```
28
-
29
- This command will output a summary of identified issues, such as orphaned files or potential refactoring opportunities.
30
-
31
- ### Applying Changes
32
-
33
- If you are satisfied with the proposed changes, you can run `pkg-scaffold` with the `--fix` option to apply the changes to your project. The `--yes` option skips the confirmation prompt.
34
-
35
- ```bash
36
- npx pkg-scaffold --fix --yes
37
- ```
38
-
39
- **Caution:** Ensure you have backed up your changes or are in a version control system before using this option.
40
-
41
- ### Monorepo Support
42
-
43
- For projects organized in a monorepo, `pkg-scaffold` can be run with the `--workspace` option to analyze and optimize all packages within the workspace.
44
-
45
- ```bash
46
- npx pkg-scaffold --workspace --fix --yes
47
- ```
48
-
49
- ## Next Steps
50
-
51
- * Learn more about all available options in the [Reference](/reference).
52
- * Visit the [GitHub Repository](https://github.com/DreamLongYT/pkg-scaffold) for the latest updates and to report issues.
53
-
54
- ## Plugin Development
55
-
56
- Building a plugin for pkg-scaffold is straightforward. You need to export a class that extends the `BasePlugin` (or follows its structure).
57
-
58
- ### Basic Plugin Structure
59
-
60
- ```javascript
61
- export default class MyCustomPlugin {
62
- constructor(context) {
63
- this.context = context;
64
- }
65
-
66
- // Unique identifier for the plugin
67
- get name() {
68
- return 'my-plugin';
69
- }
70
-
71
- // Files that indicate this ecosystem is active
72
- getConfigFiles() {
73
- return ['my-config.json'];
74
- }
75
-
76
- // Regex patterns for entry point files
77
- getRoutePatterns() {
78
- return [
79
- /\/src\/routes\/.*\.js$/
80
- ];
81
- }
82
-
83
- // Symbols that should never be flagged as unused in entry points
84
- getRequiredSystemContracts() {
85
- return ['default', 'handler', 'config'];
86
- }
87
-
88
- // Logic to determine if the plugin should run
89
- async isActive(baseDir) {
90
- // Return true if your framework is detected
91
- return true;
92
- }
93
- }
94
- ```
95
-
96
- ### Advanced: Interfacing with the Engine
97
-
98
- Plugins have access to the `context`, allowing them to trigger specific engine behaviors like `fastMode` or `selfHealing` for certain file types.
99
-
100
- ### Knip Compatibility
101
-
102
- If you are porting a Knip plugin, ensure the export mappings align with the `getRoutePatterns()` and `getRequiredSystemContracts()` methods to ensure full compatibility with the pkg-scaffold resolution graph.
package/docs/index.md DELETED
@@ -1,64 +0,0 @@
1
- ---
2
- layout: home
3
-
4
- hero:
5
- name: "pkg-scaffold"
6
- text: "AST-driven Refactoring & Self-Healing Engine"
7
- tagline: "Optimize your codebase with precise AST analysis and automated cleanup."
8
- actions:
9
- - theme: brand
10
- text: Get Started
11
- link: /guide
12
- - theme: alt
13
- text: View on GitHub
14
- link: https://github.com/DreamLongYT/pkg-scaffold
15
-
16
- features:
17
- - title: AST-Driven Analysis
18
- details: pkg-scaffold leverages Abstract Syntax Trees (ASTs) for deep and precise analysis of your codebase, identifying unused structures and optimization potentials.
19
- - title: Intelligent Refactoring
20
- details: Automatic detection and pruning of orphaned files and dead code to improve the maintainability and performance of your project.
21
- - title: Dry-Run Mode
22
- details: Preview all proposed structural changes before they are actually applied, ensuring maximum control and safety.
23
- - title: Monorepo Support
24
- details: Optimized for complex project structures and monorepos, ensuring consistent code quality across multiple packages.
25
- - title: Integrated Test Validation
26
- details: Executes integrated tests after each modification to verify workspace integrity and prevent regressions.
27
- - title: Seamless Integration
28
- details: As a CLI tool, pkg-scaffold integrates effortlessly into existing CI/CD workflows and development environments.
29
- ---
30
-
31
-
32
- # Welcome to pkg-scaffold
33
-
34
- pkg-scaffold is a powerful command-line tool designed to enhance the health and efficiency of your JavaScript and TypeScript projects. By utilizing an advanced AST engine, it identifies and fixes structural issues, optimizes dependencies, and ensures a clean and maintainable codebase.
35
-
36
- Whether you are working on a small project or a large monorepo, pkg-scaffold helps streamline your development experience and secure the quality of your code.
37
-
38
- ## pkg-scaffold vs. Knip.dev vs. ts-prune
39
-
40
- While tools like Knip.dev and ts-prune are excellent for specific tasks, pkg-scaffold offers a unique approach with its AST-driven refactoring and self-healing capabilities. Here's how it compares:
41
-
42
- | Feature / Tool | pkg-scaffold | Knip.dev | ts-prune |
43
- | :------------------- | :--------------------------------------------- | :------------------------------------------- | :----------------------------------------- |
44
- | **Primary Focus** | Structural Refactoring, Self-Healing, Orphaned Files | Unused Dependencies, Exports, Files | Unused Exports |
45
- | **Analysis Method** | AST-driven, Deep Structural Analysis | Deep Analysis with fine-grained entry points | TypeScript Compiler API |
46
- | **Unused Dependencies** | Limited (focus on structural usage) | Yes (very detailed) | No |
47
- | **Unused Exports** | No (currently) | Yes | Yes |
48
- | **Orphaned Files** | Yes (core feature) | Yes | No |
49
- | **Automated Fixes** | Yes (`--fix` option) | Yes | No (reporting only) |
50
- | **Monorepo Support** | Yes | Yes | Limited |
51
- | **Integrated Test Validation** | Yes (post-fix) | No | No |
52
- | **Key Advantage** | **Proactive structural integrity, self-healing, prevents file bloat.** | **Comprehensive dependency/export cleanup, excellent for bundle size.** | **Simple, fast unused export detection for TS.** |
53
-
54
- ### Where pkg-scaffold excels:
55
-
56
- pkg-scaffold shines in maintaining the **structural integrity** of your project. Unlike Knip.dev, which focuses heavily on unused dependencies and exports (often for bundle size optimization), pkg-scaffold's core strength lies in:
57
-
58
- * **Orphaned File Detection & Pruning:** It actively identifies and removes files that are no longer referenced anywhere in your codebase, preventing file system bloat and confusion.
59
- * **AST-driven Self-Healing:** Its deep AST analysis allows for more intelligent structural refactoring, ensuring that your project's architecture remains sound over time.
60
- * **Integrated Safety:** By running tests post-fix, it provides an additional layer of confidence that automated changes haven't introduced regressions.
61
-
62
- While Knip.dev is superior for finding unused `package.json` dependencies and exports, pkg-scaffold complements it by focusing on the physical file structure and overall project health. ts-prune is a simpler tool specifically for TypeScript unused exports.
63
-
64
- Start optimizing your projects today! Head over to the [Getting Started Guide](/guide) to learn more.
package/docs/reference.md DELETED
@@ -1,52 +0,0 @@
1
- # CLI Reference
2
-
3
- This page lists all available command-line options for `pkg-scaffold`.
4
-
5
- ```text
6
- Usage: pkg-scaffold [options]
7
- Enterprise-Grade AST Syntax Refactoring & Self-Healing Engine
8
-
9
- Options:
10
- -V, --version output the version number
11
- -c, --cwd <path> Specify the execution context root directory (default: "/home/ubuntu/test-project")
12
- --fix Enable atomic code updates, structural file pruning, and active type sanitization (default: true)
13
- --no-fix Disable direct file manipulation modifications (dry-run reporting mode)
14
- --tsconfig <filename> Specify path to custom layout configurations (default: "tsconfig.json")
15
- --test-command <command> Integrated continuous safety test validation script execution path (default: "npm test")
16
- --workspace Enable high-density workspace workspace/monorepo cluster mesh evaluation parsing (default: false)
17
- --verbose Toggle expanded trace telemetry for debug operational diagnostics (default: false)
18
- -y, --yes Skip confirmation prompts and execute planned structural modifications automatically (default: false)
19
- -h, --help display help for command
20
- ```
21
-
22
- ## Options in Detail
23
-
24
- ### `-V`, `--version`
25
- Displays the current version of `pkg-scaffold`.
26
-
27
- ### `-c`, `--cwd <path>`
28
- Defines the root directory where `pkg-scaffold` should be executed. By default, this is the current working directory.
29
-
30
- ### `--fix`
31
- Activates the mode for atomic code updates, structural file pruning, and active type sanitization. This is the mode in which `pkg-scaffold` makes actual changes to your code.
32
-
33
- ### `--no-fix`
34
- Disables direct file manipulation modifications. `pkg-scaffold` performs an analysis and reports on potential changes without applying them (dry-run mode).
35
-
36
- ### `--tsconfig <filename>`
37
- Specifies the path to a custom `tsconfig.json` file. By default, `pkg-scaffold` looks for `tsconfig.json` in the current working directory.
38
-
39
- ### `--test-command <command>`
40
- Defines the command to be executed for integrated continuous safety test validation after changes. By default, `npm test` is used.
41
-
42
- ### `--workspace`
43
- Enables evaluation of workspaces/monorepo clusters. When this option is enabled, `pkg-scaffold` analyzes and optimizes all packages within a monorepo.
44
-
45
- ### `--verbose`
46
- Enables expanded trace telemetry for debug operational diagnostics, providing more detailed output during execution.
47
-
48
- ### `-y`, `--yes`
49
- Skips all confirmation prompts and automatically executes planned structural modifications. **Use with caution in production environments without prior review.**
50
-
51
- ### `-h`, `--help`
52
- Displays help information for `pkg-scaffold`.