-
Notifications
You must be signed in to change notification settings - Fork 38
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
📦 NEW: Config based env #38
Draft
ahmadawais
wants to merge
25
commits into
main
Choose a base branch
from
aa/config-env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3e3dfea
📦 NEW: Config based env
ahmadawais 67da79a
📦 NEW: Config based env
ahmadawais b6343b7
🐛 FIX: Env defaults
ahmadawais 3939401
🐛 FIX: Exampels
ahmadawais 6ec1f42
👌 IMPROVE: env is optional
ahmadawais e0dfbb0
👌 IMPROVE: types
ahmadawais 17c0dbd
📦 NEW: config env optional
ahmadawais 34404e9
👌 IMPROVE: types
ahmadawais 6573be3
👌 IMPROVE: snapshot
ahmadawais 7efa581
🐛 FIX: snapshot
ahmadawais 6d24ead
📦 NEW: snapshot script
ahmadawais 34ca39d
📦 NEW: snapshot script
ahmadawais 64b6d3e
📦 NEW: snapshot script
ahmadawais 703df56
👌 IMPROVE: snapshot script
ahmadawais 3ecd6a3
👌 IMPROVE: snapshot script
ahmadawais d790f9f
👌 IMPROVE: snapshot script
ahmadawais 4a36602
👌 IMPROVE: snapshot script
ahmadawais 53589eb
👌 IMPROVE: snapshot script
ahmadawais 0378e88
🐛 FIX: versions
ahmadawais a8d16d5
🐛 FIX: versions
ahmadawais 36d3c6c
📖 DOC: snapshot
ahmadawais ad6cd4d
🐛 FIX: scripts
ahmadawais 4abb478
📦 NEW: snapshot release
ahmadawais d32cfe4
📦 NEW: snapshot release
ahmadawais 864ff07
📦 NEW: snapshot release
ahmadawais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* This script creates a snapshot release by performing the following steps: | ||
* 1. Ensures the script is running from the project root directory. | ||
* 2. Defines a function to execute shell commands and log their output. | ||
* 3. Defines a function to update the version in a given package.json file. | ||
* - If the current version is already a snapshot, it increments the snapshot number. | ||
* - If the current version is not a snapshot, it increments the patch version and sets the snapshot number to 0. | ||
* 4. Retrieves the current commit short SHA. | ||
* 5. Bumps the version in the specified package.json files. | ||
* 6. Runs a series of commands to version, build, and publish the packages as a snapshot release. | ||
* | ||
* @file /Users/ahmadawais/Documents/Sandbox/baseai/.github/scripts/create-snapshot.js | ||
* @requires child_process | ||
* @requires path | ||
* @requires fs | ||
*/ | ||
const {execSync} = require('child_process'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
// Ensure we're in the project root | ||
process.chdir(path.resolve(__dirname, '../..')); | ||
|
||
// Function to execute commands and log output | ||
function run(command) { | ||
console.log(`Running: ${command}`); | ||
try { | ||
execSync(command, {stdio: 'inherit'}); | ||
} catch (error) { | ||
console.error(`Error executing command: ${command}`); | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
// Function to update version in package.json | ||
function bumpVersion(packagePath) { | ||
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8')); | ||
const currentVersion = pkg.version; | ||
let [major, minor, patch, snapshot] = currentVersion | ||
.split(/[-.]/) | ||
.map(v => (isNaN(parseInt(v)) ? v : parseInt(v))); | ||
|
||
if (snapshot === 'snapshot') { | ||
// If already a snapshot, increment the snapshot number | ||
snapshot = parseInt(pkg.version.split('-snapshot.')[1]) + 1; | ||
} else { | ||
// If not a snapshot, increment patch and set snapshot to 0 | ||
patch += 1; | ||
snapshot = 0; | ||
} | ||
|
||
pkg.version = `${major}.${minor}.${patch}-snapshot.${snapshot}`; | ||
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2)); | ||
console.log(`Updated ${packagePath} to version ${pkg.version}`); | ||
} | ||
|
||
// Get the current commit short SHA | ||
const SHORT_SHA = execSync('git rev-parse --short HEAD').toString().trim(); | ||
|
||
console.log('Creating snapshot release...'); | ||
|
||
// Bump versions | ||
bumpVersion('./packages/baseai/package.json'); | ||
bumpVersion('./packages/core/package.json'); | ||
|
||
// Version and tag the snapshot release | ||
run(`pnpm changeset version --snapshot ${SHORT_SHA}`); | ||
|
||
// Build and publish the snapshot release | ||
run('pnpm build:pkgs'); | ||
run('pnpm changeset publish --no-git-tag --tag snapshot'); | ||
|
||
// Reset Git changes | ||
console.log('Git commit and push changes...'); | ||
run('git add . && git commit -m "📦 NEW: snapshot release" && git push'); | ||
|
||
console.log('All changes have been reset. Snapshot release process complete!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,117 @@ | ||
{ | ||
"name": "baseai", | ||
"description": "The Web AI Framework Dev - BaseAI.dev", | ||
"version": "0.9.7", | ||
"license": "UNLICENSED", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"bin": { | ||
"baseai": "bin/baseai.js" | ||
}, | ||
"author": { | ||
"name": "Langbase", | ||
"url": "https://BaseAI.dev" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/LangbaseInc/baseai.git", | ||
"directory": "packages/cli" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/LangbaseInc/baseai/issues" | ||
}, | ||
"homepage": "https://BaseAI.dev", | ||
"files": [ | ||
"dist/**" | ||
], | ||
"scripts": { | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"lint": "eslint \"src/**/*.ts*\"", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"type-check": "tsc --noEmit", | ||
"prettier-check": "prettier --check \"./**/*.ts*\"", | ||
"test": "pnpm test:node && pnpm test:edge", | ||
"#test": "pnpm test:node && pnpm test:edge && pnpm test:ui && pnpm test:e2e", | ||
"test:edge": "vitest --config vitest.edge.config.js --run", | ||
"test:node": "vitest --config vitest.node.config.js --run", | ||
"test:ui": "pnpm test:ui:react", | ||
"test:ui:react": "vitest --config vitest.ui.react.config.js --run", | ||
"test:e2e": "playwright test", | ||
"test:edge:watch": "vitest --config vitest.edge.config.js", | ||
"test:node:watch": "vitest --config vitest.node.config.js", | ||
"test:ui:react:watch": "vitest --config vitest.ui.react.config.js" | ||
}, | ||
"dependencies": { | ||
"@antfu/ni": "^0.23.0", | ||
"@clack/core": "^0.3.4", | ||
"@clack/prompts": "^0.7.0", | ||
"@hono/node-server": "^1.13.1", | ||
"@hono/zod-openapi": "^0.16.0", | ||
"@sindresorhus/slugify": "^2.2.1", | ||
"camelcase": "^8.0.0", | ||
"chalk": "^5.3.0", | ||
"cli-alerts": "^2.0.0", | ||
"cli-handle-error": "^4.4.0", | ||
"cli-handle-unhandled": "^1.1.1", | ||
"cli-meow-help": "^4.0.0", | ||
"cli-table3": "^0.6.5", | ||
"cli-welcome": "^3.0.0", | ||
"compute-cosine-similarity": "^1.1.0", | ||
"conf": "^13.0.1", | ||
"cosmiconfig": "^9.0.0", | ||
"cosmiconfig-typescript-loader": "^5.0.0", | ||
"dotenv": "^16.4.5", | ||
"execa": "^9.4.0", | ||
"figures": "^6.1.0", | ||
"get-package-json-file": "^2.0.0", | ||
"hono": "^4.5.11", | ||
"js-tiktoken": "^1.0.14", | ||
"log-symbols": "^7.0.0", | ||
"lowdb": "^7.0.1", | ||
"meow": "^13.2.0", | ||
"node-fetch": "^3.3.2", | ||
"open": "^10.1.0", | ||
"openai": "^4.63.0", | ||
"p-map": "^7.0.2", | ||
"picocolors": "^1.1.0", | ||
"prettier": "^3.3.3", | ||
"source-map-support": "^0.5.21", | ||
"unpdf": "^0.11.0", | ||
"uuid": "^10.0.0", | ||
"xlsx": "^0.18.5", | ||
"zod": "^3.23.8", | ||
"zod-error": "^1.5.0", | ||
"zod-validation-error": "^3.4.0" | ||
}, | ||
"devDependencies": { | ||
"@baseai/eslint-config": "workspace:*", | ||
"@baseai/tsconfig": "workspace:*", | ||
"@types/node": "^22.6.1", | ||
"tsup": "^8.3.0", | ||
"tsx": "^4.19.1", | ||
"typescript": "^5.6.2", | ||
"vitest": "1.6.0" | ||
}, | ||
"keywords": [ | ||
"baseai", | ||
"base", | ||
"base AI framework", | ||
"BaseAI.dev", | ||
"composable AI", | ||
"AI agents", | ||
"AI multi agents", | ||
"ai", | ||
"llm", | ||
"langbase core", | ||
"langbase sdk", | ||
"baseai", | ||
"base ai", | ||
"langbase", | ||
"langbase.com", | ||
"generative AI" | ||
] | ||
} | ||
"name": "baseai", | ||
"description": "The Web AI Framework Dev - BaseAI.dev", | ||
"version": "0.9.8-snapshot.3", | ||
"license": "UNLICENSED", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"bin": { | ||
"baseai": "bin/baseai.js" | ||
}, | ||
"author": { | ||
"name": "Langbase", | ||
"url": "https://BaseAI.dev" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/LangbaseInc/baseai.git", | ||
"directory": "packages/cli" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/LangbaseInc/baseai/issues" | ||
}, | ||
"homepage": "https://BaseAI.dev", | ||
"files": [ | ||
"dist/**", | ||
"bin/**" | ||
], | ||
"scripts": { | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"lint": "eslint \"src/**/*.ts*\"", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"type-check": "tsc --noEmit", | ||
"prettier-check": "prettier --check \"./**/*.ts*\"", | ||
"test": "pnpm test:node && pnpm test:edge", | ||
"#test": "pnpm test:node && pnpm test:edge && pnpm test:ui && pnpm test:e2e", | ||
"test:edge": "vitest --config vitest.edge.config.js --run", | ||
"test:node": "vitest --config vitest.node.config.js --run", | ||
"test:ui": "pnpm test:ui:react", | ||
"test:ui:react": "vitest --config vitest.ui.react.config.js --run", | ||
"test:e2e": "playwright test", | ||
"test:edge:watch": "vitest --config vitest.edge.config.js", | ||
"test:node:watch": "vitest --config vitest.node.config.js", | ||
"test:ui:react:watch": "vitest --config vitest.ui.react.config.js" | ||
}, | ||
"dependencies": { | ||
"@antfu/ni": "^0.23.0", | ||
"@clack/core": "^0.3.4", | ||
"@clack/prompts": "^0.7.0", | ||
"@hono/node-server": "^1.13.1", | ||
"@hono/zod-openapi": "^0.16.0", | ||
"@sindresorhus/slugify": "^2.2.1", | ||
"camelcase": "^8.0.0", | ||
"chalk": "^5.3.0", | ||
"cli-alerts": "^2.0.0", | ||
"cli-handle-error": "^4.4.0", | ||
"cli-handle-unhandled": "^1.1.1", | ||
"cli-meow-help": "^4.0.0", | ||
"cli-table3": "^0.6.5", | ||
"cli-welcome": "^3.0.0", | ||
"compute-cosine-similarity": "^1.1.0", | ||
"conf": "^13.0.1", | ||
"cosmiconfig": "^9.0.0", | ||
"cosmiconfig-typescript-loader": "^5.0.0", | ||
"dotenv": "^16.4.5", | ||
"execa": "^9.4.0", | ||
"figures": "^6.1.0", | ||
"get-package-json-file": "^2.0.0", | ||
"hono": "^4.5.11", | ||
"js-tiktoken": "^1.0.14", | ||
"log-symbols": "^7.0.0", | ||
"lowdb": "^7.0.1", | ||
"meow": "^13.2.0", | ||
"node-fetch": "^3.3.2", | ||
"open": "^10.1.0", | ||
"openai": "^4.63.0", | ||
"p-map": "^7.0.2", | ||
"picocolors": "^1.1.0", | ||
"prettier": "^3.3.3", | ||
"source-map-support": "^0.5.21", | ||
"unpdf": "^0.11.0", | ||
"uuid": "^10.0.0", | ||
"xlsx": "^0.18.5", | ||
"zod": "^3.23.8", | ||
"zod-error": "^1.5.0", | ||
"zod-validation-error": "^3.4.0" | ||
}, | ||
"devDependencies": { | ||
"@baseai/eslint-config": "workspace:*", | ||
"@baseai/tsconfig": "workspace:*", | ||
"@types/node": "^22.6.1", | ||
"tsup": "^8.3.0", | ||
"tsx": "^4.19.1", | ||
"typescript": "^5.6.2", | ||
"vitest": "1.6.0" | ||
}, | ||
"keywords": [ | ||
"baseai", | ||
"base", | ||
"base AI framework", | ||
"BaseAI.dev", | ||
"composable AI", | ||
"AI agents", | ||
"AI multi agents", | ||
"ai", | ||
"llm", | ||
"langbase core", | ||
"langbase sdk", | ||
"baseai", | ||
"base ai", | ||
"langbase", | ||
"langbase.com", | ||
"generative AI" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be imported from core. This will break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace it with
import {Pipe} from '@baseai/core';