chore: Update yarn, refactor packages setup (#4085)

* Update yarn, refactor packages setup

* Rename some jobs in lib-check.yml

* Update website/yarn.lock

* Revert build-type-and-test job name change
This commit is contained in:
Fleny
2025-01-17 05:27:10 +01:00
committed by GitHub
parent d8cfccb914
commit b177eb40f8
49 changed files with 5734 additions and 6098 deletions

View File

@@ -19,15 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache

View File

@@ -16,15 +16,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache

View File

@@ -29,7 +29,6 @@ jobs:
bot-e2e-test:
name: Bot
needs: rest-e2e-test
if: ${{ always() }}
uses: ./.github/workflows/e2e-test.yml
secrets: inherit
with:

View File

@@ -18,15 +18,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
@@ -34,7 +26,7 @@ jobs:
with:
path: .turbo
key: ${{ runner.os }}-turbo-build:type-${{ github.sha }}
- name: Build Type and Test
- name: Build Types
run: yarn build:type --cache-dir=".turbo"
build-dist:
@@ -45,15 +37,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
@@ -64,8 +48,8 @@ jobs:
- name: Type Test
run: yarn build --cache-dir=".turbo"
format-unit-and-integration-test:
name: Format Test
format:
name: Format
runs-on: ubuntu-latest
needs: build-type-and-test
steps:
@@ -73,15 +57,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
@@ -99,7 +75,7 @@ jobs:
run: yarn lint --cache-dir=".turbo"
test-type-unit-and-integration-test:
name: Test Type Test
name: Typecheck Tests
runs-on: ubuntu-latest
needs: build-type-and-test
steps:
@@ -107,15 +83,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache

View File

@@ -16,18 +16,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- uses: denoland/setup-deno@v2
with:
deno-version: 'v2.1.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
@@ -51,18 +43,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.1.42'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache

View File

@@ -27,17 +27,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
registry-url: 'https://registry.npmjs.org'
scope: '@discordeno'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: build Package
run: yarn release-build --filter=./packages/${{ matrix.package }}
@@ -45,8 +37,11 @@ jobs:
if: ${{ github.event_name != 'release' && github.event.action != 'published' }}
run: node ./scripts/bumpVersionByCommit.js ${{ matrix.package }}
- run: yarn pack
working-directory: packages/${{ matrix.package }}
# If the action is running from a release use the latest tag, otherwise use the next tag
- run: npm publish --tag ${{ github.event_name == 'release' && github.event.action == 'published' && 'latest' || 'next' }} --access public --provenance
- run: npm publish package.tgz --tag ${{ github.event_name == 'release' && github.event.action == 'published' && 'latest' || 'next' }} --access public --provenance
working-directory: packages/${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -1,11 +0,0 @@
name: Rest Pkg Test Status
on:
workflow_call:
jobs:
rest-pkg-test-status:
name: Rest Pkg Test Status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@@ -1,10 +1,6 @@
# This is a basic workflow to help you get started with Actions
name: Deploy Docs Site
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ['main']
paths:
@@ -14,54 +10,32 @@ on:
- 'package.json'
- 'packages/**'
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
merge_group:
permissions:
contents: read
pages: write
id-token: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
name: Build Docusaurus
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path (root)
id: yarn-cache-dir-path-root
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path-root.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
cache-dependency-path: |
yarn.lock
website/yarn.lock
- name: yarn install (root)
run: yarn install --immutable
- name: Build all pkg
run: yarn release-build
- name: Build docs
run: yarn build:doc
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
working-directory: ./website
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-site-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-site-
- run: yarn install --immutable
working-directory: ./website
- name: Build website
@@ -78,31 +52,16 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path (root)
id: yarn-cache-dir-path-root
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path-root.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
cache-dependency-path: |
yarn.lock
website/yarn.lock
- name: yarn install (root)
run: yarn install --immutable
- name: Build all pkg
run: yarn release-build
- name: Build docs
run: yarn build:doc
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
working-directory: ./website
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-site-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-site-
- run: yarn install --immutable
working-directory: ./website
- run: yarn typecheck

View File

@@ -16,15 +16,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache

View File

@@ -1,11 +0,0 @@
# ignore everything
*
# except package.json and build
!package.json
!README.md
!dist/**
!bin/**
# ignore the tsbuildinfo file
dist/.tsbuildinfo

View File

@@ -1,9 +0,0 @@
/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-after-install",
factory: function (require) {
"use strict";var plugin=(()=>{var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var n=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var I=(t,o)=>{for(var e in o)s(t,e,{get:o[e],enumerable:!0})},h=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of x(o))!C.call(t,r)&&r!==e&&s(t,r,{get:()=>o[r],enumerable:!(a=g(o,r))||a.enumerable});return t};var k=t=>h(s({},"__esModule",{value:!0}),t);var P={};I(P,{default:()=>y});var d=n("@yarnpkg/core");var f=n("@yarnpkg/core"),c={afterInstall:{description:"Hook that will always run after install",type:f.SettingsType.STRING,default:""}};var u=n("clipanion"),p=n("@yarnpkg/core");var m=n("@yarnpkg/shell"),l=async(t,o)=>{var r;let e=t.get("afterInstall"),a=!!((r=t.projectCwd)!=null&&r.endsWith(`dlx-${process.pid}`));return e&&!a?(o&&console.log("Running `afterInstall` hook..."),(0,m.execute)(e,[],{cwd:t.projectCwd||void 0})):0};var i=class extends u.Command{async execute(){let o=await p.Configuration.find(this.context.cwd,this.context.plugins);return l(o,!1)}};i.paths=[["after-install"]];var w={configuration:c,commands:[i],hooks:{afterAllInstalled:async(t,o)=>{if((o==null?void 0:o.mode)===d.InstallMode.UpdateLockfile)return;if(await l(t.configuration,!0))throw new Error("The `afterInstall` hook failed, see output above.")}}},y=w;return k(P);})();
return plugin;
}
};

File diff suppressed because one or more lines are too long

934
.yarn/releases/yarn-4.6.0.cjs vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,2 @@
afterInstall: yarn run setup-dd
compressionLevel: mixed
enableGlobalCache: false
yarnPath: .yarn/releases/yarn-4.6.0.cjs
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-after-install.cjs
spec: 'https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.5.0/bundles/@yarnpkg/plugin-after-install.js'
yarnPath: .yarn/releases/yarn-4.0.2.cjs

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,2 @@
compressionLevel: mixed
enableGlobalCache: false
yarnPath: .yarn/releases/yarn-4.6.0.cjs
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.0.2.cjs

View File

@@ -3,12 +3,12 @@
"private": true,
"type": "module",
"version": "1.0.0",
"packageManager": "yarn@4.6.0",
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"start:dev": "yarn exec node -r dotenv/config dist/server.js",
"start:prod": "yarn exec node ./dist/server.js",
"release": "cliff-jumper",
"setup-dd": ""
"release": "cliff-jumper"
},
"dependencies": {
"@discordeno/rest": "21.0.0",
@@ -22,6 +22,5 @@
"@swc/cli": "^0.5.2",
"@swc/core": "^1.10.4",
"dotenv": "^16.4.7"
},
"packageManager": "yarn@4.0.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,2 @@
# This file is needed or else when yarn runs it will attempt to use PnP
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules

View File

@@ -6,11 +6,10 @@
"type": "module",
"license": "ISC",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.6.0",
"scripts": {
"start": "node dist/index.js",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"setup-dd": ""
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist"
},
"dependencies": {
"@discordeno/bot": "20.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,2 @@
# This file is needed or else when yarn runs it will attempt to use PnP
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules

View File

@@ -6,11 +6,10 @@
"type": "module",
"license": "ISC",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.6.0",
"scripts": {
"start": "node dist/index.js",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"setup-dd": ""
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist"
},
"dependencies": {
"@discordeno/bot": "20.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,2 @@
# This file is needed or else when yarn runs in `docker build` will attempt to use PnP
compressionLevel: mixed
enableGlobalCache: false
# This file is needed or else when yarn runs it will attempt to use PnP
nodeLinker: node-modules

View File

@@ -6,7 +6,7 @@
"type": "module",
"license": "ISC",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.6.0",
"scripts": {
"start:bot": "node dist/bot/index.js",
"start:rest": "node dist/rest/index.js",
@@ -15,8 +15,7 @@
"build:watch": "swc src --strip-leading-paths --delete-dir-on-start --watch --out-dir dist",
"dev:bot": "node --watch --watch-preserve-output dist/bot/index.js",
"dev:rest": "node --watch --watch-preserve-output dist/rest/index.js",
"dev:gateway": "node --watch --watch-preserve-output dist/gateway/index.js",
"setup-dd": ""
"dev:gateway": "node --watch --watch-preserve-output dist/gateway/index.js"
},
"dependencies": {
"@discordeno/bot": "21.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,2 @@
# This file is needed or else when yarn runs it will attempt to use PnP
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules

View File

@@ -6,11 +6,10 @@
"type": "module",
"license": "ISC",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.6.0",
"scripts": {
"start": "node dist/index.js",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"setup-dd": ""
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist"
},
"dependencies": {
"@discordeno/bot": "20.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1 @@
# This file is needed or else when yarn runs it will attempt to use PnP
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules

View File

@@ -5,11 +5,10 @@
"type": "module",
"license": "ISC",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.6.0",
"scripts": {
"start": "node dist/index.js",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"setup-dd": ""
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist"
},
"dependencies": {
"@discordeno/bot": "20.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -3,33 +3,31 @@
"version": "21.0.0",
"private": true,
"type": "module",
"packageManager": "yarn@4.6.0",
"workspaces": [
"packages/*"
],
"scripts": {
"build": "turbo run build",
"build:watch": "echo \"Starting build in watch mode...\" && chokidar \"packages/**/*.ts\" --ignore \"packages/**/dist/**/*.d.ts\" -c \"turbo run build build:type\"",
"build": "turbo build",
"build:type": "turbo build:type",
"build:doc": "typedoc --options ./typedoc.json && node scripts/finalizeTypedocs.js",
"build:type": "turbo run build:type",
"release-build": "turbo run build build:type",
"test:bun-unit": "turbo run test:bun-unit",
"test:deno-unit": "turbo run test:deno-unit",
"test:e2e": "turbo run test:e2e",
"test:integration": "turbo run test:integration",
"test:test-type": "turbo run test:test-type",
"test:type": "turbo run build:type",
"test:unit": "turbo run test:unit",
"test:unit-coverage": "turbo run test:unit-coverage",
"fmt": "turbo run fmt",
"build:watch": "turbo watch build build:type",
"release-build": "turbo build build:type",
"test:unit": "turbo test:unit",
"test:unit-coverage": "turbo test:unit-coverage",
"test:bun-unit": "turbo test:bun-unit",
"test:deno-unit": "turbo test:deno-unit",
"test:integration": "turbo test:integration",
"test:e2e": "turbo test:e2e",
"test:type": "turbo build:type",
"test:test-type": "turbo test:test-type",
"fmt": "turbo fmt",
"lint": "turbo lint",
"format": "biome format --write",
"lint": "turbo run lint",
"prepare": "husky",
"setup-dd": "husky"
"postinstall": "husky"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"chokidar-cli": "^3.0.0",
"discordeno": "21.0.0",
"husky": "^9.1.7",
"lint-staged": "^15.3.0",
"turbo": "^2.3.3",
@@ -41,7 +39,6 @@
"node": ">=18.0.0"
},
"lint-staged": {
"*": "yarn biome check --no-errors-on-unmatched --write"
},
"packageManager": "yarn@4.0.2"
"*": "biome check --no-errors-on-unmatched --write"
}
}

