diff --git a/.circleci/config.yml b/.circleci/config.yml index 8dfa556f94..00870d86f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -261,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: @@ -746,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: 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 1861d20d9e..a9d25b1e47 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -17,6 +17,6 @@ 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 33c0ca5921..b1415fb405 100644 --- a/.github/workflows/npm-eslint-plugin-meteor.yml +++ b/.github/workflows/npm-eslint-plugin-meteor.yml @@ -20,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 c2a260b3ae..56ac244b85 100644 --- a/.github/workflows/npm-meteor-babel.yml +++ b/.github/workflows/npm-meteor-babel.yml @@ -20,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 6351c718fd..484ccd7769 100644 --- a/.github/workflows/npm-meteor-promise.yml +++ b/.github/workflows/npm-meteor-promise.yml @@ -20,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/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 0b0aae237d..0ae79b3327 100644 --- a/tools/static-assets/skel-svelte/package.json +++ b/tools/static-assets/skel-svelte/package.json @@ -8,9 +8,12 @@ "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": { diff --git a/tools/static-assets/skel-svelte/server/main.js b/tools/static-assets/skel-svelte/server/main.js index b43489013b..886520b487 100644 --- a/tools/static-assets/skel-svelte/server/main.js +++ b/tools/static-assets/skel-svelte/server/main.js @@ -5,6 +5,10 @@ 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) { 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/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()) { + return