diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0628ce8..91c4a2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - deno: ['v0.30.0'] + deno: ["v0.30.0"] os: [ubuntu-latest, macOS-latest, windows-latest] name: test in ${{ matrix.os }} steps: @@ -28,6 +28,13 @@ jobs: run: | yarn + - name: Build typescript-deno-plugin + working-directory: ./typescript-deno-plugin + run: | + yarn + yarn run compile + yarn lint + - name: Check code format run: | yarn run check @@ -48,7 +55,7 @@ jobs: release: runs-on: ubuntu-latest - name: 'Release to vscode market and github' + name: "Release to vscode market and github" if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') needs: build steps: @@ -56,6 +63,14 @@ jobs: with: name: package + - uses: actions/setup-node@v1 + with: + node-version: "12.x" + + - name: publish to vscode market + # require Azure DevOps Personal Access Token + run: npx vsce publish --packagePath ./package/vscode-deno.vsix --pat ${{ secrets.ADO_TOKEN }} + - uses: softprops/action-gh-release@v1 name: publish to Github env: @@ -65,11 +80,3 @@ jobs: files: | ./package/vscode-deno.vsix draft: false - - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: publish to vscode market - # require Azure DevOps Personal Access Token - run: npx vsce publish --packagePath ./package/vscode-deno.vsix --pat ${{ secrets.ADO_TOKEN }} diff --git a/typescript-deno-plugin/package.json b/typescript-deno-plugin/package.json index 35284f5..afd19ef 100644 --- a/typescript-deno-plugin/package.json +++ b/typescript-deno-plugin/package.json @@ -4,17 +4,14 @@ "description": "Deno language service plugin for TypeScript", "main": "out/index.js", "scripts": { - "compile": "tsc && cp ./package.json ../node_modules/typescript-deno-plugin/package.json", - "watch": "cp ./package.json ../node_modules/typescript-deno-plugin/package.json && tsc -w -p ./", - "lint": "tslint -c tslint.json 'src/**/*.ts'", - "postinstall": "npm run compile" + "compile": "tsc", + "watch": "tsc -w -p ./", + "lint": "tslint -c tslint.json 'src/**/*.ts'" }, "dependencies": { - "deepmerge": "^4.2.2", - "mock-require": "^3.0.3" + "deepmerge": "^4.2.2" }, "devDependencies": { - "@types/mock-require": "^2.0.0", "@types/node": "^12.0.4", "tslint": "^5.17.0", "typescript": "^3.5.1" diff --git a/typescript-deno-plugin/src/index.ts b/typescript-deno-plugin/src/index.ts index ed0a9fb..b9c5463 100644 --- a/typescript-deno-plugin/src/index.ts +++ b/typescript-deno-plugin/src/index.ts @@ -3,7 +3,6 @@ import * as fs from "fs"; import * as path from "path"; import merge from "deepmerge"; -import mockRequire from "mock-require"; import ts_module from "typescript/lib/tsserverlibrary"; import { Logger } from "./logger"; @@ -24,9 +23,6 @@ module.exports = function init({ }: { typescript: typeof ts_module; }) { - // Make sure Deno imports the correct version of TS - mockRequire("typescript", typescript); - // see https://github.com/denoland/deno/blob/2debbdacb935cfe1eb7bb8d1f40a5063b339d90b/js/compiler.ts#L159-L170 const OPTIONS: ts_module.CompilerOptions = { allowJs: true, @@ -72,7 +68,8 @@ module.exports = function init({ moduleNames, containingFile, reusedNames, - redirectedReference + redirectedReference, + {} ); }; diff --git a/typescript-deno-plugin/yarn.lock b/typescript-deno-plugin/yarn.lock index 417255b..4bd45a9 100644 --- a/typescript-deno-plugin/yarn.lock +++ b/typescript-deno-plugin/yarn.lock @@ -18,14 +18,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@types/mock-require@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/mock-require/-/mock-require-2.0.0.tgz#57a4f0db0b4b6274f610a2d2c20beb3c842181e1" - integrity sha512-nOgjoE5bBiDeiA+z41i95makyHUSMWQMOPocP+J67Pqx/68HAXaeWN1NFtrAYYV6LrISIZZ8vKHm/a50k0f6Sg== - dependencies: - "@types/node" "*" - -"@types/node@*", "@types/node@^12.0.4": +"@types/node@^12.0.4": version "12.0.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.4.tgz#46832183115c904410c275e34cf9403992999c32" integrity sha512-j8YL2C0fXq7IONwl/Ud5Kt0PeXw22zGERt+HSSnwbKOJVsAGkEz3sFCYwaF9IOuoG1HOtE0vKCj6sXF7Q0+Vaw== @@ -123,11 +116,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -get-caller-file@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - glob@^7.1.1: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -190,21 +178,6 @@ mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mock-require@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-3.0.3.tgz#ccd544d9eae81dd576b3f219f69ec867318a1946" - integrity sha512-lLzfLHcyc10MKQnNUCv7dMcoY/2Qxd6wJfbqCcVk3LDb8An4hF6ohk5AztrvgKhJCqj36uyzi/p5se+tvyD+Wg== - dependencies: - get-caller-file "^1.0.2" - normalize-path "^2.1.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -222,11 +195,6 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - resolve@^1.3.2: version "1.11.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" @@ -283,9 +251,9 @@ tsutils@^2.29.0: tslib "^1.8.1" typescript@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" - integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== wrappy@1: version "1.0.2"