Dynamically fetching correct version and generating declarations only for npm lib

This commit is contained in:
David Négrier 2021-04-11 11:15:59 +02:00
parent 0f7ac7ba8b
commit 728fd4779c
3 changed files with 15 additions and 6 deletions

View File

@ -1,7 +1,5 @@
name: Push @workadventure/iframe-api-typings to NPM
on:
# TODO remove action on push
push: ~
release:
types: [created]
jobs:
@ -14,8 +12,19 @@ jobs:
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
# TODO: replace version with RELEASE tag
# TODO: enable declaration flag in tsconfig dynamically
- name: Edit tsconfig.json to add declarations
run: "sed -i 's/\"declaration\": false/\"declaration\": true/g' tsconfig.json"
working-directory: "front"
- name: Replace version number
run: 'sed -i "s#VERSION_PLACEHOLDER#${GITHUB_REF/refs\/tags\//}#g" package.json'
working-directory: "front/packages/iframe-api-typings"
- name: Debug package.json
run: cat package.json
working-directory: "front/packages/iframe-api-typings"
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:

View File

@ -1,6 +1,6 @@
{
"name": "@workadventure/iframe-api-typings",
"version": "1.2.0",
"version": "VERSION_PLACEHOLDER",
"description": "Typescript typings for WorkAdventure iFrame API",
"main": "iframe_api.js",
"types": "iframe_api.d.ts",

View File

@ -5,7 +5,7 @@
"moduleResolution": "node",
"module": "CommonJS",
"target": "ES2015",
"declaration": true,
"declaration": false,
"downlevelIteration": true,
"jsx": "react",
"allowJs": true,