Skip to content
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

feat: migration to SDK #170

Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
330cb89
refactor: update EnvConfig type and use createPlugin function
gentlementlegen Oct 24, 2024
f67e845
chore(context): refactor modules to use context plugin
gentlementlegen Oct 25, 2024
99cf7fb
refactor: update EnvConfig type and use createPlugin function
gentlementlegen Oct 24, 2024
045fbd2
Merge remote-tracking branch 'origin/feat/local-run' into feat/local-run
gentlementlegen Oct 25, 2024
e08a92c
chore: remove unused Github and Octokit module files
gentlementlegen Oct 25, 2024
7700fc0
refactor: remove configuration validation and logging modules
gentlementlegen Oct 25, 2024
4183301
refactor: move BaseModule to module types
gentlementlegen Oct 25, 2024
951ad48
refactor: move BaseModule to module types
gentlementlegen Oct 25, 2024
51b425d
refactor: improve logging and update issue payload
gentlementlegen Oct 25, 2024
3a9b517
chore: update scripts and configuration for improved testing
gentlementlegen Oct 28, 2024
2b1a776
chore: add plugin context to testing modules
gentlementlegen Oct 28, 2024
f158da9
chore: add plugin context to testing modules
gentlementlegen Oct 28, 2024
27cba4a
refactor: use context logger for error messages
gentlementlegen Oct 31, 2024
dac0d14
chore(parser): improve error logging for missing location ID
gentlementlegen Oct 31, 2024
2e63186
chore: bump permit-generation version and update test data
gentlementlegen Oct 31, 2024
171d6fc
chore: add bun lock
gentlementlegen Oct 31, 2024
f66b609
feat: add Bun package manager and refactor createPlugin
gentlementlegen Nov 1, 2024
cfcb174
chore: knip
gentlementlegen Nov 1, 2024
811c1a1
chore: knip
gentlementlegen Nov 1, 2024
b2f878c
chore: knip
gentlementlegen Nov 1, 2024
8c1b9f7
chore: knip
gentlementlegen Nov 1, 2024
dffe737
chore: remove unused validation code and dependencies
gentlementlegen Nov 1, 2024
b2082b1
chore: remove dist
gentlementlegen Nov 1, 2024
fd31315
chore: format CHANGELOG.md
gentlementlegen Nov 1, 2024
2189fa0
test(configuration): improve configuration testing
gentlementlegen Nov 1, 2024
19d8426
test(WIP): migrating to ESM
gentlementlegen Nov 1, 2024
b63d6cd
test: update octokit import and refine jest mocks
gentlementlegen Nov 4, 2024
0f55ddc
refactor(tests): update tests to use jest unstable mocks
gentlementlegen Nov 4, 2024
4be9794
refactor(tests): streamline context initialization
gentlementlegen Nov 4, 2024
e2073ae
test: add necessary imports and setup for jest
gentlementlegen Nov 4, 2024
e678aa1
chore: update test mocks and configurations
gentlementlegen Nov 4, 2024
0c95c4b
refactor: migrate to unstable_mockModule for jest
gentlementlegen Nov 4, 2024
9933425
Merge branch 'development' into feat/local-run
gentlementlegen Nov 4, 2024
f5a6283
chore: update kernel dependency and refactor plugin import
gentlementlegen Nov 4, 2024
50c8f63
refactor: restructure dependencies and add dotenv
gentlementlegen Nov 4, 2024
4a481fb
chore: update knip version and add ignored dependency
gentlementlegen Nov 4, 2024
8d6d990
chore: downgrade typescript version
gentlementlegen Nov 4, 2024
d20895c
chore(tests): remove unnecessary mock setup in configuration.test
gentlementlegen Nov 4, 2024
9d457f0
chore(tests): refactor action tests mock modules
gentlementlegen Nov 4, 2024
dca99c2
chore(tests): update action test error handling
gentlementlegen Nov 4, 2024
baf6566
chore(tests): update action test error handling
gentlementlegen Nov 4, 2024
c2db4cf
refactor: replace command-line parser with run module
gentlementlegen Nov 4, 2024
4f88747
refactor(tests): reorder imports in purging.test.ts
gentlementlegen Nov 4, 2024
2e00ad8
refactor(tests): remove redundant mock setup in pre-check
gentlementlegen Nov 4, 2024
acf77e3
refactor(tests): update import order and mock implementation
gentlementlegen Nov 4, 2024
b27529d
refactor(tests): consolidate jest imports and env initialization
gentlementlegen Nov 4, 2024
df03f82
refactor: move Result type to a dedicated file
gentlementlegen Nov 4, 2024
a13e827
chore: add cross-env to test script
gentlementlegen Nov 5, 2024
ab25b30
refactor: relocate SupportedEvents type
gentlementlegen Nov 5, 2024
e3aae32
chore(parser): improve error handling in content evaluator
gentlementlegen Nov 5, 2024
304b9f0
refactor: remove deprecated comments from start.ts
gentlementlegen Nov 5, 2024
75dc66e
chore: update dependencies and package manager
gentlementlegen Nov 6, 2024
c7c39fc
chore: remove deprecated configuration file
gentlementlegen Nov 6, 2024
b18d7c4
chore: update jest workflow to use bun for package installation
gentlementlegen Nov 6, 2024
7a23500
chore: bumped typescript version
gentlementlegen Nov 6, 2024
4247466
chore: bumped typescript version down
gentlementlegen Nov 6, 2024
19c1ebb
chore: bumped octokit version up
gentlementlegen Nov 6, 2024
e2a1977
chore: bumped supabase version down
gentlementlegen Nov 6, 2024
c786854
chore: changed octokit type
gentlementlegen Nov 6, 2024
fa97b28
chore: updated manifest.json and dist build
github-actions[bot] Nov 6, 2024
bc7be84
chore: add PLUGIN_GITHUB_TOKEN to compute workflow
gentlementlegen Nov 6, 2024
2e7afb6
chore: test build
gentlementlegen Nov 7, 2024
e23c4b0
chore: dirname replacement
gentlementlegen Nov 7, 2024
c5d41cf
chore: public key
gentlementlegen Nov 7, 2024
02464f5
chore: new build OK
gentlementlegen Nov 7, 2024
690807f
chore: updated manifest.json and dist build
github-actions[bot] Nov 7, 2024
b30af4e
chore: esm
gentlementlegen Nov 7, 2024
60f10f4
chore: esm
gentlementlegen Nov 7, 2024
efc2bb5
chore: esm
gentlementlegen Nov 7, 2024
5d27a42
chore: esm
gentlementlegen Nov 7, 2024
4253a45
chore: esm
gentlementlegen Nov 7, 2024
60a2cc7
chore: esm
gentlementlegen Nov 7, 2024
ec51e5e
chore: esm
gentlementlegen Nov 7, 2024
8ae4cb3
chore: esm
gentlementlegen Nov 7, 2024
f40d068
chore: esm
gentlementlegen Nov 7, 2024
49b0037
chore: esm
gentlementlegen Nov 7, 2024
6c5b1f4
chore: updated manifest.json and dist build
github-actions[bot] Nov 7, 2024
ff02ee1
chore: rebuild plugin
gentlementlegen Nov 6, 2024
feb7cc2
chore: [no-ci] rebuild plugin maps
gentlementlegen Nov 6, 2024
e340de6
chore: plugin sdk
gentlementlegen Nov 7, 2024
a94a75c
fix: replace ubiquity-os-kernel with plugin-sdk
gentlementlegen Nov 7, 2024
624c0b2
chore: updated manifest.json and dist build
github-actions[bot] Nov 7, 2024
a735541
chore: removed ignore test folder
gentlementlegen Nov 7, 2024
369058f
chore: removed ignore test folder
gentlementlegen Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# Token used to use when calling GitHub API
GITHUB_TOKEN="<token>"

