diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b275071cd..00870d86f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -version: 2 +version: 2.1 # A reusable "run" snippet which is ran before each test to setup the # environment for user-limits, core-dumps, etc. @@ -62,6 +62,7 @@ build_machine_environment: &build_machine_environment # Specify that we want an actual machine (ala Circle 1.0), not a Docker image. docker: - image: meteor/circleci:android-30-node-14 + resource_class: large environment: # This multiplier scales the waitSecs for selftests. TIMEOUT_SCALE_FACTOR: 8 @@ -96,6 +97,30 @@ build_machine_environment: &build_machine_environment NUM_GROUPS: 12 RUNNING_AVG_LENGTH: 6 +can_disable_fibers: &can_disable_fibers + parameters: + fibers: + type: boolean + default: true + +set_fibers_env: &set_fibers_env + name: "Disable Fibers" + command: | + if [ "<< parameters.fibers >>" == "false" ]; then + echo "Disabling Fibers" + echo 'export DISABLE_FIBERS=1' >> "$BASH_ENV" + source "$BASH_ENV" + fi + + +# Run tests with Fibers and then without. +matrix_for_fibers: &matrix_for_fibers + matrix: + parameters: + # If we want to run with Fibers and without, just append false here. + fibers: [true] + + jobs: Get Ready: <<: *build_machine_environment @@ -167,6 +192,7 @@ jobs: path: /tmp/memuse.txt Isolated Tests: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -175,6 +201,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -209,6 +236,7 @@ jobs: path: /tmp/memuse.txt Test Group 0: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -217,6 +245,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -233,7 +262,7 @@ jobs: --headless \ --junit ./tmp/results/junit/0.xml \ --without-tag "custom-warehouse" - no_output_timeout: 20m + no_output_timeout: 30m - run: <<: *run_save_node_bin - store_test_results: @@ -249,6 +278,7 @@ jobs: path: /tmp/memuse.txt Test Group 1: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -257,6 +287,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -289,6 +320,7 @@ jobs: path: /tmp/memuse.txt Test Group 2: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -297,6 +329,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -329,6 +362,7 @@ jobs: path: /tmp/memuse.txt Test Group 3: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -337,13 +371,14 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv - run: name: "Running self-test (Test Group 3)" command: | - if [ -f ./tmp/test-groups/3.txt ]; then TEST_GROUP=$(<./tmp/test-groups/3.txt); elif [ -f ./tmp/test-groups/0.txt ]; then TEST_GROUP=XXXXX; else TEST_GROUP='^c[p-z]|^[d-g]|^h[a-e]'; fi + if [ -f ./tmp/test-groups/3.txt ]; then TEST_GROUP=$(<./tmp/test-groups/3.txt); elif [ -f ./tmp/test-groups/0.txt ]; then TEST_GROUP=XXXXX; else TEST_GROUP='^c[p-z]|^h[a-e]'; fi echo $TEST_GROUP; eval $PRE_TEST_COMMANDS; ./meteor self-test \ @@ -353,7 +388,7 @@ jobs: --headless \ --junit ./tmp/results/junit/3.xml \ --without-tag "custom-warehouse" - no_output_timeout: 20m + no_output_timeout: 30m - run: <<: *run_save_node_bin - store_test_results: @@ -369,6 +404,7 @@ jobs: path: /tmp/memuse.txt Test Group 4: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -377,6 +413,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -409,6 +446,7 @@ jobs: path: /tmp/memuse.txt Test Group 5: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -417,6 +455,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -449,6 +488,7 @@ jobs: path: /tmp/memuse.txt Test Group 6: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -457,6 +497,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -489,6 +530,7 @@ jobs: path: /tmp/memuse.txt Test Group 7: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -497,6 +539,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -529,6 +572,7 @@ jobs: path: /tmp/memuse.txt Test Group 8: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -537,6 +581,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -569,6 +614,7 @@ jobs: path: /tmp/memuse.txt Test Group 9: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -577,6 +623,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -609,6 +656,7 @@ jobs: path: /tmp/memuse.txt Test Group 10: + <<: *can_disable_fibers <<: *build_machine_environment steps: - run: @@ -617,6 +665,7 @@ jobs: <<: *run_env_change - attach_workspace: at: . + - run: *set_fibers_env - run: name: "Print environment" command: printenv @@ -648,6 +697,46 @@ jobs: - store_artifacts: path: /tmp/memuse.txt + Test Group 11: + <<: *build_machine_environment + steps: + - run: + <<: *run_log_mem_use + - run: + <<: *run_env_change + - attach_workspace: + at: . + - run: + name: "Print environment" + command: printenv + - run: + name: "Running self-test (Test Group 11)" + command: | + if [ -f ./tmp/test-groups/11.txt ]; then TEST_GROUP=$(<./tmp/test-groups/11.txt); elif [ -f ./tmp/test-groups/0.txt ]; then TEST_GROUP=XXXXX; else TEST_GROUP='^[d-g]'; fi + echo $TEST_GROUP; + eval $PRE_TEST_COMMANDS; + ./meteor self-test \ + "$TEST_GROUP" \ + --retries ${METEOR_SELF_TEST_RETRIES} \ + --exclude "${SELF_TEST_EXCLUDE}" \ + --headless \ + --junit ./tmp/results/junit/11.xml \ + --without-tag "custom-warehouse" + no_output_timeout: 30m + - run: + <<: *run_save_node_bin + - store_test_results: + path: ./tmp/results + - persist_to_workspace: + root: . + paths: ./tmp/results/junit + - store_artifacts: + path: ./tmp/results + - store_artifacts: + path: /tmp/core_dumps + - store_artifacts: + path: /tmp/memuse.txt + # Test the JSDoc declarations which live within this codebase against the # Meteor Docs (https://github.com/meteor/docs) repository, where they'll # eventually be consumed. This test aims to provide an early warning of @@ -658,6 +747,7 @@ jobs: docker: # This Node version should match that in the meteor/docs CircleCI config. - image: meteor/circleci:android-28-node-12 + resource_class: large environment: CHECKOUT_METEOR_DOCS: /home/circleci/test_docs steps: @@ -687,6 +777,7 @@ jobs: npm test Clean Up: + <<: *can_disable_fibers <<: *build_machine_environment steps: - attach_workspace: @@ -769,42 +860,58 @@ workflows: - Docs - Get Ready - Isolated Tests: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 0: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 1: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 2: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 3: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 4: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 5: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 6: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 7: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 8: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 9: + <<: *matrix_for_fibers requires: - Get Ready - Test Group 10: + <<: *matrix_for_fibers + requires: + - Get Ready + - Test Group 11: requires: - Get Ready - Clean Up: + <<: *matrix_for_fibers requires: - Isolated Tests - Test Group 0 @@ -818,3 +925,4 @@ workflows: - Test Group 8 - Test Group 9 - Test Group 10 + - Test Group 11 diff --git a/.eslintignore b/.eslintignore index 5228e27ede..3653ab7c32 100644 --- a/.eslintignore +++ b/.eslintignore @@ -67,7 +67,6 @@ tools/runners/run-app.js tools/runners/run-mongo.js tools/runners/run-proxy.js tools/runners/run-selenium.js -tools/runners/run-updater.js tools/packaging/package-client.js tools/packaging/package-map.js diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml new file mode 100644 index 0000000000..21f854bfec --- /dev/null +++ b/.github/workflows/check-code-style.yml @@ -0,0 +1,19 @@ +name: Check code-style +on: + push: + paths: + - 'npm-packages/meteor-installer/**' + pull_request: + paths: + - 'npm-packages/meteor-installer/**' +jobs: + check-code-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14.x + - run: npm ci + - name: Run ESLint@8 + run: npx eslint@8 "./npm-packages/meteor-installer/**/*.js" diff --git a/.github/workflows/check-syntax.yml b/.github/workflows/check-syntax.yml new file mode 100644 index 0000000000..1c55cb64fa --- /dev/null +++ b/.github/workflows/check-syntax.yml @@ -0,0 +1,15 @@ +name: Check legacy syntax +on: + - push + - pull_request +jobs: + check-code-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - run: cd scripts/admin/check-legacy-syntax && npm ci + - name: Check syntax + run: cd scripts/admin/check-legacy-syntax && node check-syntax.js diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 168b487427..a9624d9ad1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,14 +10,14 @@ jobs: run: working-directory: docs/ steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 12.x - name: Build the Docs run: npm ci && npm run build - name: Deploy to Netlify for preview - uses: nwtgck/actions-netlify@v1.2.2 + uses: nwtgck/actions-netlify@v1.2.4 with: publish-dir: './docs/public/' production-branch: devel diff --git a/.github/workflows/guide.yml b/.github/workflows/guide.yml index 4a8a7f1ce5..124b500ce9 100644 --- a/.github/workflows/guide.yml +++ b/.github/workflows/guide.yml @@ -10,14 +10,14 @@ jobs: run: working-directory: guide/ steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 12.x - name: Build the Guide run: npm ci && npm run build - name: Deploy to Netlify for preview - uses: nwtgck/actions-netlify@v1.2.2 + uses: nwtgck/actions-netlify@v1.2.4 with: publish-dir: './guide/public' production-branch: devel diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 88603611be..a9d25b1e47 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,10 +9,14 @@ name: Labeler on: - pull_request_target +permissions: + contents: read # to determine modified files (actions/labeler) + pull-requests: write # to add labels to PRs (actions/labeler) + jobs: label: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v3 + - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/npm-eslint-plugin-meteor.yml b/.github/workflows/npm-eslint-plugin-meteor.yml index cb283e3c54..b1415fb405 100644 --- a/.github/workflows/npm-eslint-plugin-meteor.yml +++ b/.github/workflows/npm-eslint-plugin-meteor.yml @@ -6,6 +6,10 @@ on: pull_request: paths: - "npm-packages/eslint-plugin-meteor/**" + +permissions: + contents: read # to fetch code (actions/checkout) + jobs: test: runs-on: ubuntu-latest @@ -16,9 +20,9 @@ jobs: matrix: node-version: [12.x, 14.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/npm-meteor-babel.yml b/.github/workflows/npm-meteor-babel.yml index 6a20fb61b2..56ac244b85 100644 --- a/.github/workflows/npm-meteor-babel.yml +++ b/.github/workflows/npm-meteor-babel.yml @@ -6,6 +6,10 @@ on: pull_request: paths: - "npm-packages/meteor-babel/**" + +permissions: + contents: read # to fetch code (actions/checkout) + jobs: test: runs-on: ubuntu-latest @@ -16,9 +20,9 @@ jobs: matrix: node-version: [12.x, 14.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/npm-meteor-promise.yml b/.github/workflows/npm-meteor-promise.yml index 247a5a76c2..484ccd7769 100644 --- a/.github/workflows/npm-meteor-promise.yml +++ b/.github/workflows/npm-meteor-promise.yml @@ -6,6 +6,10 @@ on: pull_request: paths: - "npm-packages/meteor-promise/**" + +permissions: + contents: read # to fetch code (actions/checkout) + jobs: test: runs-on: ubuntu-latest @@ -16,9 +20,9 @@ jobs: matrix: node-version: [12.x, 14.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.gitignore b/.gitignore index 4485482276..35e2d8f2e7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,3 @@ mongo-test-output # core packages shouldn't have .versions files packages/*/.versions - -# packages shouldn't have .npm on Git -packages/**/.npm diff --git a/.travis.yml b/.travis.yml index 2d4a4a74d6..35e4e9f859 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,17 @@ cache: - ".meteor" - ".babel-cache" script: - - export phantom=false - # to skip Downloading Chromium on every run - # https://github.com/dfernandez79/puppeteer/blob/main/README.md#q-chromium-gets-downloaded-on-every-npm-ci-run-how-can-i-cache-the-download - - export PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium - travis_retry ./packages/test-in-console/run.sh env: - - CXX=g++-4.8 + global: + - CXX=g++-4.8 + - phantom=false + - PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium + jobs: + # We don't want to run the tests without fibers anymore. + # - DISABLE_FIBERS=1 + # Use a different flag, since node would use false as a string. + - FIBERS_ENABLED=1 addons: apt: sources: diff --git a/README.md b/README.md index f7ae83b3ab..7ff1089850 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@
You've pressed the button {counter} times.
Just add lang="ts" to .svelte components.
diff --git a/tools/static-assets/skel-svelte/package.json b/tools/static-assets/skel-svelte/package.json index 796c709937..0ae79b3327 100644 --- a/tools/static-assets/skel-svelte/package.json +++ b/tools/static-assets/skel-svelte/package.json @@ -8,15 +8,25 @@ "visualize": "meteor --production --extra-packages bundle-visualizer" }, "dependencies": { - "@babel/runtime": "^7.17.9", - "meteor-node-stubs": "^1.2.1", - "svelte": "^3.46.4" + "@babel/runtime": "^7.20.6", + "meteor-node-stubs": "^1.2.5", + "svelte": "^3.54.0" + }, + "devDependencies": { + "svelte-preprocess": "^5.0.0" }, "meteor": { "mainModule": { "client": "client/main.js", "server": "server/main.js" }, + "nodeModules": { + "recompile": { + "svelte": [ + "legacy" + ] + } + }, "testModule": "tests/main.js" } } diff --git a/tools/static-assets/skel-svelte/server/main.js b/tools/static-assets/skel-svelte/server/main.js index 31a9e0e2d6..886520b487 100644 --- a/tools/static-assets/skel-svelte/server/main.js +++ b/tools/static-assets/skel-svelte/server/main.js @@ -1,5 +1,35 @@ import { Meteor } from 'meteor/meteor'; +import { LinksCollection } from '/imports/api/links'; -Meteor.startup(() => { - // code to run on server at startup +async function insertLink({ title, url }) { + await LinksCollection.insertAsync({ title, url, createdAt: new Date() }); +} + +Meteor.publish('links.all', function publishLinksAll() { + return LinksCollection.find(); +}) + +Meteor.startup(async () => { + // If the Links collection is empty, add some data. + if (await LinksCollection.find().countAsync() === 0) { + await insertLink({ + title: 'Do the Tutorial', + url: 'https://svelte-tutorial.meteor.com/', + }); + + await insertLink({ + title: 'Follow the Guide', + url: 'https://guide.meteor.com', + }); + + await insertLink({ + title: 'Read the Docs', + url: 'https://docs.meteor.com', + }); + + await insertLink({ + title: 'Discussions', + url: 'https://forums.meteor.com', + }); + } }); diff --git a/tools/static-assets/skel-svelte/tsconfig.json b/tools/static-assets/skel-svelte/tsconfig.json new file mode 100644 index 0000000000..11f2c45698 --- /dev/null +++ b/tools/static-assets/skel-svelte/tsconfig.json @@ -0,0 +1,20 @@ +{ + // see https://guide.meteor.com/build-tool.html#typescript for a config example + "compilerOptions": { + "allowSyntheticDefaultImports": true, // to be able to import eg meteor/mongo + "baseUrl": ".", // required by "paths" + "module": "esNext", // required by "preserveValueImports" + "moduleResolution": "node", // required by zodern:types (not documented) + "paths": { + "/*": ["*"], // support absolute /imports/* with a leading '/' + // support Meteor/Atmospehere packages, required by zodern:types + "meteor/*": [ + "node_modules/@types/meteor/*", + ".meteor/local/types/packages.d.ts" + ] + }, + "preserveSymlinks": true, // required by zodern:types + "preserveValueImports": true // otherwise TS will remove imported components + }, + "exclude": ["./.meteor/**", "./packages/**"] // this may solve VS Code Svelte plugin warnings +} diff --git a/tools/static-assets/skel-tailwind/.meteor/packages b/tools/static-assets/skel-tailwind/.meteor/packages index 72de92e77b..90ce4b06dd 100644 --- a/tools/static-assets/skel-tailwind/.meteor/packages +++ b/tools/static-assets/skel-tailwind/.meteor/packages @@ -17,7 +17,6 @@ typescript # Enable TypeScript syntax in .ts and .tsx modules shell-server # Server-side component of the `meteor shell` command hot-module-replacement # Update client in development without reloading the page -autopublish # Publish all data to the clients (for prototyping) -insecure # Allow all DB writes from clients (for prototyping) +~prototype~ static-html # Define static page content in .html files react-meteor-data # React higher-order component for reactively tracking Meteor data diff --git a/tools/static-assets/skel-tailwind/imports/ui/Info.jsx b/tools/static-assets/skel-tailwind/imports/ui/Info.jsx index 8272c26f94..4d8436df8a 100644 --- a/tools/static-assets/skel-tailwind/imports/ui/Info.jsx +++ b/tools/static-assets/skel-tailwind/imports/ui/Info.jsx @@ -1,77 +1,106 @@ -import React from 'react'; -import { useTracker } from 'meteor/react-meteor-data'; -import { LinksCollection } from '../api/links'; +import React from "react"; +import { useFind, useSubscribe } from "meteor/react-meteor-data"; +import { LinksCollection } from "../api/links"; function classNames(...classes) { - return classes.filter(Boolean).join(' '); + return classes.filter(Boolean).join(" "); } export const Info = () => { - const links = useTracker(() => { - const data = LinksCollection.find().fetch(); + const foreGroundColors = [ + "text-red-700", + "text-orange-700", + "text-rose-700", + "text-yellow-700", + ]; + const backgroundColors = [ + "bg-red-50", + "bg-orange-50", + "bg-rose-50", + "bg-yellow-50", + ]; + const isLoading = useSubscribe("links"); - const foreGroundColors = ['text-red-700', 'text-orange-700', 'text-rose-700', 'text-yellow-700']; - const backgroundColors = ['bg-red-50', 'bg-orange-50', 'bg-rose-50', 'bg-yellow-50']; + const data = useFind(() => LinksCollection.find()); - return data.map((d, index) => ({ - ...d, - iconForeground: foreGroundColors[index], - iconBackground: backgroundColors[index], - })) - }); + const links = data.map((d, index) => ({ + ...d, + iconForeground: foreGroundColors[index], + iconBackground: backgroundColors[index], + })); - const actions = links.map(link => ({ + if (isLoading()) { + returnThis is the about page.
+ diff --git a/tools/static-assets/skel-vue/imports/ui/App.vue b/tools/static-assets/skel-vue/imports/ui/App.vue index e126098ccb..7a775391cb 100644 --- a/tools/static-assets/skel-vue/imports/ui/App.vue +++ b/tools/static-assets/skel-vue/imports/ui/App.vue @@ -1,26 +1,10 @@ - -+ You've pressed the button {{ count }} times. +
+ diff --git a/tools/static-assets/skel-vue/imports/ui/Home.vue b/tools/static-assets/skel-vue/imports/ui/Home.vue new file mode 100644 index 0000000000..0473845661 --- /dev/null +++ b/tools/static-assets/skel-vue/imports/ui/Home.vue @@ -0,0 +1,10 @@ + + + +