View File

@@ -1,33 +1,34 @@
{
"name": "benchmarks",
"version": "0.0.0",
"private": true,
"main": "./dist/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
"import": "./dist/index.js",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"scripts": {
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
"release-build": "yarn build && yarn build:type",
"fmt": "biome format --write",
"lint": "biome lint --write",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist && node ../../scripts/fixBenchExtension.js",
"build-message": "swc src/generateMessage.ts --strip-leading-paths -C sourceMaps=false --out-dir ../../scripts && node ../../scripts/fixBenchExtension.js",
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"build-message": "swc src/generateMessage.ts --strip-leading-paths -C sourceMaps=false --out-dir ../../scripts",
"bench": "node dist/index.js"
},
"dependencies": {
"@discordeno/bot": "21.0.0",
"@discordeno/gateway": "21.0.0",
"@discordeno/rest": "21.0.0",
"@discordeno/types": "21.0.0",
"@discordeno/utils": "21.0.0",
"@discordeno/bot": "workspace:^",
"@discordeno/gateway": "workspace:^",
"@discordeno/rest": "workspace:^",
"@discordeno/types": "workspace:^",
"@discordeno/utils": "workspace:^",
"benchmark": "^2.1.4"
},
"devDependencies": {

View File

@@ -2,18 +2,6 @@ import { createBot, snakeToCamelCase } from '@discordeno/bot'
import { events as dbEvents } from '../utils/db.js'
import { memoryBenchmark } from '../utils/memoryBenchmark.js'
/* Example Usage
deno run --v8-flags="--expose-gc" -A .\index.ts
*/
/*
import { createBot } from "https://deno.land/x/discordeno@17.1.0/mod.ts";
import { enableCachePlugin } from "https://deno.land/x/discordeno@17.1.0/plugins/mod.ts";
memoryBenchmark(() => enableCachePlugin(createBot({
token: " ",
botId: 0n,
})))
*/
await memoryBenchmark(
'[Cache Plugin]',
() =>

View File

@@ -2,18 +2,22 @@
"name": "@discordeno/bot",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
@@ -30,10 +34,10 @@
"test:test-type": "tsc --project tests/tsconfig.json"
},
"dependencies": {
"@discordeno/gateway": "21.0.0",
"@discordeno/rest": "21.0.0",
"@discordeno/types": "21.0.0",
"@discordeno/utils": "21.0.0"
"@discordeno/gateway": "workspace:^",
"@discordeno/rest": "workspace:^",
"@discordeno/types": "workspace:^",
"@discordeno/utils": "workspace:^"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",

View File

@@ -2,18 +2,22 @@
"name": "discordeno",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
@@ -29,11 +33,11 @@
"test:test-type": "tsc --project tests/tsconfig.json"
},
"dependencies": {
"@discordeno/bot": "21.0.0",
"@discordeno/gateway": "21.0.0",
"@discordeno/rest": "21.0.0",
"@discordeno/types": "21.0.0",
"@discordeno/utils": "21.0.0"
"@discordeno/bot": "workspace:^",
"@discordeno/gateway": "workspace:^",
"@discordeno/rest": "workspace:^",
"@discordeno/types": "workspace:^",
"@discordeno/utils": "workspace:^"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",

View File

@@ -2,18 +2,22 @@
"name": "@discordeno/gateway",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
@@ -30,8 +34,8 @@
"test:test-type": "tsc --project tests/tsconfig.json"
},
"dependencies": {
"@discordeno/types": "21.0.0",
"@discordeno/utils": "21.0.0",
"@discordeno/types": "workspace:^",
"@discordeno/utils": "workspace:^",
"ws": "^8.18.0"
},
"optionalDependencies": {

View File

@@ -2,18 +2,22 @@
"name": "@discordeno/rest",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
@@ -30,8 +34,8 @@
"test:test-type": "tsc --project tests/tsconfig.json"
},
"dependencies": {
"@discordeno/types": "21.0.0",
"@discordeno/utils": "21.0.0"
"@discordeno/types": "workspace:^",
"@discordeno/utils": "workspace:^"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",

View File

@@ -2,18 +2,22 @@
"name": "@discordeno/types",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",

View File

@@ -2,18 +2,22 @@
"name": "@discordeno/utils",
"version": "21.0.0",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/discordeno/discordeno.git"
"url": "git+https://github.com/discordeno/discordeno.git"
},
"files": [
"dist/**",
"!dist/.tsbuildinfo"
],
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist/esm && swc --strip-leading-paths --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --skipDefaultLibCheck --declaration --emitDeclarationOnly --declarationDir dist/types",
@@ -29,7 +33,7 @@
"test:test-type": "tsc --project tests/tsconfig.json"
},
"dependencies": {
"@discordeno/types": "21.0.0"
"@discordeno/types": "workspace:^"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",

View File

@@ -1,19 +1,17 @@
import childProcess from 'node:child_process'
import fs from 'node:fs/promises'
import { argv } from 'node:process'
import { execSync } from 'node:child_process'
import { readFile, writeFile } from 'node:fs/promises'
const packageName = argv[2]
const packageName = process.argv[2]
if (!packageName) {
throw new Error('No package name specified')
}
const commitHash = childProcess.execSync('git rev-parse HEAD').toString().trim().slice(0, 7)
const commitHash = execSync('git rev-parse HEAD').toString().slice(0, 7)
const file = JSON.parse(await fs.readFile(`packages/${packageName}/package.json`, 'utf-8'))
const file = JSON.parse(await readFile(`packages/${packageName}/package.json`, 'utf-8'))
const oldVersion = file.version
file.version = `${oldVersion.split('-')[0]}-next.${commitHash}`
file.version = `${file.version.split('-')[0]}-next.${commitHash}`
if (file.dependencies) {
Object.keys(file.dependencies).forEach((dependency) => {
@@ -21,6 +19,6 @@ if (file.dependencies) {
})
}
await fs.writeFile(`packages/${packageName}/package.json`, JSON.stringify(file, null, 2))
await writeFile(`packages/${packageName}/package.json`, JSON.stringify(file, null, 2))
console.log(`Bumped ${packageName} to ${file.version.split('-')[0]}-next.${commitHash}`)

View File

@@ -1,4 +1,3 @@
import fs from 'node:fs'
import { argv } from 'node:process'
import { readFileSync, writeFileSync } from 'node:fs'
fs.writeFileSync('./coverage/lcov.info', fs.readFileSync('./coverage/lcov.info', 'utf-8').replace(/SF:src/g, `SF:packages/${argv[2]}/src`))
writeFileSync('./coverage/lcov.info', readFileSync('./coverage/lcov.info', 'utf-8').replace(/SF:src/g, `SF:packages/${process.argv[2]}/src`))

View File

@@ -1,15 +0,0 @@
import fs from 'node:fs'
const dirs = ['']
for await (const dir of dirs) {
await Promise.all(
fs.readdirSync(`dist${dir}`).map(async (file) => {
if (!file.endsWith('.js') && !file.endsWith('.map') && !file.endsWith('.ts')) {
dirs.push(`${dir}/${file}`)
return
}
const content = await fs.promises.readFile(`dist${dir}/${file}`, 'utf-8')
fs.promises.writeFile(`dist${dir}/${file}`, content.replace(/src\//g, 'dist/').replace(/\.ts/g, '.js'))
}),
)
}

View File

@@ -1,16 +1,12 @@
import fs from 'node:fs'
import { readFile, readdir, rm, writeFile } from 'node:fs/promises'
const dirs = ['']
for await (const dir of dirs) {
await Promise.all(
fs.readdirSync(`dist/cjs${dir}`).map(async (file) => {
if (!file.endsWith('.js') && !file.endsWith('.map') && !file.endsWith('.ts') && !file.endsWith('.cjs')) {
dirs.push(`${dir}/${file}`)
return
}
const content = await fs.promises.readFile(`dist/cjs${dir}/${file}`, 'utf-8')
await fs.promises.rm(`dist/cjs${dir}/${file}`)
fs.promises.writeFile(`dist/cjs${dir}/${file.slice(0, -3)}.cjs`, content.replace(/\.js(?!on)/g, '.cjs'))
}),
)
}
const files = await readdir('dist/cjs', { recursive: true })
const promises = files
.filter((f) => f.endsWith('.js'))
.map(async (file) => {
const content = await readFile(`dist/cjs/${file}`, 'utf-8')
await rm(`dist/cjs/${file}`)
await writeFile(`dist/cjs/${file.slice(0, -3)}.cjs`, content.replace(/\.js(?!on)/g, '.cjs'))
})
await Promise.all(promises)

File diff suppressed because it is too large Load Diff

1131
yarn.lock

File diff suppressed because it is too large Load Diff