From c0e894820e95fc773669c0ebc705f562a89d828e Mon Sep 17 00:00:00 2001 From: cocoslabs Date: Mon, 24 Jun 2024 16:39:49 +0800 Subject: [PATCH] update ci --- .github/workflows/publish-npm.yml | 2 +- README.md | 2 +- webpack.config.js | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 7fa7fef..07906fc 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -46,7 +46,7 @@ jobs: run: npm ci - name: Build - run: npm run build --workspace @ton/${{ steps.get-package.outputs.package }}-sdk + run: npx webpack --mode production && npx tsc --declaration --emitDeclarationOnly - name: Publish run: | diff --git a/README.md b/README.md index e3c213e..d30ba9a 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ const gameFi = await CocosGameFi.create({ connector: uiconnector }); | [merchantJettonAddress](https://cocostechlabs.github.io/game-engines-sdk/classes/CocosGameFi.html#merchantJettonAddress) | in-game shop's jetton used as in-game currency | # Use cases -To learn complex use cases read [TON GameFi article](https://gist.github.com/barinbritva/b3db1605f2667b7562b53a23877c0e73) and check out the source code of demo [Flappy Bird game](https://github.com/ton-community/flappy-bird). +To learn complex use cases read [TON GameFi article](https://gist.github.com/barinbritva/b3db1605f2667b7562b53a23877c0e73) and check out the source code of demo [Flappy Bird game](https://github.com/CocosTechLabs/flappy-bird). # References The full [typedoc references](https://cocostechlabs.github.io/game-engines-sdk/index.html). diff --git a/webpack.config.js b/webpack.config.js index 2c9d35c..8ba92a0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ const TypescriptDeclarationPlugin = require('typescript-declaration-webpack-plug module.exports = { mode: 'production', - entry: './src/index.ts', // 入口文件 + entry: './src/index.ts', module: { rules: [ { @@ -21,21 +21,21 @@ module.exports = { }, }, output: { - filename: 'index.ts', // 输出文件名 - path: path.resolve(__dirname, './lib'), // 输出目录 + filename: 'index.ts', + path: path.resolve(__dirname, './lib'), libraryTarget: 'module', }, experiments: { - outputModule: true, // 启用 outputModule 实验性功能 + outputModule: true, }, - target: ['web', 'browserslist:> 0.5%, not dead'], // 设置 target 以确保输出 ESM 代码 - externals: [], // 配置外部依赖,这里留空,表示所有依赖都打包 + target: ['web', 'browserslist:> 0.5%, not dead'], + externals: [], plugins: [ new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'], }), new TypescriptDeclarationPlugin({ - out: 'index.d.ts', // 输出的声明文件名 + out: 'index.d.ts', exclude: /node_modules/, }), ]