Comparing version 0.1.5 to 0.1.6
@@ -30,3 +30,3 @@ #!/usr/bin/env node | ||
// package.json | ||
var version = "0.1.5"; | ||
var version = "0.1.6"; | ||
@@ -44,3 +44,6 @@ // src/utilis/util.get.version.ts | ||
var import_os = __toESM(require("os")); | ||
var _ConfigCommandUtil = class _ConfigCommandUtil { | ||
var ConfigCommandUtil = class _ConfigCommandUtil { | ||
// File names for configuration | ||
static configFileName = "oi-config.json"; | ||
static globalConfigFileName = "oi-global-config.json"; | ||
/** | ||
@@ -159,6 +162,2 @@ * Checks if the specified configuration file (local or global) exists. | ||
}; | ||
// File names for configuration | ||
_ConfigCommandUtil.configFileName = "oi-config.json"; | ||
_ConfigCommandUtil.globalConfigFileName = "oi-global-config.json"; | ||
var ConfigCommandUtil = _ConfigCommandUtil; | ||
var util_command_config_default = new ConfigCommandUtil(); | ||
@@ -168,2 +167,3 @@ | ||
var OiCommand = class { | ||
program; | ||
constructor(program2) { | ||
@@ -305,2 +305,4 @@ this.program = program2; | ||
var Config = class extends abstract_command_default { | ||
platforms; | ||
platformQuestions; | ||
constructor(program2) { | ||
@@ -449,2 +451,5 @@ super(program2); | ||
var LocalCache = class _LocalCache { | ||
static instance; | ||
// Singleton instance | ||
cache; | ||
// Array to store old code blocks | ||
@@ -496,16 +501,16 @@ constructor() { | ||
var UserPromptService = class { | ||
// Regular expressions to match specific prompt types | ||
static regPrompt = /\/\/>\s*((?:(?!-\/\/)[\s\S])*?)\s*<\/\//g; | ||
// Matches user prompts | ||
static regGenerated = /\/\/-\s*([\s\S]*?)\s*-\/\//g; | ||
// Matches generated code blocks | ||
static regAcceptance = /\/\/>\s*Accept the changes \(y\/n\):\s*([ynYN])\s*-\/\//g; | ||
// Matches acceptance prompts | ||
// Regular expressions for specific annotations | ||
static regComment = /\/\/@\s*comment\s*$/g; | ||
// Matches //@comment with no extra text after it | ||
static regContext = /\/\/@\s*context\s*$/g; | ||
// Matches //@context with no extra text after it | ||
static regComplete = /\/\/@\s*complete\s*$/g; | ||
}; | ||
// Regular expressions to match specific prompt types | ||
UserPromptService.regPrompt = /\/\/>\s*((?:(?!-\/\/)[\s\S])*?)\s*<\/\//g; | ||
// Matches user prompts | ||
UserPromptService.regGenerated = /\/\/-\s*([\s\S]*?)\s*-\/\//g; | ||
// Matches generated code blocks | ||
UserPromptService.regAcceptance = /\/\/>\s*Accept the changes \(y\/n\):\s*([ynYN])\s*-\/\//g; | ||
// Matches acceptance prompts | ||
// Regular expressions for specific annotations | ||
UserPromptService.regComment = /\/\/@\s*comment\s*$/g; | ||
// Matches //@comment with no extra text after it | ||
UserPromptService.regContext = /\/\/@\s*context\s*$/g; | ||
// Matches //@context with no extra text after it | ||
UserPromptService.regComplete = /\/\/@\s*complete\s*$/g; | ||
var UserPromptServiceImpl = class extends UserPromptService { | ||
@@ -1097,2 +1102,3 @@ /** | ||
var SystemPromptServiceImpl = class extends SystemPromptService { | ||
basePrompt; | ||
constructor() { | ||
@@ -1567,6 +1573,3 @@ super(); | ||
var Start = class extends abstract_command_default { | ||
constructor() { | ||
super(...arguments); | ||
this.watcher = null; | ||
} | ||
watcher = null; | ||
/** | ||
@@ -1573,0 +1576,0 @@ * Configures the `start` command, adding it to the program with any |
{ | ||
"name": "overide", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "This is a CLI based Code Generation Tool.", | ||
"type": "commonjs", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"bin": { | ||
@@ -14,11 +15,2 @@ "overide": "dist/index.js" | ||
], | ||
"scripts": { | ||
"build": "tsup ./src/index.ts", | ||
"dev": "tsup ./src/index.ts --watch", | ||
"lint:check": "eslint \"src/**/*.ts\"", | ||
"lint:fix": "eslint \"src/**/*.ts\" --fix", | ||
"overide": "node dist/index.js", | ||
"version": "npm run build && git add -A dist", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"author": "Abhijeet Dash", | ||
@@ -37,2 +29,3 @@ "license": "GPL-2.0", | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.9", | ||
"@eslint/js": "^9.11.1", | ||
@@ -45,5 +38,19 @@ "@typescript-eslint/eslint-plugin": "^8.12.2", | ||
"prettier": "^3.3.3", | ||
"tsup": "^8.3.5", | ||
"typescript": "^5.6.3" | ||
"tsup": "^8.3.5" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/oi-overide/oi.git" | ||
}, | ||
"scripts": { | ||
"build": "tsup ./src/index.ts --format cjs,esm", | ||
"dev": "tsup ./src/index.ts --watch", | ||
"lint:check": "eslint \"src/**/*.ts\"", | ||
"lint:fix": "eslint \"src/**/*.ts\" --fix", | ||
"overide": "node dist/index.js", | ||
"release": "pnpm build && changeset publish" | ||
} | ||
} | ||
} |
# Overide | ||
**Overide** is a lightweight yet powerful CLI tool designed to simplify AI-powered code generation directly within your development workflow. With Oi, you can quickly generate, update, and integrate code using predefined prompts, allowing you to focus on the creative aspects of coding while letting AI handle the heavy lifting. | ||
**Overide** is a lightweight yet powerful CLI tool designed to simplify AI-powered code generation directly within your development workflow. With Overide, you can quickly generate, update, and integrate code using predefined prompts, allowing you to focus on the creative aspects of coding while letting AI handle the heavy lifting. | ||
## Table of Contents | ||
- [Key Features](#key-features) | ||
@@ -10,3 +11,3 @@ - [Installation](#installation) | ||
- [Adding API Key](#adding-api-key) | ||
- [Initialize a Project](#initialize-a-project) | ||
- [Configure a Project](#configure-a-project) | ||
- [Start Monitoring](#start-monitoring) | ||
@@ -17,2 +18,3 @@ - [Code Generation](#code-generation) | ||
- [Development Workflow](#development-workflow) | ||
- [Version Management with Changesets](#version-management-with-changesets) | ||
- [Development Testing](#development-testing) | ||
@@ -59,5 +61,5 @@ - [Future Plans (v2.0)](#future-plans-v20) | ||
### Initialize a Project | ||
### Configure a Project | ||
Initialize Overide in your project directory: | ||
Configure Overide in your project directory: | ||
@@ -115,16 +117,51 @@ ```bash | ||
6. Periodically, `dev` merges to `staging` | ||
7. When ready, `staging` merges to `main` with version prefix: | ||
- `patch:` for bug fixes (0.0.X) | ||
- `minor:` for new features (0.X.0) | ||
- `major:` for breaking changes (X.0.0) | ||
7. When ready, `staging` merges to `main` | ||
Example PR titles: | ||
- "patch: Bug fixes for v0.0.6" | ||
- "minor: New features for v0.1.0" | ||
- "major: Breaking changes for v2.0.0" | ||
### Version Management with Changesets | ||
We use [changesets](https://github.com/changesets/changesets) for version management. After making changes: | ||
1. Create a changeset: | ||
```bash | ||
pnpm changeset | ||
``` | ||
2. Follow the prompts to: | ||
- Select change type (patch/minor/major) | ||
- Describe your changes | ||
- This creates a file in `.changeset` directory | ||
3. Commit both your changes and the changeset file | ||
When changes are merged to `main`: | ||
- A "Version Packages" PR is automatically created | ||
- When merged, it: | ||
- Updates package version | ||
- Updates changelog | ||
- Publishes to npm | ||
#### Change Types | ||
- `patch`: Bug fixes and minor updates (0.0.X) | ||
- `minor`: New features (0.X.0) | ||
- `major`: Breaking changes (X.0.0) | ||
#### Example Workflow (for reference) | ||
1. Make changes in feature branch | ||
2. Run `pnpm changeset` | ||
3. Select change type and add description | ||
4. Commit and push changes with changeset | ||
5. Create PR to `dev` | ||
6. When eventually merged to `main`, changes are published | ||
### Development & Testing | ||
#### Local Development (Hot Reloading) | ||
1. Start the development watcher: | ||
```bash | ||
@@ -139,5 +176,5 @@ npm run dev | ||
```bash | ||
npm run overide init | ||
npm run overide [init | config | start] | ||
# or | ||
pnpm overide init | ||
pnpm overide [init | config | start] | ||
``` | ||
@@ -148,2 +185,3 @@ | ||
#### Local Production Testing | ||
1. Build and create global link: | ||
@@ -177,2 +215,3 @@ ```bash | ||
#### Why Development Testing? | ||
- **Hot Reload**: Test changes instantly without manual rebuilds | ||
@@ -184,2 +223,3 @@ - **Real-time Feedback**: See immediate results of code modifications | ||
#### Why Link Testing? | ||
- Test CLI as if installed globally | ||
@@ -186,0 +226,0 @@ - Verify changes before publishing |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
235
10
161392
6
3422
1