Skip to content

Commit

Permalink
Merge pull request #14 from pigeonposse/0.2.0
Browse files Browse the repository at this point in the history
💚 ci(env): add ci
  • Loading branch information
angelespejo authored Sep 12, 2024
2 parents 064867e + ef4a763 commit edb2831
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 81 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
- name: 🏗 Build
run: |
pnpm build
# pnpm build:bins
#########################################################################
# PUBLISH
Expand Down Expand Up @@ -106,16 +105,16 @@ jobs:
# - name: Release binary
# if: ${{ steps.updated.outputs.core_version != '' }}
# uses: ncipollo/release-action@v1
# with:
# tag: "v${{ steps.updated.outputs.core_version }}"
# draft: false
# prerelease: false
# allowUpdates: true
# artifacts: "build/zip/*"
# omitBodyDuringUpdate: true
- name: Release binary
if: ${{ steps.updated.outputs.core_version != '' }}
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.updated.outputs.core_version }}"
draft: false
prerelease: false
allowUpdates: true
artifacts: "build/zip/*"
omitBodyDuringUpdate: true


###############################################################################
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-personality

## 0.2.2

### Patch Changes

- up ver

## 0.2.1

### Patch Changes
Expand Down
23 changes: 13 additions & 10 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { build } from '@backan/builder'
import { createRequire } from 'module'
import { resolve as resolvePath } from 'node:path'
import { build } from '@backan/builder'
import { createRequire } from 'module'
import {
resolve as resolvePath,
join,
} from 'node:path'


const require = createRequire( import.meta.url )
const pkg = require( './package.json' )
import { distPath } from './rsbuild.config.js'

const run = async () => {

const require = createRequire( import.meta.url )
const pkg = require( './package.json' )

// await build( {
// input : resolvePath( './build/cli.cjs' ),
// name : pkg.extra.id,
// } )
await build( {
input : resolvePath( join( distPath, 'cli' ) ),
name : pkg.extra.id,
} )

}
run()
9 changes: 7 additions & 2 deletions docs/todo/v1.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# TO DO Personality v1.0
# TO DO `Personality` v1

## 🌈 General

- [ ] Add tests.

## ☀️ Core

- [ ] Save user configuration in a local folder.
- [ ] List saved configurations in the prompt line if they exist.
- [ ] Provide default configurations that the user can choose from.
- [ ] Add an option/flag "config" to set the configurations.
- [ ] Add jsdoc in build

## 💡 Ideas

- [ ] Section to name the custom AI.
- [ ] Improve the aesthetics of the conversation (emojis for each section)
- [ ] Improve the aesthetics of the conversation (emojis for each section)
3 changes: 3 additions & 0 deletions examples/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { personality } from '../dist/main.js'

personality( { modeAuto: true } )
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-personality",
"version": "0.2.1",
"version": "0.2.2",
"description": "Library for crafting and sustaining AI personalities",
"keywords": [
"ia",
Expand Down Expand Up @@ -43,10 +43,9 @@
"packageManager": "[email protected]",
"scripts": {
"dev": "vite build && node dist/cli.js",
"test-build": "rsbuild build",
"build": "pnpm run --sequential \"/^build:.*/\"",
"build:lib": "vite build",
"build:bins": "node ./build.js",
"build:bins": "rsbuild build && node ./build.js",
"update-version": "changeset && changeset version",
"push": "git add . && cz && git push -f origin $@",
"push:main": "pnpm push main"
Expand All @@ -61,8 +60,7 @@
],
"license": "GPL-3.0",
"devDependencies": {
"@babel/preset-env": "^7.25.4",
"@backan/builder": "0.0.15",
"@backan/builder": "0.0.16",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.8",
"@chialab/esbuild-plugin-babel": "^0.18.0",
Expand All @@ -72,13 +70,10 @@
"@rsbuild/core": "^1.0.2",
"@typescript-eslint/eslint-plugin": "8.2.0",
"@typescript-eslint/parser": "8.2.0",
"@vercel/ncc": "^0.38.1",
"commitizen": "4.3.0",
"commitlint-config-gitmoji": "2.3.1",
"cz-customizable": "7.2.1",
"cz-emoji": "1.3.2-canary.2",
"esbuild": "^0.23.1",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "8.57.0",
"eslint-plugin-align-assignments": "1.1.2",
"eslint-plugin-align-import": "1.0.0",
Expand All @@ -97,8 +92,8 @@
},
"dependencies": {
"@clack/prompts": "0.7.0",
"kleur": "4.1.5",
"conf": "13.0.1",
"kleur": "4.1.5",
"update-notifier": "7.3.1"
},
"commitlint": {
Expand Down
41 changes: 10 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 10 additions & 17 deletions rsbuild.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { defineConfig } from "@rsbuild/core";
import { defineConfig } from '@rsbuild/core'

export const distPath = 'build/in'

export default defineConfig({
source: {
entry: {
cli: './src/cli.js',
},
},
output: {
distPath: {
root: 'build',
},
target: 'node',
filename: {
js: '[name].cjs',
}
},
})
export default defineConfig( {
source : { entry: { cli: './src/cli.js' } },
output : {
distPath : { root: distPath },
target : 'node',
filename : { js: '[name].cjs' },
},
} )
23 changes: 22 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
import { Personality } from './personality.js'

/**
* Initializes and runs the Personality configuration process.
*
* @param {object} [answers] - Optional object containing the initial answers for personality configuration.
* @param {string} [answers.selectedModel] - The selected AI model to configure.
* @param {string} [answers.tone] - The overall tone for the AI (e.g., Friendly, Formal, Humorous).
* @param {string} [answers.formality] - The formality level (e.g., Informal, Semi-formal, Formal).
* @param {string[]} [answers.topics] - Array of main topics for the AI to focus on (e.g., Technology, Sports).
* @param {string} [answers.creativity] - The level of creativity in responses (e.g., Highly creative, Balanced).
* @param {string} [answers.humor] - The type of humor used by the AI (e.g., Sarcastic, Light).
* @param {string} [answers.empathy] - The level of empathy (e.g., Highly empathetic, Objective).
* @param {string} [answers.problemSolving] - The approach to solving problems (e.g., With tact, Direct answers).
* @param {string} [answers.responseLength] - The length of responses (e.g., Short, Medium, Long, Infinite).
* @param {string} [answers.quirks] - Any distinctive behaviors or quirks (e.g., speaking in metaphors).
* @param {string} [answers.generalDescription] - A general description of the AI's personality and focus areas.
* @param {boolean} [answers.modeAuto] - Whether to automatically run the AI after configuration.
* @returns {Promise<void>} - A promise that resolves when the configuration and setup process completes.
* @example import { personality } from '../src/main.js'
* personality( { modeAuto: true } )
*
*/
export const personality = async( answers = undefined ) => {

const p = new Personality( { answers } )
await p.run()

}
}
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineConfig( {
lib : {
entry : [ 'src/main', 'src/cli' ],
formats : [ 'es' ],

},
},
} )

0 comments on commit edb2831

Please sign in to comment.