diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..575fdde6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..387fece7 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..161ef34a --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,59 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + VCPKG_DISABLE_METRICS: 1 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..76ab61a0 --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,75 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + VCPKG_DISABLE_METRICS: 1 + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.2.1 + + - uses: actions/setup-node@v4.0.4 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm publish --legacy-peer-deps --provenance --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..b320f077 --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,94 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + VCPKG_DISABLE_METRICS: 1 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.2.1 + + - uses: pnpm/action-setup@v4.0.0 + with: + version: 9.3.0 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.4.2 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/gulpfile.js b/gulpfile.js index f8aad537..89092fae 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,145 +3,184 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var gulp = require('gulp'); -var path = require('path'); -var ts = require('gulp-typescript'); -var sourcemaps = require('gulp-sourcemaps'); +var gulp = require("gulp"); +var path = require("path"); +var ts = require("gulp-typescript"); +var sourcemaps = require("gulp-sourcemaps"); var tslint = require("gulp-tslint"); -var filter = require('gulp-filter'); -var uglify = require('gulp-uglify'); -var del = require('del'); -var typescript = require('typescript'); +var filter = require("gulp-filter"); +var uglify = require("gulp-uglify"); +var del = require("del"); +var typescript = require("typescript"); -var tsProject = ts.createProject('./src/tsconfig.json', { typescript }); -var nls = require('vscode-nls-dev'); +var tsProject = ts.createProject("./src/tsconfig.json", { typescript }); +var nls = require("vscode-nls-dev"); var inlineMap = true; var inlineSource = false; -var watchedSources = [ - 'src/**/*', - '!src/tests/data/**' -]; +var watchedSources = ["src/**/*", "!src/tests/data/**"]; -var scripts = [ - 'src/node/terminateProcess.sh' -]; +var scripts = ["src/node/terminateProcess.sh"]; -var scripts2 = [ - 'src/node/debugInjection.js' -]; +var scripts2 = ["src/node/debugInjection.js"]; -var outDest = 'out'; -var webPackedDest = 'dist'; +var outDest = "out"; +var webPackedDest = "dist"; -const transifexProjectName = 'vscode-extensions'; -const transifexExtensionName = 'vscode-node-debug'; +const transifexProjectName = "vscode-extensions"; +const transifexExtensionName = "vscode-node-debug"; -gulp.task('clean', () => { - return del(['out/**', 'dist/**', 'package.nls.*.json', 'node-debug-*.vsix', 'package-lock.json']); +gulp.task("clean", () => { + return del([ + "out/**", + "dist/**", + "package.nls.*.json", + "node-debug-*.vsix", + "package-lock.json", + ]); }); -gulp.task('internal-compile', () => { +gulp.task("internal-compile", () => { return compile(); }); -gulp.task('internal-copy-scripts', () => { - return gulp.src(scripts) - .pipe(gulp.dest(outDest + '/node')); +gulp.task("internal-copy-scripts", () => { + return gulp.src(scripts).pipe(gulp.dest(outDest + "/node")); }); -gulp.task('internal-minify-scripts', () => { - return gulp.src(scripts2) +gulp.task("internal-minify-scripts", () => { + return gulp + .src(scripts2) .pipe(uglify()) - .pipe(gulp.dest(outDest + '/node')); + .pipe(gulp.dest(outDest + "/node")); }); // compile and copy everything to outDest -gulp.task('internal-build', gulp.series('internal-compile', 'internal-copy-scripts', 'internal-minify-scripts', done => { - done(); -})); - -gulp.task('build', gulp.series('clean', 'internal-build', done => { - done(); -})); - -gulp.task('default', gulp.series('build', done => { - done(); -})); - -gulp.task('compile', gulp.series('clean', 'internal-build', done => { - done(); -})); - -gulp.task('nls-bundle-create', () => { - var r = tsProject.src() +gulp.task( + "internal-build", + gulp.series( + "internal-compile", + "internal-copy-scripts", + "internal-minify-scripts", + (done) => { + done(); + }, + ), +); + +gulp.task( + "build", + gulp.series("clean", "internal-build", (done) => { + done(); + }), +); + +gulp.task( + "default", + gulp.series("build", (done) => { + done(); + }), +); + +gulp.task( + "compile", + gulp.series("clean", "internal-build", (done) => { + done(); + }), +); + +gulp.task("nls-bundle-create", () => { + var r = tsProject + .src() .pipe(sourcemaps.init()) - .pipe(tsProject()).js - .pipe(nls.createMetaDataFiles()) - .pipe(nls.bundleMetaDataFiles('ms-vscode.node-debug', webPackedDest)) + .pipe(tsProject()) + .js.pipe(nls.createMetaDataFiles()) + .pipe(nls.bundleMetaDataFiles("ms-vscode.node-debug", webPackedDest)) .pipe(nls.bundleLanguageFiles()) - .pipe(filter('**/nls.*.json')); + .pipe(filter("**/nls.*.json")); return r.pipe(gulp.dest(webPackedDest)); }); -gulp.task('prepare-for-webpack', gulp.series('clean', 'internal-minify-scripts', 'nls-bundle-create', done => { - done(); -})); - - -gulp.task('watch', gulp.series('internal-build', done => { - //log('Watching build sources...'); - gulp.watch(watchedSources, gulp.series('internal-build')); - done(); -})); - -gulp.task('translations-export', gulp.series('build', 'prepare-for-webpack', () => { - return gulp.src(['package.nls.json', path.join(webPackedDest, 'nls.metadata.header.json'), path.join(webPackedDest, 'nls.metadata.json')]) - .pipe(nls.createXlfFiles(transifexProjectName, transifexExtensionName)) - .pipe(gulp.dest(path.join('..', 'vscode-translations-export'))); -})); +gulp.task( + "prepare-for-webpack", + gulp.series( + "clean", + "internal-minify-scripts", + "nls-bundle-create", + (done) => { + done(); + }, + ), +); + +gulp.task( + "watch", + gulp.series("internal-build", (done) => { + //log('Watching build sources...'); + gulp.watch(watchedSources, gulp.series("internal-build")); + done(); + }), +); + +gulp.task( + "translations-export", + gulp.series("build", "prepare-for-webpack", () => { + return gulp + .src([ + "package.nls.json", + path.join(webPackedDest, "nls.metadata.header.json"), + path.join(webPackedDest, "nls.metadata.json"), + ]) + .pipe( + nls.createXlfFiles( + transifexProjectName, + transifexExtensionName, + ), + ) + .pipe(gulp.dest(path.join("..", "vscode-translations-export"))); + }), +); //---- internal function compile() { - var r = tsProject.src() - .pipe(sourcemaps.init()) - .pipe(tsProject()).js; + var r = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js; if (inlineMap && inlineSource) { r = r.pipe(sourcemaps.write()); } else { - r = r.pipe(sourcemaps.write("../out", { - // no inlined source - includeContent: inlineSource, - // Return relative source map root directories per file. - sourceRoot: "../src" - })); + r = r.pipe( + sourcemaps.write("../out", { + // no inlined source + includeContent: inlineSource, + // Return relative source map root directories per file. + sourceRoot: "../src", + }), + ); } return r.pipe(gulp.dest(outDest)); } -var allTypeScript = [ - 'src/**/*.ts' -]; +var allTypeScript = ["src/**/*.ts"]; -var tslintFilter = [ - '**', - '!**/*.d.ts' -]; +var tslintFilter = ["**", "!**/*.d.ts"]; -gulp.task('tslint', done => { +gulp.task("tslint", (done) => { gulp.src(allTypeScript) - .pipe(filter(tslintFilter)) - .pipe(tslint({ - formatter: "prose", - rulesDirectory: "node_modules/tslint-microsoft-contrib" - })) - .pipe(tslint.report( { - emitError: false - })); + .pipe(filter(tslintFilter)) + .pipe( + tslint({ + formatter: "prose", + rulesDirectory: "node_modules/tslint-microsoft-contrib", + }), + ) + .pipe( + tslint.report({ + emitError: false, + }), + ); done(); }); diff --git a/testdata/program.js b/testdata/program.js index 7360aa82..e2525b80 100644 --- a/testdata/program.js +++ b/testdata/program.js @@ -9,8 +9,8 @@ a.push("line 6"); var x = 0; for (var i = 0; i < a.length; i++) { - x = i*i; + x = i * i; console.log(x); } -process.exit(); // ensure that program terminates \ No newline at end of file +process.exit(); // ensure that program terminates diff --git a/testdata/programSingleLine.js b/testdata/programSingleLine.js index 8269519d..ad3f3fb9 100644 --- a/testdata/programSingleLine.js +++ b/testdata/programSingleLine.js @@ -1 +1,7 @@ -console.log("1"); console.log("2"); console.log("3"); console.log("4"); console.log("5"); console.log("6"); console.log("7"); \ No newline at end of file +console.log("1"); +console.log("2"); +console.log("3"); +console.log("4"); +console.log("5"); +console.log("6"); +console.log("7"); diff --git a/testdata/programWithDebuggerEval.js b/testdata/programWithDebuggerEval.js index 9a384771..9de860bd 100644 --- a/testdata/programWithDebuggerEval.js +++ b/testdata/programWithDebuggerEval.js @@ -1,2 +1 @@ - eval('console.log("line1");\ndebugger;console.log("line3");'); diff --git a/testdata/programWithException.js b/testdata/programWithException.js index 6f1da1f8..f77057e6 100644 --- a/testdata/programWithException.js +++ b/testdata/programWithException.js @@ -4,7 +4,7 @@ console.log("line 3"); try { throw new Error("error"); -} catch(e) { +} catch (e) { console.log("exception: " + e); } diff --git a/testdata/programWithFunction.js b/testdata/programWithFunction.js index 21eba847..24f65c07 100644 --- a/testdata/programWithFunction.js +++ b/testdata/programWithFunction.js @@ -1,19 +1,18 @@ - // global function -foo = function(n) { +foo = function (n) { return n; -} +}; -bar = function(n) { +bar = function (n) { return n; -} +}; -console.log('foo defined'); +console.log("foo defined"); -setInterval(function() { +setInterval(function () { foo(123); }, 300); -setInterval(function() { +setInterval(function () { bar(123); -}, 300); \ No newline at end of file +}, 300); diff --git a/testdata/programWithInternal.js b/testdata/programWithInternal.js index 0a912393..07e5c746 100644 --- a/testdata/programWithInternal.js +++ b/testdata/programWithInternal.js @@ -1,3 +1,3 @@ -var assert = require('assert'); +var assert = require("assert"); -assert.equal(true, true); // bp in 110 \ No newline at end of file +assert.equal(true, true); // bp in 110