diff --git a/.github/workflows/build_pr.yml b/.github/workflows/build_pr.yml index 977c7b47..b04c3a51 100644 --- a/.github/workflows/build_pr.yml +++ b/.github/workflows/build_pr.yml @@ -26,17 +26,17 @@ jobs: uses: actions/setup-node@v3 with: node-version: "16" - + - name: Build TS SDK id: buildTS run: | - wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar -O openapi-generator-cli.jar - rm -rf sdk-output/ - java -jar openapi-generator-cli.jar generate -i api-specs/referenced/plex-api-spec.yaml -g typescript-axios -o sdk-output/ --global-property skipFormModel=false --config config.yaml - + rm -rf plexjs/ + java -jar openapi-generator-cli.jar generate -i api-specs/referenced/plex-api-spec.yaml -g typescript-axios -o plexjs/ --global-property skipFormModel=false --config config.yaml + - name: Run npm install and build Typescript SDK id: buildSDK if: steps.buildTS.outcome == 'success' run: | + cd plexjs npm install - npm run build \ No newline at end of file + npm run build diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 28288e1d..8a0369d4 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -19,14 +19,13 @@ jobs: ref: ${{ github.ref }} fetch-depth: 0 - - name: Checkout API Specs Repo uses: actions/checkout@v3 with: repository: lukehagar/plex-api-spec path: api-specs ref: main - + - name: Set up Node uses: actions/setup-node@v3 with: @@ -67,17 +66,17 @@ jobs: - name: Build TS SDK id: buildTS run: | - wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar -O openapi-generator-cli.jar - rm -rf sdk-output/ - java -jar openapi-generator-cli.jar generate -i api-specs/referenced/plex-api-spec.yaml -g typescript-axios -o sdk-output/ --global-property skipFormModel=false --config config.yaml - + rm -rf plexjss/ + java -jar openapi-generator-cli.jar generate -i api-specs/referenced/plex-api-spec.yaml -g typescript-axios -o plexjs/ --global-property skipFormModel=false --config config.yaml + - name: After SDK Build id: buildSDK if: steps.buildTS.outcome == 'success' run: | + cd plexjs npm install npm run build - + - name: Commit changes and create new version tag if: steps.buildSDK.outcome == 'success' uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml index 69e4339b..ced1f068 100644 --- a/.github/workflows/publish-to-npm.yml +++ b/.github/workflows/publish-to-npm.yml @@ -7,14 +7,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # Setup .npmrc file to publish to npm - uses: actions/setup-node@v3 with: node-version: 12 - run: | + cd plexjs npm ci + - id: publish uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} - package: ./package.json \ No newline at end of file + package: ./plexjs/package.json diff --git a/sdk-resources/package.mustache b/sdk-resources/package.mustache index 370af384..559275d9 100644 --- a/sdk-resources/package.mustache +++ b/sdk-resources/package.mustache @@ -1,24 +1,31 @@ { "name": "{{npmName}}", "version": "{{npmVersion}}", - "description": "OpenAPI client for {{npmName}}", - "author": "OpenAPI-Generator Contributors", + "description": "Community Made Plex JS/TS Module", + "author": "Luke Hagar", + "type": "module", "repository": { "type": "git", - "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" + "url": "https://github.com/LukeHagar/plexjs.git" }, "keywords": [ "axios", "typescript", - "openapi-client", - "openapi-generator", + "openapi", + "api", + "plex", + "plex media server", + "pms" "{{npmName}}" ], - "license": "Unlicense", - "main": "../dist/index.js", - "typings": "../dist/index.d.ts", + "license": "MIT", + "bugs": { + "url": "https://github.com/LukeHagar/plexjs/issues" + }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", "scripts": { - "build": "tsc --outDir dist/", + "build": "tsc --outDir ./dist/", "prepare": "npm run build" }, "dependencies": { diff --git a/sdk-resources/tsconfig.mustache b/sdk-resources/tsconfig.mustache index bf5018db..474ea8c2 100644 --- a/sdk-resources/tsconfig.mustache +++ b/sdk-resources/tsconfig.mustache @@ -4,7 +4,7 @@ "target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}", "module": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}CommonJS{{/supportsES6}}", "noImplicitAny": true, - "outDir": "dist", + "outDir": "./dist", "rootDir": ".", {{^supportsES6}} "lib": [