diff --git a/.github/dependabot.yml b/.github/dependabot.yml index beda37b7..969b5646 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,26 +1,26 @@ -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - open-pull-requests-limit: 4 - labels: - - "type:maintenance" - - "dependencies" - ignore: - - dependency-name: "@playwright/test" #We have to source the playwright container which is not detected by Dependabot - - dependency-name: "playwright-core" #We have to source the playwright container which is not detected by Dependabot - - dependency-name: "@babel/eslint-parser" #Lots of noise in these type patch releases. - update-types: ["version-update:semver-patch"] - - dependency-name: "eslint-plugin-vue" #Lots of noise in these type patch releases. - update-types: ["version-update:semver-patch"] +# version: 2 +# updates: +# - package-ecosystem: "npm" +# directory: "/" +# schedule: +# interval: "daily" +# open-pull-requests-limit: 4 +# labels: +# - "type:maintenance" +# - "dependencies" +# ignore: +# - dependency-name: "@playwright/test" #We have to source the playwright container which is not detected by Dependabot +# - dependency-name: "playwright-core" #We have to source the playwright container which is not detected by Dependabot +# - dependency-name: "@babel/eslint-parser" #Lots of noise in these type patch releases. +# update-types: ["version-update:semver-patch"] +# - dependency-name: "eslint-plugin-vue" #Lots of noise in these type patch releases. +# update-types: ["version-update:semver-patch"] - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - labels: - - "type:maintenance" - - "dependencies" +# - package-ecosystem: "github-actions" +# directory: "/" +# schedule: +# interval: "daily" +# labels: +# - "type:maintenance" +# - "dependencies" diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cbd27434..9910f468 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,45 +1,45 @@ -name: npm install, build, and lint +# name: npm install, build, and lint -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +# on: +# push: +# branches: [ master ] +# pull_request: +# branches: [ master ] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x, 18.x] - openmct-version: - - latest - - stable - timeout-minutes: 10 - continue-on-error: true - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - name: Run build:example based on openmct-version - run: | - if [ "${{ matrix.openmct-version }}" = "latest" ]; then - npm run build:example:master - elif [ "${{ matrix.openmct-version }}" = "stable" ]; then - npm run build:example - fi +# jobs: +# build: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# node-version: [20.x, 18.x] +# openmct-version: +# - latest +# - stable +# timeout-minutes: 10 +# continue-on-error: true +# steps: +# - uses: actions/checkout@v3 +# - name: Use Node.js ${{ matrix.node-version }} +# uses: actions/setup-node@v4 +# with: +# node-version: ${{ matrix.node-version }} +# - run: npm install +# - name: Run build:example based on openmct-version +# run: | +# if [ "${{ matrix.openmct-version }}" = "latest" ]; then +# npm run build:example:master +# elif [ "${{ matrix.openmct-version }}" = "stable" ]; then +# npm run build:example +# fi - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - run: npm install - - name: Run lint - run: npm run lint +# lint: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - name: Use Node.js 20.x +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# - run: npm install +# - name: Run lint +# run: npm run lint diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..765ba0ec --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,22 @@ +name: Create package on push to release branch + +on: + push: + branches: [ release ] + + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.11.0' + + - name: npm ci + - name: npm prepare diff --git a/.github/workflows/yamcs-quickstart-e2e.yml b/.github/workflows/yamcs-quickstart-e2e.yml index 60b9e4d1..f2e39219 100644 --- a/.github/workflows/yamcs-quickstart-e2e.yml +++ b/.github/workflows/yamcs-quickstart-e2e.yml @@ -1,118 +1,118 @@ -name: "yamcs-quickstart-e2e" -on: - workflow_dispatch: - pull_request: - types: - - labeled - - opened - schedule: - - cron: "0 0 * * 1-5" - push: - branches: - - master +# name: "yamcs-quickstart-e2e" +# on: +# workflow_dispatch: +# pull_request: +# types: +# - labeled +# - opened +# schedule: +# - cron: "0 0 * * 1-5" +# push: +# branches: +# - master -jobs: - yamcs-quickstart-e2e: - if: ${{ github.event.label.name == 'pr:e2e:quickstart' }} || ${{ github.event.action == 'opened' }} - timeout-minutes: 10 - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - yamcs-version: - - default - - 5.8.3 #viper - ## disabling until we get confirmation- 5.3.2 #ab - openmct-version: - - latest - - stable - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v4 - with: - node-version: "18" - - uses: actions/checkout@v3 - with: - repository: yamcs/quickstart - ref: master - path: 'quickstart' - - name: replace yamcsVersion with matrix param - if: matrix.yamcs-version != 'default' - run: | - cd quickstart - mvn -B versions:set-property -Dproperty=yamcsVersion -DnewVersion=${{ matrix.yamcs-version }} - - name: trigger make all from docker dir. Orphan and redirect output to docker/makeout.txt - run: | - cd quickstart/docker - touch makeout.txt - make all &> makeout.txt & - - run: npm install - - name: Run build:example based on openmct-version - run: | - if [ "${{ matrix.openmct-version }}" = "latest" ]; then - npm run build:example:master - elif [ "${{ matrix.openmct-version }}" = "stable" ]; then - npm run build:example - fi - - run: npx playwright@1.39.0 install chromium - - name: Get Open MCT e2e tests - uses: nick-fields/retry@v2 - with: - timeout_minutes: 10 - max_attempts: 3 - command: npm run test:getopensource - - name: Check that yamcs is available - run: | - docker ps -a - npm run wait-for-yamcs - - name: Check Yamcs installed version - run: | - response=$(curl -s -w "%{http_code}" -o yamcs_version.json http://localhost:8090/api/) - if [ "$response" -eq 200 ]; then - cat yamcs_version.json | jq '.yamcsVersion' - else - echo "Error: Unable to fetch Yamcs version. HTTP status code: $response" - exit 1 - fi - - name: Run Quickstart tests - run: npm run test:e2e:quickstart - - name: Capture docker logs to file - if: always() - run: docker logs yamcs > yamcs-docker-log.txt 2>&1 - - name: archive docker logs - if: always() - uses: actions/upload-artifact@v3 - with: - path: yamcs-docker-log.txt - - name: Archive makeout.txt - if: always() - uses: actions/upload-artifact@v3 - with: - path: /quickstart/docker/makeout.txt - - name: Archive test results - if: always() - uses: actions/upload-artifact@v3 - with: - path: test-results - - name: Archive html test results - if: always() - uses: actions/upload-artifact@v3 - with: - path: tests/html-test-results - - name: Remove pr:e2e:quickstart label (if present) - if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:quickstart') }} - uses: actions/github-script@v6 - with: - script: | - const { owner, repo, number } = context.issue; - const labelToRemove = 'pr:e2e:quickstart'; - try { - await github.rest.issues.removeLabel({ - owner, - repo, - issue_number: number, - name: labelToRemove - }); - } catch (error) { - core.warning(`Failed to remove 'pr:e2e:quickstart' label: ${error.message}`); - } +# jobs: +# yamcs-quickstart-e2e: +# if: ${{ github.event.label.name == 'pr:e2e:quickstart' }} || ${{ github.event.action == 'opened' }} +# timeout-minutes: 10 +# runs-on: ubuntu-latest +# continue-on-error: true +# strategy: +# matrix: +# yamcs-version: +# - default +# - 5.8.3 #viper +# ## disabling until we get confirmation- 5.3.2 #ab +# openmct-version: +# - latest +# - stable +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v4 +# with: +# node-version: "18" +# - uses: actions/checkout@v3 +# with: +# repository: yamcs/quickstart +# ref: master +# path: 'quickstart' +# - name: replace yamcsVersion with matrix param +# if: matrix.yamcs-version != 'default' +# run: | +# cd quickstart +# mvn -B versions:set-property -Dproperty=yamcsVersion -DnewVersion=${{ matrix.yamcs-version }} +# - name: trigger make all from docker dir. Orphan and redirect output to docker/makeout.txt +# run: | +# cd quickstart/docker +# touch makeout.txt +# make all &> makeout.txt & +# - run: npm install +# - name: Run build:example based on openmct-version +# run: | +# if [ "${{ matrix.openmct-version }}" = "latest" ]; then +# npm run build:example:master +# elif [ "${{ matrix.openmct-version }}" = "stable" ]; then +# npm run build:example +# fi +# - run: npx playwright@1.39.0 install chromium +# - name: Get Open MCT e2e tests +# uses: nick-fields/retry@v2 +# with: +# timeout_minutes: 10 +# max_attempts: 3 +# command: npm run test:getopensource +# - name: Check that yamcs is available +# run: | +# docker ps -a +# npm run wait-for-yamcs +# - name: Check Yamcs installed version +# run: | +# response=$(curl -s -w "%{http_code}" -o yamcs_version.json http://localhost:8090/api/) +# if [ "$response" -eq 200 ]; then +# cat yamcs_version.json | jq '.yamcsVersion' +# else +# echo "Error: Unable to fetch Yamcs version. HTTP status code: $response" +# exit 1 +# fi +# - name: Run Quickstart tests +# run: npm run test:e2e:quickstart +# - name: Capture docker logs to file +# if: always() +# run: docker logs yamcs > yamcs-docker-log.txt 2>&1 +# - name: archive docker logs +# if: always() +# uses: actions/upload-artifact@v3 +# with: +# path: yamcs-docker-log.txt +# - name: Archive makeout.txt +# if: always() +# uses: actions/upload-artifact@v3 +# with: +# path: /quickstart/docker/makeout.txt +# - name: Archive test results +# if: always() +# uses: actions/upload-artifact@v3 +# with: +# path: test-results +# - name: Archive html test results +# if: always() +# uses: actions/upload-artifact@v3 +# with: +# path: tests/html-test-results +# - name: Remove pr:e2e:quickstart label (if present) +# if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:quickstart') }} +# uses: actions/github-script@v6 +# with: +# script: | +# const { owner, repo, number } = context.issue; +# const labelToRemove = 'pr:e2e:quickstart'; +# try { +# await github.rest.issues.removeLabel({ +# owner, +# repo, +# issue_number: number, +# name: labelToRemove +# }); +# } catch (error) { +# core.warning(`Failed to remove 'pr:e2e:quickstart' label: ${error.message}`); +# } diff --git a/.webpack/webpack.dev.js b/.webpack/webpack.dev.js index 84a9f5b8..068c15f9 100644 --- a/.webpack/webpack.dev.js +++ b/.webpack/webpack.dev.js @@ -19,28 +19,33 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ + import path from 'path'; import { fileURLToPath } from 'url'; import { merge } from 'webpack-merge'; import commonConfig from './webpack.common.js'; +import webpack from 'webpack'; +import Dotenv from 'dotenv-webpack'; // Replicate __dirname functionality for ES modules const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const projectRootDir = path.resolve(__dirname, '..'); /** @type {import('webpack').Configuration} */ const devConfig = { + context: projectRootDir, mode: 'development', devtool: 'eval-source-map', entry: { - 'openmct-yamcs-example': './example/index.js' + 'openmct-yamcs-example': path.resolve(projectRootDir, 'example/index.js') }, devServer: { compress: true, port: 9000, static: [{ - directory: path.join(__dirname, '../example'), + directory: path.join(projectRootDir, 'example') }, { - directory: path.join(__dirname, '../node_modules/openmct/dist'), + directory: path.join(projectRootDir, '/node_modules/openmct/dist'), publicPath: '/dist', }], proxy: { @@ -59,11 +64,10 @@ const devConfig = { } } }, - resolve: { - alias: { - openmct: path.resolve(__dirname, '../node_modules/openmct/dist/openmct.js') - } - } + + plugins: [ + new Dotenv() + ] }; export default merge(commonConfig, devConfig); diff --git a/.webpack/webpack.prod.js b/.webpack/webpack.prod.js index 46bc12dd..7ac84399 100644 --- a/.webpack/webpack.prod.js +++ b/.webpack/webpack.prod.js @@ -20,12 +20,24 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ +import path from 'path'; +import { fileURLToPath } from 'url'; import { merge } from 'webpack-merge'; import common from './webpack.common.js'; +import webpack from 'webpack'; + +// Replicate __dirname functionality for ES modules +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const projectRootDir = path.resolve(__dirname, '..'); /** @type {import('webpack').Configuration} */ const prodConfig = { + context: projectRootDir, mode: 'production', + entry: { + 'openmct-yamcs': path.resolve(projectRootDir, 'src/openmct-yamcs.js') + }, devtool: 'source-map' -} +}; + export default merge(common, prodConfig); diff --git a/tests/e2e/yamcs/limits.e2e.spec.js b/tests/e2e/yamcs/limits.e2e.spec.js index c7144c41..891f034e 100644 --- a/tests/e2e/yamcs/limits.e2e.spec.js +++ b/tests/e2e/yamcs/limits.e2e.spec.js @@ -214,4 +214,4 @@ async function assertLimitLinesExistAndAreVisible(page) { for (let i = 0; i < limitLineCount; i++) { await expect(page.locator('.c-plot-limit-line').nth(i)).toBeVisible(); } -} +} \ No newline at end of file