From 2e18858cca9159d35dc8731e6ef62e0efcdfa98c Mon Sep 17 00:00:00 2001 From: Marcos Passos Date: Thu, 5 Dec 2024 19:00:07 -0300 Subject: [PATCH] Update SDK to latest version (#319) --- .github/workflows/publish-pr-preview.yaml | 50 +++++++++++++++++++++++ package-lock.json | 16 ++++---- package.json | 2 +- 3 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/publish-pr-preview.yaml diff --git a/.github/workflows/publish-pr-preview.yaml b/.github/workflows/publish-pr-preview.yaml new file mode 100644 index 00000000..334e94cd --- /dev/null +++ b/.github/workflows/publish-pr-preview.yaml @@ -0,0 +1,50 @@ +name: PR preview + +on: + pull_request: + types: + - synchronize + - opened + +env: + BASE_ENDPOINT: https://api.croct.io + MAX_QUERY_LENGTH: 500 + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Cache dependencies + id: cache-dependencies + uses: actions/cache@v4 + with: + path: node_modules + key: node_modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + if: steps.cache-dependencies.outputs.cache-hit != 'true' + run: npm ci + + - name: Build package + run: npm run build + + - name: Prepare release + run: |- + cp package.json LICENSE README.md build/ + cd build + find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} + + sed -i -e "s~<@version@>~0.0.0-dev~" constants.* + sed -i -e "s~<@baseEndpointUrl@>~${BASE_ENDPOINT}~" constants.* + sed -i -e "s~parseInt('<@maxQueryLength@>', 10)~${MAX_QUERY_LENGTH}~" constants.* + cp -r ../src src + + - name: Publish preview + run: |- + npx pkg-pr-new publish \ + --compact --comment=update \ + ./build diff --git a/package-lock.json b/package-lock.json index ff5f5c80..cb0b6036 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@croct/json": "^2.1.0", - "@croct/sdk": "^0.17.6", + "@croct/sdk": "^0.17.7", "tslib": "^2.7.0" }, "devDependencies": { @@ -928,9 +928,10 @@ "integrity": "sha512-UrWfjNQVlBxN+OVcFwHmkjARMW55MBN04E9KfGac8ac8z1QnFVuiOOFtMWXCk3UwsyRqhsNaFoYLZC+xxqsVjQ==" }, "node_modules/@croct/sdk": { - "version": "0.17.6", - "resolved": "https://registry.npmjs.org/@croct/sdk/-/sdk-0.17.6.tgz", - "integrity": "sha512-x4XAQrEp1vgsevaby/gHTPP5L1X+VpuVW6QoY50of56Hhp7Sr0Z4spZiF5+egITDlrFrACy8q35CNaKCvEDhDg==", + "version": "0.17.7", + "resolved": "https://registry.npmjs.org/@croct/sdk/-/sdk-0.17.7.tgz", + "integrity": "sha512-qV49iWdbsZyRBhCLguKrkYbtSIicVcqfUvMKukqjdKk6JS8MtLZKRMghFoFSnWGb/B6Zz4zv/scKVkAmXCUBIA==", + "license": "MIT", "dependencies": { "@croct/json": "^2.0.1", "tslib": "^2.5.0" @@ -3301,10 +3302,11 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/package.json b/package.json index 0342b84a..5efe4cbc 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "dependencies": { "@croct/json": "^2.1.0", - "@croct/sdk": "^0.17.6", + "@croct/sdk": "^0.17.7", "tslib": "^2.7.0" }, "devDependencies": {