# Key for OpenAI usage
OPENAI_API_KEY="<api_key>"
# treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1%

# Supabase URL
SUPABASE_URL=""

# Supabase key
SUPABASE_KEY=""

# X25519 private key
X25519_PRIVATE_KEY=""

# NFT minter private key
NFT_MINTER_PRIVATE_KEY=""

# NFT contract address
NFT_CONTRACT_ADDRESS=""

# Treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1%
PERMIT_FEE_RATE=""
# github account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquity-os-treasury"

# GitHub account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquity-os-treasury"
PERMIT_TREASURY_GITHUB_USERNAME=""
# comma separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6"

# Comma-separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6"
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST=""

# Optional kernel public key
KERNEL_PUBLIC_KEY=""

# Logger level, default is INFO
LOG_LEVEL=""
5 changes: 4 additions & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
with:
node-version: 20.10.0

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: yarn install
run: bun install

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ static/dist
junit.xml
coverage
test-dashboard.md
*.private.env.json
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# `@ubiquity-os/text-conversation-rewards`

As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue.

- pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete.
- most importantly: this can inherit bot authentication and link pull requests to issues in private repositories.

Be sure to review all `*.test.*` files for implementation details.

## Data structure

```json
Expand Down Expand Up @@ -354,8 +347,8 @@ Partner private key (`evmPrivateEncrypted` config param in `conversation-rewards

Here `GITHUB_OWNER_ID` can be:

1. Github organization id (if ubiquity-os is used within an organization)
2. Github user id (if ubiquity-os is simply installed in a user's repository)
1. GitHub organization id (if ubiquity-os is used within an organization)
2. GitHub user id (if ubiquity-os is simply installed in a user's repository)

Format `PRIVATE_KEY:GITHUB_OWNER_ID` restricts in which particular organization (or user related repositories)
this private key can be used. It can be set either in the organization wide config either in the repository wide one.
Expand Down
Binary file added bun.lockb
Binary file not shown.
150 changes: 0 additions & 150 deletions dist/33.index.js

This file was deleted.

291 changes: 0 additions & 291 deletions dist/index.js

This file was deleted.

60 changes: 0 additions & 60 deletions dist/xhr-sync-worker.js

This file was deleted.

12 changes: 11 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import type { Config } from "jest";

const cfg: Config = {
transform: {
"^.+\\.tsx?$": "babel-jest",
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
coveragePathIgnorePatterns: ["node_modules", "mocks"],
Expand All @@ -12,6 +17,11 @@ const cfg: Config = {
coverageDirectory: "coverage",
testTimeout: 20000,
roots: ["<rootDir>", "tests"],
extensionsToTreatAsEsm: [".ts"],
gentlementlegen marked this conversation as resolved.
Show resolved Hide resolved
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
setupFilesAfterEnv: ["dotenv/config"],
};

export default cfg;
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config: KnipConfig = {
project: ["src/**/*.ts"],
ignore: ["src/data-collection/examples/*.ts", "src/configuration/common-config-type.ts", "dist/**"],
ignoreExportsUsedInFile: true,
ignoreDependencies: ["ts-node", "msw", "@mswjs/data"],
ignoreDependencies: ["ts-node", "msw", "@mswjs/data", "@octokit/plugin-paginate-graphql"],
jest: {
config: ["jest.config.ts"],
entry: ["src/**/*.test.ts"],
Expand Down
Loading
Loading