diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4498242..37b799c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,20 +47,36 @@ jobs: - name: bump package version (pre-release) if: ${{ 'refs/heads/master' != github.ref }} + # TODO: use different --preid for every ref run: | git config --local user.email "actions@github.com" git config --local user.name "BDBuilder builder" npm version prerelease --preid preview -m "bump package version to %s" - - name: publish - id: publish + - name: publish to GH + id: publish-gh uses: JS-DevTools/npm-publish@v1 with: token: ${{ github.token }} access: public registry: https://npm.pkg.github.com - tag: latest + tag: latest # TODO: remove this tag for preview releases - name: push version change if: steps.publish.outputs.type != 'none' run: git push + + - name: patch package.json + run: | + node -e " + require('fs').writeFileSync('package.json', JSON.stringify(Object.assign(require('./package.json'), { + name: 'bdbuilder' + }), null, 2));" + + - name: publish to NPM + id: publish + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + access: public + tag: latest # TODO: remove this tag for preview releases diff --git a/common/apis/commands.ts b/common/apis/commands.ts index ba565d5..8fe3b9d 100644 --- a/common/apis/commands.ts +++ b/common/apis/commands.ts @@ -60,13 +60,13 @@ export type Command = { __registerId?: string; }; -if (!DiscordCommands.BUILT_IN_SECTIONS.some(e => e.id === "betterdiscord")) { - DiscordCommands.BUILT_IN_SECTIONS.push({ +if (!DiscordCommands.BUILT_IN_SECTIONS["betterdiscord"]) { + DiscordCommands.BUILT_IN_SECTIONS["betterdiscord"] = { icon: "https://github.com/BetterDiscord.png", id: "betterdiscord", name: "BetterDiscord", type: 0 - }); + }; } export function registerCommand(caller: string, options: Command) { @@ -96,4 +96,4 @@ export function unregisterAllCommands(caller: string) { const Commands = { registerCommand, unregisterAllCommands }; -export default Commands; \ No newline at end of file +export default Commands; diff --git a/common/apis/strings.ts b/common/apis/strings.ts index 04a9e1a..ece07f0 100644 --- a/common/apis/strings.ts +++ b/common/apis/strings.ts @@ -7,8 +7,8 @@ const loadedStrings = {}; SettingsStore.addChangeListener(injectStrings); function injectStrings() { - Object.assign(Strings._proxyContext.messages, loadedStrings[Strings.getLocale()] ?? {}); - if (loadedStrings["en-US"]) Object.assign(Strings._proxyContext.defaultMessages, loadedStrings["en-US"]); + Object.assign(Strings._provider._context.messages, loadedStrings[Strings.getLocale()] ?? {}); + if (loadedStrings["en-US"]) Object.assign(Strings._provider._context.defaultMessages, loadedStrings["en-US"]); }; export function addStrings(locale: string, strings: any) { diff --git a/package.json b/package.json index 9f2cede..8315f4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@betterdiscordbuilder/bdbuilder", - "version": "1.2.8", + "version": "1.2.9-preview.4", "description": "Enhanced plugins transpiler for BetterDiscord. Allows you to build plugin with multiple files at once.", "main": "./dist/bdbuilder.min.js", "dependencies": {