diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000000..ff53155550 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,58 @@ +name: CI/CD + +on: + pull_request: # Runs whenever a pull request is created or updated (including from another fork) + push: # Runs whenever a commit is pushed to the repository... + branches: [main, master, develop, hotfix/*] # ...on any of these branches + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab + +concurrency: + group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: write # publish a GitHub release + pages: write # deploy to GitHub Pages + issues: write # comment on released issues + pull-requests: write # comment on released pull requests + +jobs: + test: + runs-on: ubuntu-latest + if: | + (!( + github.ref == 'refs/heads/develop' || + github.ref == 'refs/heads/master' || + github.ref == 'refs/heads/main' + )) + env: + NODE_OPTIONS: --max-old-space-size=4000 + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 + with: + cache: 'npm' + node-version-file: '.nvmrc' + - name: Info + run: | + cat <' }} - EOF - - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 - id: filter - with: - filters: ./.github/path-filters.yml - - - if: ${{ steps.filter.outputs.any-workspace == 'true' }} - uses: ./.github/actions/install-dependencies - - - name: Build packages - if: ${{ steps.filter.outputs.any-workspace == 'true' }} - run: npm run build - - - name: Store build artifacts - if: ${{ steps.filter.outputs.any-workspace == 'true' }} - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 - with: - name: build - path: | - packages/**/build - packages/**/dist - packages/**/playground - - test: - runs-on: ubuntu-latest - needs: build - if: ${{ needs.build.outputs.any-workspace == 'true' }} - strategy: - fail-fast: false - matrix: - package: ${{ fromJSON(needs.build.outputs.packages) }} - exclude: - - package: global - - package: any-workspace - name: Test ${{ matrix.package }} - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 - with: - cache: 'npm' - node-version-file: '.nvmrc' - - uses: ./.github/actions/install-dependencies - - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 - with: - name: build - path: packages - - uses: ./.github/actions/test-package - with: - package_name: ${{ matrix.package }} - - preview: - runs-on: ubuntu-latest - needs: build - # We don't want to give forks free reign to publish to our GitHub Pages, so run this job only if both: - # - any workspace changed (otherwise there's no work to do) - # - and either - # - this is not a PR (so it's some other event that happened in our fork, like a push or merge group) - # - or it's a PR from our fork (not some other fork) - # - and - # - it's not a Renovate branch (just to reduce noise) - if: ${{ - (needs.build.outputs.any-workspace == 'true') && - ( - (!github.event.pull_request) || - (github.event.pull_request.head.repo.full_name == github.repository) - ) && - (!startsWith((github.head_ref || github.ref_name), 'renovate/')) - }} - name: Publish preview playgrounds to GitHub Pages - steps: - - name: Determine GitHub Pages directory name - id: branch_dir_name - # even `develop` should be published to a subdirectory - # that way each branch can be updated or cleaned up independently - run: | - echo "result=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" | tee --append "$GITHUB_OUTPUT" - - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 - with: - name: build - path: packages - - name: Prepare playgrounds for GitHub Pages - working-directory: ./packages - run: | - mkdir -p ../pages/ - for pkg in *; do - if [ -d "${pkg}/playground" ]; then - # using symlinks is quick and artifact generation will dereference them - # if the GitHub Pages action stops dereferencing these links, we'll need to copy the files instead - ln -s "../packages/${pkg}/playground" "../pages/${pkg}" - fi - done - - # scratch-gui doesn't follow the pattern above - ln -s "../packages/scratch-gui/build" "../pages/scratch-gui" - - ls -l ../pages/ - - name: Deploy playgrounds to GitHub Pages - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./pages - destination_dir: "${{steps.branch_dir_name.outputs.result}}" - full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}" - - results: - name: Test Results - runs-on: ubuntu-latest - needs: test - if: ${{ !cancelled() }} - steps: - - run: | - case "${{ needs.test.result }}" in - success) - echo "Tests passed successfully." - exit 0 - ;; - skipped) - echo "Tests were unnecessary for these changes, so they were skipped." - echo "If this is unexpected, check the path filters." - exit 0 - ;; - *) - echo "Tests failed." - exit 1 - ;; - esac diff --git a/.github/workflows/ghpages-cleanup.yml b/.github/workflows/ghpages-cleanup.yml deleted file mode 100644 index accdafee58..0000000000 --- a/.github/workflows/ghpages-cleanup.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: GitHub Pages Cleanup - -on: - schedule: - - cron: 0 0 * * 6 # midnight on Saturdays - workflow_dispatch: - -jobs: - cleanup: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Check out GitHub Pages branch - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - with: - # replace `fetch-depth` with `shallow-since` if and when actions/checkout#619 (or an equivalent) gets merged - # then remove the "Fetch a bit more history" step below - fetch-depth: 1 - ref: gh-pages - - name: Fetch a bit more history - run: git fetch --update-shallow --shallow-since="32 days ago" origin gh-pages - - name: Mark stale directories for removal - run: | - for dir in */; do - [ -L "${dir%/}" ] && continue # skip symlinks (trim trailing slash for test) - if [ -z "$(git log -n 1 --since "1 month ago" -- "$dir")" ]; then - echo "Removing stale directory: $dir" - git rm --quiet -r "$dir" - fi - done - - name: Configure git user - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Commit - run: | - if git diff --staged --quiet; then - echo 'No stale directories were found. Nothing to commit.' - else - git commit -m 'chore: remove stale GitHub Pages branches' - fi - - name: Push - run: "git push" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index f309f1c446..0000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,149 +0,0 @@ -name: Publish - -on: - release: - types: [published] - -jobs: - ci: - uses: ./.github/workflows/ci.yml - cd: - needs: - - ci - runs-on: ubuntu-latest - steps: - - name: Debug info - run: | - cat <> "$GITHUB_OUTPUT" - - name: Check NPM tag - run: | - if [ -z "${{ steps.npm_tag.outputs.npm_tag }}" ]; then - echo "Refusing to publish with empty NPM tag." - exit 1 - fi - - - name: Config GitHub user - shell: bash - run: | - git config --global user.name 'GitHub Actions' - git config --global user.email 'github-actions@localhost' - - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - with: - token: ${{ secrets.PAT_RELEASE_PUSH }} # persists the token for pushing to the repo later - - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 - with: - cache: 'npm' - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - uses: ./.github/actions/install-dependencies - - - name: Update the version in the package files - shell: bash - run: | - GIT_TAG="${{github.event.release.tag_name}}" - NEW_VERSION="${GIT_TAG/v/}" - - npm version "$NEW_VERSION" --no-git-tag-version - git add package* && git commit -m "chore(release): $NEW_VERSION [skip ci]" - - # Install dependencies after the version update so that - # the build outputs refer to the newest version of inner packages - - uses: ./.github/actions/install-dependencies - - - name: Publish scratch-svg-renderer - run: | - npm run build --workspace @scratch/scratch-svg-renderer - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-svg-renderer - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish scratch-render - run: | - npm run build --workspace @scratch/scratch-render - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-render - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish scratch-vm - run: | - npm run build --workspace @scratch/scratch-vm - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-vm - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish scratch-gui - run: | - cp ./packages/scratch-gui/package.json ./packages/scratch-gui/package-copy.json - - jq 'del(.exports["./standalone"])' ./packages/scratch-gui/package.json | npx sponge ./packages/scratch-gui/package.json - - npm run build:dist --workspace @scratch/scratch-gui - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui - - mv ./packages/scratch-gui/package-copy.json ./packages/scratch-gui/package.json - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish scratch-gui-standalone - run: | - bash ./scripts/prepare-standalone-gui.sh - - npm --workspace=@scratch/scratch-gui-standalone run clean && npm --workspace=@scratch/scratch-gui-standalone run build:dist-standalone - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui-standalone - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish task-herder - run: | - npm run build --workspace @scratch/task-herder - npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/task-herder - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Push to develop - shell: bash - run: | - git fetch origin develop - - TAG_NAME="${{github.event.release.tag_name}}" - LAST_COMMIT_ID="$(git rev-parse $TAG_NAME)" - DEVELOP_COMMIT_ID="$(git rev-parse origin/develop)" - - if [ "$LAST_COMMIT_ID" = "$DEVELOP_COMMIT_ID" ]; then - git push origin HEAD:develop - else - echo "Not pushing to develop because the tag we're operating on is behind" - fi - - # See https://stackoverflow.com/a/24849501 - - name: Change connected commit on release - shell: bash - run: | - git tag -f "${{github.event.release.tag_name}}" HEAD - git push -f origin "refs/tags/${{github.event.release.tag_name}}" diff --git a/.github/workflows/signature-assistant.yml b/.github/workflows/signature-assistant.yml deleted file mode 100644 index 9ff220c4b1..0000000000 --- a/.github/workflows/signature-assistant.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: "Signature Assistant" -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened, closed, synchronize] - -permissions: - actions: write - contents: read - pull-requests: write - statuses: write - -jobs: - CLA-Assistant: - if: | - github.event_name == 'pull_request_target' || - ( - github.event.comment.body == 'recheck' || - github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA' - ) - runs-on: ubuntu-latest - steps: - - uses: scratchfoundation/scratch-agreements/.github/actions/cla-allowlist@main - id: cla-allowlist - - name: "CLA Assistant" - uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # the below token should have repo scope and must be manually added by you in the repository's secrets - PERSONAL_ACCESS_TOKEN: ${{ secrets.GHA_AGREEMENTS_PAT }} - with: - remote-organization-name: "scratchfoundation" - remote-repository-name: "scratch-agreements" - path-to-signatures: "signatures/version1/cla.json" - path-to-document: "https://github.com/scratchfoundation/scratch-agreements/blob/main/CLA.md" - branch: "main" - allowlist: ${{ steps.cla-allowlist.outputs.allowlist }} diff --git a/.github/workflows/update-i18n.yml b/.github/workflows/update-i18n.yml deleted file mode 100644 index b6e5aa4ccc..0000000000 --- a/.github/workflows/update-i18n.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Update i18n - -on: - workflow_dispatch: # Allows you to run this workflow manually from the Actions tab - schedule: - - cron: 0 0 * * * # daily at midnight UTC = 7-8pm US Eastern - -concurrency: - group: '${{ github.workflow }}' - cancel-in-progress: true - -permissions: - contents: write - -jobs: - update-i18n: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 - with: - cache: 'npm' - node-version-file: '.nvmrc' - - name: Info - # https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable - env: - GH_HEAD_REF: ${{ github.head_ref }} - run: | - cat < tmp.js && rimraf tmp.js && build-i18n-src ./translations/messages/src ./translations/", "start": "webpack serve", "test": "npm run test:lint && npm run test:unit && npm run test:integration", + "lint": "eslint", "test:integration": "cross-env JEST_JUNIT_OUTPUT_NAME=integration-tests-results.xml jest --maxWorkers=4 test[\\\\/]integration", "test:lint": "eslint", "test:unit": "cross-env JEST_JUNIT_OUTPUT_NAME=unit-tests-results.xml jest test[\\\\/]unit", diff --git a/packages/scratch-gui/src/components/menu-bar/preference-menu.jsx b/packages/scratch-gui/src/components/menu-bar/preference-menu.jsx index c861091d72..b47b9187ba 100644 --- a/packages/scratch-gui/src/components/menu-bar/preference-menu.jsx +++ b/packages/scratch-gui/src/components/menu-bar/preference-menu.jsx @@ -58,7 +58,10 @@ const PreferenceMenu = ({ const itemKeys = useMemo(() => Object.keys(itemsMap), [itemsMap]); const selectedItem = useMemo(() => itemsMap[selectedItemKey], [itemsMap, selectedItemKey]); return ( - +
{ }]; }; -export default defaultProject; \ No newline at end of file +export default defaultProject; diff --git a/packages/scratch-gui/src/lib/microbit-more-update.js b/packages/scratch-gui/src/lib/microbit-more-update.js index 8a3600d16a..58eff54262 100644 --- a/packages/scratch-gui/src/lib/microbit-more-update.js +++ b/packages/scratch-gui/src/lib/microbit-more-update.js @@ -7,6 +7,7 @@ import keyMirror from 'keymirror'; import log from './log.js'; +// eslint-disable-next-line import/no-unresolved -- for CI import hexUrl from '../generated/microbit-more-hex-url.cjs'; /** diff --git a/packages/scratch-gui/src/lib/sb-file-uploader-hoc.jsx b/packages/scratch-gui/src/lib/sb-file-uploader-hoc.jsx index 240e67e331..e24034bbf7 100644 --- a/packages/scratch-gui/src/lib/sb-file-uploader-hoc.jsx +++ b/packages/scratch-gui/src/lib/sb-file-uploader-hoc.jsx @@ -176,7 +176,7 @@ const SBFileUploaderHOC = function (WrappedComponent) { } render () { const { - + cancelFileUpload, closeFileMenu: closeFileMenuProp, isLoadingUpload, @@ -187,7 +187,7 @@ const SBFileUploaderHOC = function (WrappedComponent) { onSetProjectTitle, projectChanged, requestProjectUpload: requestProjectUploadProp, - + // Intentionally propagating this one as well, since it's used in MenuBar // userOwnsProject, diff --git a/packages/scratch-gui/src/locales/en.js b/packages/scratch-gui/src/locales/en.js index 92b4c92750..b3c07f94e5 100644 --- a/packages/scratch-gui/src/locales/en.js +++ b/packages/scratch-gui/src/locales/en.js @@ -1,27 +1,27 @@ export default { - "gui.smalruby3.crashMessage.description": "We are so sorry, but it looks like Smalruby has crashed. This bug has been automatically reported to the Smalruby Team. Please refresh your page to try again.", - "gui.smalruby3.gui.defaultProjectTitle": "Smalruby Project", - "gui.smalruby3.gui.rubyTab": "Ruby", - "gui.smalruby3.previewInfo.betawelcome": "Welcome to the Smalruby 3.0 Beta", - "gui.smalruby3.previewInfo.label": "Try Smalruby 3.0", - "gui.smalruby3.previewInfo.invitation": "We're working on the next generation of Smalruby. We're excited for you to try it!", - "gui.smalruby3.previewInfo.welcome": "Welcome to the Smalruby 3.0 Preview", + 'gui.smalruby3.crashMessage.description': 'We are so sorry, but it looks like Smalruby has crashed. This bug has been automatically reported to the Smalruby Team. Please refresh your page to try again.', + 'gui.smalruby3.gui.defaultProjectTitle': 'Smalruby Project', + 'gui.smalruby3.gui.rubyTab': 'Ruby', + 'gui.smalruby3.previewInfo.betawelcome': 'Welcome to the Smalruby 3.0 Beta', + 'gui.smalruby3.previewInfo.label': 'Try Smalruby 3.0', + 'gui.smalruby3.previewInfo.invitation': "We're working on the next generation of Smalruby. We're excited for you to try it!", + 'gui.smalruby3.previewInfo.welcome': 'Welcome to the Smalruby 3.0 Preview', 'gui.smalruby3.menuBar.downloadRubyCodeToComputer': 'Save Ruby to your computer', - "gui.menuBar.meshV2": "Mesh", - "gui.smalruby3.menuBar.generateRubyFromCode": "Generate Ruby from Code", - "gui.smalruby3.unsupportedBrowser.notRecommended": "We are very sorry, but it looks like you are using a browser version that Smalruby 3.0 does not support. We recommend updating to the latest version of a supported browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, or Apple Safari. ", - "gui.smalruby3.unsupportedBrowser.description": "We're very sorry, but Smalruby 3.0 does not support Internet Explorer, Vivaldi, Opera or Silk. We recommend trying a newer browser such as Google Chrome, Mozilla Firefox, or Microsoft Edge.", - "gui.smalruby3.unsupportedBrowser.previewfaq": "Smalruby is based Scratch 3.0. So to learn more, go to the {previewFaqLink}.", - "gui.smalruby3.webglModal.description": "Unfortunately it looks like your browser or computer {webGlLink}. This technology is needed for Smalruby 3.0 to run.", - "gui.smalruby3.alerts.convertRubyToBlocksError": "Could not convert Ruby to Code. Please fix Ruby!", - "gui.smalruby3.telemetryOptIn.label": "Report statistics to improve Smalruby", - "gui.smalruby3.telemetryOptIn.body1": "The Smalruby Team is always looking to better understand how Smalruby is used around the world. To help support this effort, you can allow Smalruby to automatically send usage information to the Smalruby Team.", - "gui.smalruby3.telemetryOptIn.body2": "The information we collect includes language selection, blocks usage, and some events like saving, loading, and uploading a project. We DO NOT collect any personal information.", - "gui.telemetryOptIn.buttonTextNo": "No, thanks", - "gui.extensionLibrary.showAllExtensions": "Show all extensions", + 'gui.menuBar.meshV2': 'Mesh', + 'gui.smalruby3.menuBar.generateRubyFromCode': 'Generate Ruby from Code', + 'gui.smalruby3.unsupportedBrowser.notRecommended': 'We are very sorry, but it looks like you are using a browser version that Smalruby 3.0 does not support. We recommend updating to the latest version of a supported browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, or Apple Safari. ', + 'gui.smalruby3.unsupportedBrowser.description': "We're very sorry, but Smalruby 3.0 does not support Internet Explorer, Vivaldi, Opera or Silk. We recommend trying a newer browser such as Google Chrome, Mozilla Firefox, or Microsoft Edge.", + 'gui.smalruby3.unsupportedBrowser.previewfaq': 'Smalruby is based Scratch 3.0. So to learn more, go to the {previewFaqLink}.', + 'gui.smalruby3.webglModal.description': 'Unfortunately it looks like your browser or computer {webGlLink}. This technology is needed for Smalruby 3.0 to run.', + 'gui.smalruby3.alerts.convertRubyToBlocksError': 'Could not convert Ruby to Code. Please fix Ruby!', + 'gui.smalruby3.telemetryOptIn.label': 'Report statistics to improve Smalruby', + 'gui.smalruby3.telemetryOptIn.body1': 'The Smalruby Team is always looking to better understand how Smalruby is used around the world. To help support this effort, you can allow Smalruby to automatically send usage information to the Smalruby Team.', + 'gui.smalruby3.telemetryOptIn.body2': 'The information we collect includes language selection, blocks usage, and some events like saving, loading, and uploading a project. We DO NOT collect any personal information.', + 'gui.telemetryOptIn.buttonTextNo': 'No, thanks', + 'gui.extensionLibrary.showAllExtensions': 'Show all extensions', 'gui.smalruby3.rubyToBlocksConverter.couldNotConvertPrimitive': '"{ SOURCE }" could not be converted the block.', 'gui.smalruby3.rubyToBlocksConverter.wrongInstruction': '"{ SOURCE }" is the wrong instruction.', - "gui.smalruby3.telemetryOptIn.buttonTextYes": "Yes, I'd like to help improve Smalruby", + 'gui.smalruby3.telemetryOptIn.buttonTextYes': "Yes, I'd like to help improve Smalruby", 'gui.smalruby3.extension.mesh.name': 'Mesh', 'gui.smalruby3.extension.mesh.description': 'Allowing users to interact over a computer network.', 'mesh.categoryName': 'Mesh', @@ -81,7 +81,7 @@ export default { 'gui.smalruby3.blockDisplayModal.alwaysVisibleTitle': 'Always Visible:', 'gui.smalruby3.blockDisplayModal.blocksSubtitle': ' Blocks', 'gui.menuBar.blockDisplay': 'Block Display...', - "gui.menuBar.learn": "Learn", + 'gui.menuBar.learn': 'Learn', 'gui.menuBar.koshienEntryForm': 'Entry Form', // Block Display Modal - Block Messages diff --git a/packages/scratch-gui/test/unit/util/sb-file-uploader-hoc.test.jsx b/packages/scratch-gui/test/unit/util/sb-file-uploader-hoc.test.jsx index 204d69be85..1913501dd7 100644 --- a/packages/scratch-gui/test/unit/util/sb-file-uploader-hoc.test.jsx +++ b/packages/scratch-gui/test/unit/util/sb-file-uploader-hoc.test.jsx @@ -48,7 +48,10 @@ describe('SBFileUploaderHOC', () => { projectState: { loadingState: LoadingState.SHOWING_WITHOUT_ID }, - vm: {} + vm: {}, + test: { + isTest: false + } }, locales: { locale: 'en' diff --git a/packages/scratch-render/package.json b/packages/scratch-render/package.json index 985135efd0..4902bcbf55 100644 --- a/packages/scratch-render/package.json +++ b/packages/scratch-render/package.json @@ -24,14 +24,18 @@ ], "scripts": { "build": "webpack --progress && npm run docs", + "build:dev": "webpack --progress && npm run docs", "clean": "rimraf dist playground", "docs": "jsdoc -c .jsdoc.json", "lint": "eslint", + "test:lint": "eslint", "prepublish": "npm run build", "prepublish-watch": "npm run watch", "start": "webpack-dev-server", "tap": "tap test/unit test/integration", "test": "npm run lint && npm run tap", + "test:unit": "tap test/unit && mkdirp test-results && tap replay --reporter=junit --reporter-file=test-results/unit-tests-results.xml test/unit", + "test:integration": "tap test/integration && mkdirp test-results && tap replay --reporter=junit --reporter-file=test-results/integration-tests-results.xml test/integration", "watch": "webpack --progress --watch --watch-poll" }, "tap": { diff --git a/packages/scratch-svg-renderer/package.json b/packages/scratch-svg-renderer/package.json index 7b0818b66e..538c837e17 100644 --- a/packages/scratch-svg-renderer/package.json +++ b/packages/scratch-svg-renderer/package.json @@ -18,11 +18,14 @@ ], "scripts": { "build": "npm run clean && webpack", + "build:dev": "npm run clean && webpack", "clean": "rimraf dist playground", "start": "webpack-dev-server", "test": "npm run test:lint && npm run test:unit", + "lint": "eslint", "test:lint": "eslint", - "test:unit": "tap ./test/*.js", + "test:unit": "tap ./test/*.js && mkdirp test-results && tap replay --reporter=junit --reporter-file=test-results/unit-tests-results.xml ./test/*.js", + "test:integration": "echo \"No integration tests\"", "watch": "webpack --watch" }, "author": "Ruby Programming Shounendan", diff --git a/packages/scratch-vm/package.json b/packages/scratch-vm/package.json index fc957945ee..6ee457e06c 100644 --- a/packages/scratch-vm/package.json +++ b/packages/scratch-vm/package.json @@ -28,6 +28,7 @@ ], "scripts": { "build": "npm run docs && webpack --progress", + "build:dev": "npm run docs && webpack --progress", "clean": "rimraf dist playground", "coverage": "tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov", "docs": "jsdoc -c .jsdoc.json", @@ -40,6 +41,8 @@ "tap:unit": "tap ./test/unit/*.js", "tap:integration": "tap ./test/integration/*.js", "test": "npm run lint && npm run tap", + "test:unit": "tap ./test/unit/*.js && mkdirp test-results && tap replay --reporter=junit --reporter-file=test-results/unit-tests-results.xml ./test/unit/*.js", + "test:integration": "tap ./test/integration/*.js && mkdirp test-results && tap replay --reporter=junit --reporter-file=test-results/integration-tests-results.xml ./test/integration/*.js", "watch": "webpack --progress --watch" }, "browserslist": [ diff --git a/packages/task-herder/package.json b/packages/task-herder/package.json index 9e7d56b35b..c51045c807 100644 --- a/packages/task-herder/package.json +++ b/packages/task-herder/package.json @@ -31,10 +31,13 @@ "clean": "rimraf dist", "dev": "vite", "build": "tsc --project tsconfig.build.json && vite build", + "build:dev": "tsc --project tsconfig.build.json && vite build", "format": "prettier --write . && eslint --fix", "lint": "eslint && prettier --check .", "preview": "vite preview", - "test": "npm run lint && vitest run --coverage" + "test": "npm run lint && vitest run --coverage", + "test:unit": "vitest run --coverage", + "test:integration": "echo \"No integration tests\"" }, "devDependencies": { "@vitest/coverage-v8": "4.0.17",