diff --git a/.eslintignore b/.eslintignore index a448724fb20..22f48fb5f6d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,7 +2,9 @@ node_modules/* MVCDemos/* bundles/* NetCoreDemos/* +publish-demos/* JSDemos/Demos/**/testcafe-test-code.js /**/azure.file.system.js JSDemos/Demos/**/config.js +JSDemos/Demos/**/Vue/**/*.html diff --git a/.github/workflows/build-aspnet.yml b/.github/workflows/build-aspnet.yml new file mode 100644 index 00000000000..7649fdc37b0 --- /dev/null +++ b/.github/workflows/build-aspnet.yml @@ -0,0 +1,67 @@ +name: Build aspnet demos + +concurrency: + group: wf-${{ github.event.pull_request.number || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +on: + pull_request: + push: + branches: + - "[0-9][0-9]_[0-9]" + +jobs: + build: + name: Build aspnet demos + runs-on: windows-2019 + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == false + + steps: + - name: Get sources + uses: actions/checkout@v4 + + - name: Get version + id: get_version + run: | + $env:version=$(node -p -e "require('./package.json').version.slice(0, 4).replace('.', '_')") + echo "version=$env:version" >> $GITHUB_OUTPUT + + - name: Clone devextreme-aspnet repo + uses: actions/checkout@v4 + with: + repository: DevExpress/devextreme-aspnet + ref: ${{ steps.get_version.outputs.version }} + path: devextreme-aspnet + token: ${{ secrets.ASPNET_PAT }} + + - name: Restore npm cache + uses: actions/cache@v3 + with: + path: ./node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Run npm install + run: npm install --no-audit --no-fund + + - name: Update repository.config.json + run: | + $jsonData = Get-Content -Raw -Path "repository.config.json" | ConvertFrom-Json + $jsonData.DevExtreme = "${{ github.workspace }}\DevExtreme" + $jsonData."devextreme-aspnet" = "${{ github.workspace }}\devextreme-aspnet" + $jsonData | ConvertTo-Json | Set-Content -Path "repository.config.json" + + - name: Run prepare-aspnet + run: npm run prepare-aspnet + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: Build MVC demos + working-directory: MVCDemos + run: | + nuget restore DevExtreme.MVC.Demos.sln + msbuild DevExtreme.MVC.Demos.sln + + - name: Build Core demos + working-directory: NetCoreDemos + run: dotnet build DevExtreme.NETCore.Demos.sln diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 36b593261c8..fd7cf7cde88 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,41 +30,4 @@ jobs: npm install --no-audit --no-fund --ignore-scripts git diff --exit-code package-lock.json - check_generated_demos: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Get sources - uses: actions/checkout@v3 - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Restore npm cache - uses: actions/cache@v3 - with: - path: ./node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node-modules - - - name: Check generated JS demos - run: | - npm install --no-audit --no-fund --ignore-scripts - - git reset --hard - - npm run convert-to-js ./JSDemos/Demos/**/React - - git add ./JSDemos/Demos -N - - if git diff --exit-code ; then - echo "Generated JS demos are up-to-date" - else - echo "Generated JS demos are outdated. Execute 'npm run convert-to-js ./JSDemos/Demos/**/React' and commit changes." - echo "If you see another diff, ensure that extra listed files have LF endings." - exit 1 - fi - diff --git a/.github/workflows/publish-demos.yml b/.github/workflows/publish-demos.yml new file mode 100644 index 00000000000..7bb301bf2dd --- /dev/null +++ b/.github/workflows/publish-demos.yml @@ -0,0 +1,46 @@ +name: Publish Demos to GH Pages + +on: + workflow_dispatch: + push: + tags: + - 'release-*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Read version from package.json and append "-stable" + run: echo echo "STABLE_VERSION=$(jq -r '.version' package.json | awk -F. '{print $1 "." $2}')-stable" >> $GITHUB_ENV + + - name: Install Dependencies + run: npm install + + - name: Install stable devextreme pacakges + run: npm install devextreme@${{ env.STABLE_VERSION }} devextreme-angular@${{ env.STABLE_VERSION }} devextreme-react@${{ env.STABLE_VERSION }} devextreme-vue@${{ env.STABLE_VERSION }} + + - name: Copy metadata + run: npm run make-demos-bundle -- --copy-metadata + + - name: Prepare React demo bundles + run: npm run make-demos-bundle -- --framework React + + - name: Prepare Vue demo bundles + run: npm run make-demos-bundle -- --framework Vue + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./publish-demos diff --git a/.github/workflows/visual_tests.yml b/.github/workflows/visual_tests.yml index 0301bd2cfaf..b4ba7e43b0d 100644 --- a/.github/workflows/visual_tests.yml +++ b/.github/workflows/visual_tests.yml @@ -40,7 +40,7 @@ jobs: uses: actions/cache@v3 with: path: 'devextreme-repo/**/node_modules' - key: ${{ runner.os }}-node-modules-${{ hashFiles('devextreme-repo/**/package-lock.json') }} + key: ${{ runner.os }}-devextreme-node-modules-${{ hashFiles('devextreme-repo/**/package-lock.json') }} - name: Use Node.js 18 uses: actions/setup-node@v3 @@ -112,7 +112,7 @@ jobs: steps: - name: Pin Chrome version run: | - CHROME_VERSION=116.0.5845.110 + CHROME_VERSION=117.0.5938.92 wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" sudo dpkg -i "google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" diff --git a/.github/workflows/visual_tests_frameworks.yml b/.github/workflows/visual_tests_frameworks.yml index 43644407e79..77d9bc387e3 100644 --- a/.github/workflows/visual_tests_frameworks.yml +++ b/.github/workflows/visual_tests_frameworks.yml @@ -43,7 +43,7 @@ jobs: uses: actions/cache@v3 with: path: 'devextreme/**/node_modules' - key: ${{ runner.os }}-node-modules-${{ hashFiles('devextreme/**/package-lock.json') }} + key: ${{ runner.os }}-devextreme-node-modules-${{ hashFiles('devextreme/**/package-lock.json') }} - name: Use Node.js 18 uses: actions/setup-node@v3 @@ -150,8 +150,6 @@ jobs: with: path: ./node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-modules - name: Delete DX packages run: sed -i '/23.2-next/d' ./package.json @@ -187,17 +185,39 @@ jobs: retention-days: 1 lint: - name: Lint code base - needs: - - build-demos + name: ${{ matrix.name }} + needs: build-devextreme runs-on: ubuntu-latest timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - name: Lint code base (excluding demos) + command: npm run lint-non-demos + - name: Lint demos (1/4) + command: CONSTEL=1/4 npm run lint-demos + - name: Lint demos (2/4) + command: CONSTEL=2/4 npm run lint-demos + - name: Lint demos (3/4) + command: CONSTEL=3/4 npm run lint-demos + - name: Lint demos (4/4) + command: CONSTEL=4/4 npm run lint-demos + steps: - name: Get sources uses: actions/checkout@v3 + - name: Get changed files + uses: ./.github/actions/get-changed-files + if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + path: changed-files.json + - name: Delete DX packages run: sed -i '/23.2-next/d' ./package.json @@ -206,9 +226,6 @@ jobs: with: name: devextreme-sources - - name: Unpack artifacts - run: 7z x node_modules.7z - - name: Install packages run: | npm install devextreme-installer.tgz @@ -230,7 +247,73 @@ jobs: dotnet tool install -g dotnet-format --version 5.1.225507 - name: Run lint - run: npm run lint + env: + CHANGEDFILEINFOSPATH: ${{ github.workspace }}/changed-files.json + DEBUG: 'eslint:cli-engine,stylelint:standalone' + run: ${{ matrix.command }} + + check_generated_demos: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: build-demos + strategy: + fail-fast: false + matrix: + include: + - name: Check generated demos (1/5) + command: CONSTEL=1/5 npm run convert-to-js + - name: Check generated demos (2/5) + command: CONSTEL=2/5 npm run convert-to-js + - name: Check generated demos (3/5) + command: CONSTEL=3/5 npm run convert-to-js + - name: Check generated demos (4/5) + command: CONSTEL=4/5 npm run convert-to-js + - name: Check generated demos (5/5) + command: CONSTEL=5/5 npm run convert-to-js + steps: + - name: Get sources + uses: actions/checkout@v3 + + - name: Delete DX packages + run: sed -i '/23.2-next/d' ./package.json + + - name: Download devextreme sources + uses: actions/download-artifact@v3 + with: + name: devextreme-sources + + - name: Unpack artifacts + run: 7z x node_modules.7z + + - name: Install packages + run: | + npm install devextreme-installer.tgz + npm install devextreme-dist-installer.tgz + npm install devextreme-react-installer.tgz + npm install devextreme-vue-installer.tgz + npm install devextreme-angular-installer.tgz + + - name: Run npm install + run: npm install --no-audit --no-fund + + - name: Prepare JS + run: npm run prepare-js + + - name: Check generated JS demos + run: | + ${{ matrix.command }} + + git add ./JSDemos/Demos -N + + if git diff --exit-code . ':!package-lock.json' ':!package.json' ; then + echo "Generated JS demos are up-to-date" + else + echo "Generated JS demos are outdated. Execute 'npm run convert-to-js ./JSDemos/Demos/**/React' and commit changes." + echo "If you see another diff, ensure that extra listed files have LF endings." + exit 1 + fi + testcafe: needs: build-demos @@ -246,7 +329,7 @@ jobs: steps: - name: Pin Chrome version run: | - CHROME_VERSION=116.0.5845.110 + CHROME_VERSION=117.0.5938.92 wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" sudo dpkg -i "google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" @@ -267,8 +350,8 @@ jobs: - name: Prepare JS run: npm run prepare-js - - name: Prepare Bundles - run: npx gulp bundles + - name: Update bundles config + run: npx gulp update-config - name: Run Web Server run: | diff --git a/.gitignore b/.gitignore index dc4fd98119c..4dba461b6ab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ bin obj lib NuGet -.vscode +.vscode/* .idea .vs .idea @@ -21,6 +21,7 @@ screenshots bundles changed-files.json +!.vscode/settings.json gulpfile.js/.eslintrc.js **/azure.file.system.js @@ -28,6 +29,7 @@ JSDemos/Demos/FileManager/AzureClientBinding/Angular/app/app.service.ts JSDemos/Demos/FileUploader/AzureDirectUploading/Angular/app/app.service.ts JSDemos/Demos/**/config.js +JSDemos/Demos/**/tsconfig.json MVCDemos/App_Data/Northwind.mdf MVCDemos/Content/icons @@ -56,3 +58,4 @@ NetCoreDemos/menuMeta.json NetCoreDemos/wwwroot/bundle.min.css NetCoreDemos/wwwroot/bundle.min.js .DS_Store +publish-demos diff --git a/.prettierignore b/.prettierignore index 84651dba2d0..836f34e9ff3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,4 +8,5 @@ *.json MVCDemos NetCoreDemos -.github \ No newline at end of file +.github +publish-demos \ No newline at end of file diff --git a/.stylelintignore b/.stylelintignore index c4ae7064380..216990a3962 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,2 +1,3 @@ MVCDemos NetCoreDemos +publish-demos diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000000..4e38f6cfcf9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.tabSize": 2, +} \ No newline at end of file diff --git a/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.css b/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.css index 7cb869d9c8a..24b96ccbbf1 100644 --- a/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.css +++ b/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.css @@ -2,11 +2,11 @@ height: 700px; } -::ng-deep #accordion h1 { +::ng-deep #accordion .header { font-size: 20px; } -::ng-deep #accordion h1, +::ng-deep #accordion .header, ::ng-deep #accordion p { margin: 0; } @@ -19,7 +19,7 @@ display: flex; } -::ng-deep .dx-theme-material #accordion h1 { +::ng-deep .dx-theme-material #accordion .header { align-self: center; } diff --git a/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.html b/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.html index 9a2347c9b77..753a795a3ee 100644 --- a/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.html +++ b/JSDemos/Demos/Accordion/Overview/Angular/app/app.component.html @@ -9,7 +9,7 @@ id="accordion-container" >