From 214a54e57e019bfc76c03f80a57fa5ec5c244c39 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 05:18:44 +0400 Subject: [PATCH 01/16] prettierignore generated files --- packages/squiggle-lang/.prettierignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/squiggle-lang/.prettierignore b/packages/squiggle-lang/.prettierignore index cc0cf959..75fd1e23 100644 --- a/packages/squiggle-lang/.prettierignore +++ b/packages/squiggle-lang/.prettierignore @@ -6,3 +6,5 @@ lib _coverage/ .cache/ Reducer_Peggy_GeneratedParser.js +ReducerProject_IncludeParser.js +src/rescript/Reducer/Reducer_Peggy/helpers.js From cc846aa74c637dcf8eaba3e0591ce1b6d6e8651b Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 05:19:15 +0400 Subject: [PATCH 02/16] turborepo --- .gitignore | 1 + package.json | 3 ++- packages/vscode-ext/package.json | 15 ++++++------ turbo.json | 15 ++++++++++++ yarn.lock | 42 ++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index 0712e779..3cc94af0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ yarn-error.log todo.txt result shell.nix +.turbo diff --git a/package.json b/package.json index dcab983e..2db44f0c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "lint:all": "prettier --check . && cd packages/squiggle-lang && yarn lint:rescript" }, "devDependencies": { - "prettier": "^2.7.1" + "prettier": "^2.7.1", + "turbo": "^1.5.5" }, "workspaces": [ "packages/*" diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 29b62437..325de130 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -114,13 +114,13 @@ } }, "scripts": { - "vscode:prepublish": "yarn run compile", - "compile:tsc": "tsc -b", - "compile:grammar": "js-yaml syntaxes/squiggle.tmLanguage.yaml >syntaxes/squiggle.tmLanguage.json", - "compile:vendor": "(cd ../squiggle-lang && yarn run build) && (cd ../components && yarn run bundle && yarn run build:css) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js && cp ../website/static/img/squiggle-logo.png media/vendor/icon.png", - "compile": "yarn run compile:vendor && yarn run compile:grammar && yarn run compile:tsc", + "vscode:prepublish": "yarn run build", + "build:tsc": "tsc -b", + "build:grammar": "js-yaml syntaxes/squiggle.tmLanguage.yaml >syntaxes/squiggle.tmLanguage.json", + "build:vendor": "mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js && cp ../website/static/img/squiggle-logo.png media/vendor/icon.png", + "build": "yarn run build:vendor && yarn run build:grammar && yarn run build:tsc", "watch": "tsc -b -watch", - "pretest": "yarn run compile && yarn run lint", + "pretest": "yarn run build && yarn run lint", "lint": "prettier --check .", "format": "prettier --write .", "package": "npx vsce package --yarn" @@ -138,6 +138,7 @@ "vscode-languageclient": "^8.0.2", "vscode-languageserver": "^8.0.2", "vscode-languageserver-textdocument": "^1.0.7", - "@quri/squiggle-lang": "^0.2.11" + "@quri/squiggle-lang": "*", + "@quri/squiggle-components": "*" } } diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000..3417e170 --- /dev/null +++ b/turbo.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "lint": {}, + "build": { + "dependsOn": ["^build"] + }, + "test": { + "dependsOn": ["build"] + }, + "vscode-ext#build": { + "dependsOn": ["^build", "@quri/squiggle-components#bundle"] + } + } +} diff --git a/yarn.lock b/yarn.lock index 2292e288..a7a75fd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18242,6 +18242,48 @@ tunnel@0.0.4: resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.4.tgz#2d3785a158c174c9a16dc2c046ec5fc5f1742213" integrity sha512-o9QYRJN5WgS8oCtqvwzzcfnzaTnDPr7HpUsQdSXscTyzXbjvl4wSHPTUKOKzEaDeQvOuyRtt3ui+ujM7x7TReQ== +turbo-darwin-64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.5.5.tgz#710d4e7999066bd4f500456f7cd1c30f6e6205ed" + integrity sha512-HvEn6P2B+NXDekq9LRpRgUjcT9/oygLTcK47U0qsAJZXRBSq/2hvD7lx4nAwgY/4W3rhYJeWtHTzbhoN6BXqGQ== + +turbo-darwin-arm64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.5.5.tgz#f7955a800e945ab110e8a6e23f60a2b9795296ab" + integrity sha512-Dmxr09IUy6M0nc7/xWod9galIO2DD500B75sJSkHeT+CCdJOWnlinux0ZPF8CSygNqymwYO8AO2l15/6yxcycg== + +turbo-linux-64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.5.5.tgz#f31eb117a9b605f5731048c50473bff903850047" + integrity sha512-wd07TZ4zXXWjzZE00FcFMLmkybQQK/NV9ff66vvAV0vdiuacSMBCNLrD6Mm4ncfrUPW/rwFW5kU/7hyuEqqtDw== + +turbo-linux-arm64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.5.5.tgz#b9ce6912ae6477e829355d6f012500bfef58669d" + integrity sha512-q3q33tuo74R7gicnfvFbnZZvqmlq7Vakcvx0eshifnJw4PR+oMnTCb4w8ElVFx070zsb8DVTibq99y8NJH8T1Q== + +turbo-windows-64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.5.5.tgz#609098de3bc6178f733615d21b06d5c1602637eb" + integrity sha512-lPp9kHonNFfqgovbaW+UAPO5cLmoAN+m3G3FzqcrRPnlzt97vXYsDhDd/4Zy3oAKoAcprtP4CGy0ddisqsKTVw== + +turbo-windows-arm64@1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.5.5.tgz#60522e1e347a54c64bdddb68089fc322ee19c3d7" + integrity sha512-3AfGULKNZiZVrEzsIE+W79ZRW1+f5r4nM4wLlJ1PTBHyRxBZdD6KTH1tijGfy/uTlcV5acYnKHEkDc6Q9PAXGQ== + +turbo@^1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.5.5.tgz#9fc3a917c914ffa113c260a4eadb4bc632eee227" + integrity sha512-PVQSDl0STC9WXIyHcYUWs9gXsf8JjQig/FuHfuB8N6+XlgCGB3mPbfMEE6zrChGz2hufH4/guKRX1XJuNL6XTA== + optionalDependencies: + turbo-darwin-64 "1.5.5" + turbo-darwin-arm64 "1.5.5" + turbo-linux-64 "1.5.5" + turbo-linux-arm64 "1.5.5" + turbo-windows-64 "1.5.5" + turbo-windows-arm64 "1.5.5" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From 07fcbeb56869afc62b6ed12717c7c84491a95f9e Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 17:28:43 +0400 Subject: [PATCH 03/16] more turbo; rewrite and simplify github CI --- .github/workflows/ci.yml | 224 ++-------------------------- package.json | 4 +- packages/cli/package.json | 4 +- packages/squiggle-lang/package.json | 10 +- turbo.json | 7 +- 5 files changed, 31 insertions(+), 218 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70f41327..efd1cc24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Squiggle packages check +name: Squiggle packages checks on: push: @@ -9,217 +9,23 @@ on: branches: - master - develop - - reducer-dev - - epic-reducer-project - - epic-0.5.0 + +env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: quantified-uncertainty jobs: - pre_check: - name: Precheck for skipping redundant jobs + build-check-coverage: + name: Build, check, coverage runs-on: ubuntu-latest - outputs: - should_skip_lang: ${{ steps.skip_lang_check.outputs.should_skip }} - should_skip_components: ${{ steps.skip_components_check.outputs.should_skip }} - should_skip_website: ${{ steps.skip_website_check.outputs.should_skip }} - should_skip_vscodeext: ${{ steps.skip_vscodeext_check.outputs.should_skip }} - should_skip_cli: ${{ steps.skip_cli_check.outputs.should_skip }} - steps: - - id: skip_lang_check - name: Check if the changes are about squiggle-lang src files - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - paths: '["packages/squiggle-lang/**"]' - - id: skip_components_check - name: Check if the changes are about components src files - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - paths: '["packages/components/**"]' - - id: skip_website_check - name: Check if the changes are about website src files - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - paths: '["packages/website/**"]' - - id: skip_vscodeext_check - name: Check if the changes are about vscode extension src files - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - paths: '["packages/vscode-ext/**"]' - - id: skip_cli_check - name: Check if the changes are about cli src files - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - paths: '["packages/cli/**"]' - - lang-lint: - name: Language lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/squiggle-lang steps: - uses: actions/checkout@v3 - - name: Install Dependencies - run: cd ../../ && yarn - - name: Check rescript lint - run: yarn lint:rescript - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 + - name: Setup Node.js environment + uses: actions/setup-node@v2 with: - dry: true - prettier_options: --check packages/squiggle-lang - - lang-build-test-bundle: - name: Language build, test, and bundle - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/squiggle-lang - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build rescript codebase - run: yarn build - - name: Run rescript tests - run: yarn test:rescript - - name: Run typescript tests - run: yarn test:ts - - name: Run webpack - run: yarn bundle - - name: Upload rescript coverage report - run: yarn coverage:rescript:ci - - name: Upload typescript coverage report - run: yarn coverage:ts:ci - - components-lint: - name: Components lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/components - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/components --ignore-path packages/components/.prettierignore - - components-bundle-build-test: - name: Components bundle, build and test - runs-on: ubuntu-latest - needs: pre_check - if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} - defaults: - run: - shell: bash - working-directory: packages/components - steps: - - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build rescript codebase in squiggle-lang - run: cd ../squiggle-lang && yarn build - - name: Run webpack - run: yarn bundle - - name: Build storybook - run: yarn build - - name: Test components - run: yarn test - - website-lint: - name: Website lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/website - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/website - - website-build: - name: Website build - runs-on: ubuntu-latest - needs: pre_check - if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} - defaults: - run: - shell: bash - working-directory: packages/website - steps: - - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build rescript in squiggle-lang - run: cd ../squiggle-lang && yarn build - - name: Build components - run: cd ../components && yarn build - - name: Build website assets - run: yarn build - - vscode-ext-lint: - name: VS Code extension lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/vscode-ext - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/vscode-ext - - vscode-ext-build: - name: VS Code extension build - runs-on: ubuntu-latest - needs: pre_check - if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} || (needs.pre_check.outputs.should_skip_vscodeext != 'true') }} - defaults: - run: - shell: bash - working-directory: packages/vscode-ext - steps: - - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build - run: yarn compile - cli-lint: - name: CLI lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/cli - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/cli + node-version: 16 + cache: 'yarn' + - name: Turbo run + run: turbo run build test lint bundle + - name: Coverage + run: turbo run coverage --no-cache # coverage builds for squiggle-lang can generate slower code that should never be cached diff --git a/package.json b/package.json index 2db44f0c..f1241ebe 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,7 @@ "private": true, "name": "squiggle", "scripts": { - "nodeclean": "rm -r node_modules && rm -r packages/*/node_modules", - "format:all": "prettier --write . && cd packages/squiggle-lang && yarn format", - "lint:all": "prettier --check . && cd packages/squiggle-lang && yarn lint:rescript" + "nodeclean": "rm -r node_modules && rm -r packages/*/node_modules" }, "devDependencies": { "prettier": "^2.7.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index dca34532..92a088f0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -7,7 +7,9 @@ "bin": "index.js", "type": "module", "scripts": { - "start": "node ." + "start": "node .", + "lint": "prettier --check .", + "format": "prettier --write ." }, "license": "MIT", "dependencies": { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 13058dfb..497b803c 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -22,10 +22,12 @@ "test:rescript": "jest --modulePathIgnorePatterns=__tests__/TS/*", "test:watch": "jest --watchAll", "test:fnRegistry": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", - "coverage:rescript": "rm -f *.coverage && yarn clean && BISECT_ENABLE=yes yarn build && yarn test:rescript && bisect-ppx-report html", - "coverage:ts": "yarn clean && yarn build && nyc --reporter=lcov yarn test:ts", - "coverage:rescript:ci": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", - "coverage:ts:ci": "yarn coverage:ts && codecov", + "coverage:rescript:local": "rm -f *.coverage && yarn clean && BISECT_ENABLE=yes yarn build && yarn test:rescript && bisect-ppx-report html", + "coverage:ts:local": "yarn clean && yarn build && nyc --reporter=lcov yarn test:ts", + "coverage:rescript": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", + "coverage:ts": "yarn coverage:ts && codecov", + "coverage": "yarn coverage:rescript && yarn coverage:ts", + "coverage:local": "yarn coverage:rescript:local && yarn coverage:ts:local", "lint:rescript": "./lint.sh", "lint:prettier": "prettier --check .", "lint": "yarn lint:rescript && yarn lint:prettier", diff --git a/turbo.json b/turbo.json index 3417e170..a7dabfa3 100644 --- a/turbo.json +++ b/turbo.json @@ -2,14 +2,19 @@ "$schema": "https://turborepo.org/schema.json", "pipeline": { "lint": {}, + "format": {}, "build": { "dependsOn": ["^build"] }, "test": { "dependsOn": ["build"] }, + "bundle": { + "dependsOn": ["^build", "build"] + }, "vscode-ext#build": { "dependsOn": ["^build", "@quri/squiggle-components#bundle"] - } + }, + "coverage": {} } } From 7493f2e2e5f3811462f5d5ef6af4d1ea91324a2c Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 17:41:58 +0400 Subject: [PATCH 04/16] update vercel configs to use turbo --- packages/components/vercel.json | 6 ++---- packages/website/vercel.json | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/components/vercel.json b/packages/components/vercel.json index 71e5c36c..65397eb3 100644 --- a/packages/components/vercel.json +++ b/packages/components/vercel.json @@ -1,6 +1,4 @@ { - "buildCommand": "cd ../squiggle-lang && yarn build && cd ../components && yarn build", - "outputDirectory": "storybook-static", - "installCommand": "cd ../../ && yarn", - "ignoreCommand": "git diff --quiet $VERCEL_GIT_PREVIOUS_SHA $VERCEL_GIT_COMMIT_SHA . ../squiggle-lang" + "buildCommand": "cd ../.. && npx turbo run build --filter=@quri/squiggle-components", + "outputDirectory": "storybook-static" } diff --git a/packages/website/vercel.json b/packages/website/vercel.json index 4efc99fd..3e208976 100644 --- a/packages/website/vercel.json +++ b/packages/website/vercel.json @@ -1,6 +1,4 @@ { - "buildCommand": "cd ../squiggle-lang && yarn build && cd ../components && yarn build && cd ../website && yarn build", - "framework": "docusaurus-2", - "installCommand": "cd ../../ && yarn", - "ignoreCommand": "git diff --quiet $VERCEL_GIT_PREVIOUS_SHA $VERCEL_GIT_COMMIT_SHA ../squiggle-lang ../components ." + "buildCommand": "cd ../.. && npx turbo run build --filter=squiggle-website", + "framework": "docusaurus-2" } From d037913e7c761e8a001f4db80bd1905dff4018fa Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 17:45:59 +0400 Subject: [PATCH 05/16] npx turbo --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efd1cc24..1c1bdeea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,6 @@ jobs: node-version: 16 cache: 'yarn' - name: Turbo run - run: turbo run build test lint bundle + run: npx turbo run build test lint bundle - name: Coverage - run: turbo run coverage --no-cache # coverage builds for squiggle-lang can generate slower code that should never be cached + run: npx turbo run coverage --no-cache # coverage builds for squiggle-lang can generate slower code that should never be cached From b7d56a3f1f27d613a22cb4ebdefd71f94d9c2357 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 18:03:47 +0400 Subject: [PATCH 06/16] turbo tuning --- packages/website/package.json | 2 +- turbo.json | 4 +++- yarn.lock | 14 +------------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 2f44bb72..60e6da0b 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -15,7 +15,7 @@ "@docusaurus/core": "2.1.0", "@docusaurus/preset-classic": "2.1.0", "@heroicons/react": "^1.0.6", - "@quri/squiggle-components": "^0.5.0", + "@quri/squiggle-components": "*", "base64-js": "^1.5.1", "clsx": "^1.2.1", "hast-util-is-element": "2.1.2", diff --git a/turbo.json b/turbo.json index a7dabfa3..0cf8a315 100644 --- a/turbo.json +++ b/turbo.json @@ -15,6 +15,8 @@ "vscode-ext#build": { "dependsOn": ["^build", "@quri/squiggle-components#bundle"] }, - "coverage": {} + "coverage": { + "dependsOn": ["build"] + } } } diff --git a/yarn.lock b/yarn.lock index a7a75fd2..93972ac1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3007,18 +3007,6 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@quri/squiggle-lang@^0.2.11": - version "0.2.12" - resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" - integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== - dependencies: - "@rescript/std" "^9.1.4" - "@stdlib/stats" "^0.0.13" - jstat "^1.9.5" - lodash "^4.17.21" - mathjs "^11.0.1" - pdfast "^0.2.0" - "@react-hook/latest@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" @@ -13152,7 +13140,7 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.5" -mathjs@^11.0.1, mathjs@^11.2.1: +mathjs@^11.2.1: version "11.2.1" resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-11.2.1.tgz#725d2e769eb036214530ff532cea4a464efdc75e" integrity sha512-V5lqIPExHtFi56LUf0Gyz0wyuJmSbXUM3liZcCDNpj4OKQaUlpQuAymC8x9mFNqajWOgxqS1HZ7Z5B76Hbwrtw== From d7c6996284cd492d68553fd10f0e379cd02e0f6d Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 18:16:54 +0400 Subject: [PATCH 07/16] vscode-ext depends on old 0.2.11 lang again for parsing; more turbo tuning --- README.md | 14 +++++++++++++- packages/vscode-ext/package.json | 2 +- turbo.json | 2 +- yarn.lock | 14 +++++++++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9b80cf33..9be8b2b2 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,19 @@ For any project in the repo, begin by running `yarn` in the top level yarn ``` -See `packages/*/README.md` to work with whatever project you're interested in. +Then use `turbo` to build the specific packages or the entire monorepo: + +```sh +turbo run build +``` + +Or: + +```sh +turbo run build --filter=@quri/squiggle-components +``` + +You can also run specific npm scripts for the package you're working on. See `packages/*/README.md` for the details. # Contributing diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 325de130..cd8dbcbb 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -138,7 +138,7 @@ "vscode-languageclient": "^8.0.2", "vscode-languageserver": "^8.0.2", "vscode-languageserver-textdocument": "^1.0.7", - "@quri/squiggle-lang": "*", + "@quri/squiggle-lang": "^0.2.11", "@quri/squiggle-components": "*" } } diff --git a/turbo.json b/turbo.json index 0cf8a315..16cf2f9c 100644 --- a/turbo.json +++ b/turbo.json @@ -12,7 +12,7 @@ "bundle": { "dependsOn": ["^build", "build"] }, - "vscode-ext#build": { + "vscode-squiggle#build": { "dependsOn": ["^build", "@quri/squiggle-components#bundle"] }, "coverage": { diff --git a/yarn.lock b/yarn.lock index 93972ac1..a7a75fd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3007,6 +3007,18 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@quri/squiggle-lang@^0.2.11": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" + integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== + dependencies: + "@rescript/std" "^9.1.4" + "@stdlib/stats" "^0.0.13" + jstat "^1.9.5" + lodash "^4.17.21" + mathjs "^11.0.1" + pdfast "^0.2.0" + "@react-hook/latest@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" @@ -13140,7 +13152,7 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.5" -mathjs@^11.2.1: +mathjs@^11.0.1, mathjs@^11.2.1: version "11.2.1" resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-11.2.1.tgz#725d2e769eb036214530ff532cea4a464efdc75e" integrity sha512-V5lqIPExHtFi56LUf0Gyz0wyuJmSbXUM3liZcCDNpj4OKQaUlpQuAymC8x9mFNqajWOgxqS1HZ7Z5B76Hbwrtw== From da8db5db9cde9c6cf79e0f5fd6c589fdb9d0d93e Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 18:37:34 +0400 Subject: [PATCH 08/16] call yarn --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c1bdeea..af7b11b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: with: node-version: 16 cache: 'yarn' + - name: Install dependencies + run: yarn - name: Turbo run run: npx turbo run build test lint bundle - name: Coverage From bcc5b5846f9891a6f248fefd9f226a5f1496da52 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 19:02:31 +0400 Subject: [PATCH 09/16] list all turbo outputs for squiggle-lang --- turbo.json | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/turbo.json b/turbo.json index 16cf2f9c..c667c7cd 100644 --- a/turbo.json +++ b/turbo.json @@ -6,15 +6,25 @@ "build": { "dependsOn": ["^build"] }, + "vscode-squiggle#build": { + "dependsOn": ["^build", "@quri/squiggle-components#bundle"] + }, + "@quri/squiggle-lang#build": { + "outputs": [ + "__tests__/**/*.bs.js", + "benchmark/**/*.bs.js", + "src/rescript/**/*.js", + "src/rescript/**/*.gen.tsx", + "../../node_modules/bisect_ppx/**/*.bs.js", + "dist/**" + ] + }, "test": { "dependsOn": ["build"] }, "bundle": { "dependsOn": ["^build", "build"] }, - "vscode-squiggle#build": { - "dependsOn": ["^build", "@quri/squiggle-components#bundle"] - }, "coverage": { "dependsOn": ["build"] } From ed86fd9f779ef60cf7e5b54145c16c8d1f6e646f Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 19:13:44 +0400 Subject: [PATCH 10/16] separate job for coverage, fix infinite loop --- .github/workflows/ci.yml | 17 +++++++++++++++-- packages/squiggle-lang/package.json | 2 +- turbo.json | 4 +--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af7b11b2..ac2b131e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ env: TURBO_TEAM: quantified-uncertainty jobs: - build-check-coverage: - name: Build, check, coverage + build-test-lint: + name: Build, test, lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -29,5 +29,18 @@ jobs: run: yarn - name: Turbo run run: npx turbo run build test lint bundle + + coverage: + name: Build, check, coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'yarn' + - name: Install dependencies + run: yarn - name: Coverage run: npx turbo run coverage --no-cache # coverage builds for squiggle-lang can generate slower code that should never be cached diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 497b803c..d8d33770 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -25,7 +25,7 @@ "coverage:rescript:local": "rm -f *.coverage && yarn clean && BISECT_ENABLE=yes yarn build && yarn test:rescript && bisect-ppx-report html", "coverage:ts:local": "yarn clean && yarn build && nyc --reporter=lcov yarn test:ts", "coverage:rescript": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", - "coverage:ts": "yarn coverage:ts && codecov", + "coverage:ts": "yarn coverage:ts:local && codecov", "coverage": "yarn coverage:rescript && yarn coverage:ts", "coverage:local": "yarn coverage:rescript:local && yarn coverage:ts:local", "lint:rescript": "./lint.sh", diff --git a/turbo.json b/turbo.json index c667c7cd..04a28873 100644 --- a/turbo.json +++ b/turbo.json @@ -25,8 +25,6 @@ "bundle": { "dependsOn": ["^build", "build"] }, - "coverage": { - "dependsOn": ["build"] - } + "coverage": {} } } From 4abdb69f23834eaebe16cf280eab5ca28b72adfa Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 19:24:12 +0400 Subject: [PATCH 11/16] fix coverage? --- .github/workflows/ci.yml | 2 +- packages/squiggle-lang/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac2b131e..94a10d93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: run: npx turbo run build test lint bundle coverage: - name: Build, check, coverage + name: Coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index d8d33770..e510dfee 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -26,7 +26,7 @@ "coverage:ts:local": "yarn clean && yarn build && nyc --reporter=lcov yarn test:ts", "coverage:rescript": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", "coverage:ts": "yarn coverage:ts:local && codecov", - "coverage": "yarn coverage:rescript && yarn coverage:ts", + "coverage": "yarn coverage:ts && yarn coverage:rescript", "coverage:local": "yarn coverage:rescript:local && yarn coverage:ts:local", "lint:rescript": "./lint.sh", "lint:prettier": "prettier --check .", From 000b7a624897d8d14b81f991280f8841601fccae Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 19:46:59 +0400 Subject: [PATCH 12/16] change coverage:local order too --- packages/squiggle-lang/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index e510dfee..2ee6e92c 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -27,7 +27,7 @@ "coverage:rescript": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", "coverage:ts": "yarn coverage:ts:local && codecov", "coverage": "yarn coverage:ts && yarn coverage:rescript", - "coverage:local": "yarn coverage:rescript:local && yarn coverage:ts:local", + "coverage:local": "yarn coverage:ts:local && yarn coverage:rescript:local", "lint:rescript": "./lint.sh", "lint:prettier": "prettier --check .", "lint": "yarn lint:rescript && yarn lint:prettier", From fd6c4ae1de4b9f2f21fa0f75c8a736a36d0d6f9a Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 19:55:57 +0400 Subject: [PATCH 14/16] yarn in CI tuning --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a10d93..7f37166d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,12 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup Node.js environment - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 cache: 'yarn' - name: Install dependencies - run: yarn + run: yarn --frozen-lockfile - name: Turbo run run: npx turbo run build test lint bundle From de532c72d67298c06b95117882394f4e91bd01f2 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 21:15:37 +0400 Subject: [PATCH 15/16] custom squiggle-components outputs; never cache coverage --- .github/workflows/ci.yml | 2 +- turbo.json | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f37166d..bbb6a7ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,4 +43,4 @@ jobs: - name: Install dependencies run: yarn - name: Coverage - run: npx turbo run coverage --no-cache # coverage builds for squiggle-lang can generate slower code that should never be cached + run: npx turbo run coverage diff --git a/turbo.json b/turbo.json index 04a28873..3e4db27a 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,12 @@ "vscode-squiggle#build": { "dependsOn": ["^build", "@quri/squiggle-components#bundle"] }, + "@quri/squiggle-components#build": { + "dependsOn": ["^build"], + "outputs": ["dist/**", "storybook-static/**"] + }, "@quri/squiggle-lang#build": { + "dependsOn": ["^build"], "outputs": [ "__tests__/**/*.bs.js", "benchmark/**/*.bs.js", @@ -25,6 +30,8 @@ "bundle": { "dependsOn": ["^build", "build"] }, - "coverage": {} + "coverage": { + "cache": false + } } } From 9992d7da1a92e527e9d34ceb460e0581f5bde364 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 8 Oct 2022 21:34:31 +0400 Subject: [PATCH 16/16] empty outputs of lint and test --- turbo.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/turbo.json b/turbo.json index 3e4db27a..a8ea7384 100644 --- a/turbo.json +++ b/turbo.json @@ -1,7 +1,9 @@ { "$schema": "https://turborepo.org/schema.json", "pipeline": { - "lint": {}, + "lint": { + "outputs": [] + }, "format": {}, "build": { "dependsOn": ["^build"] @@ -25,7 +27,8 @@ ] }, "test": { - "dependsOn": ["build"] + "dependsOn": ["build"], + "outputs": [] }, "bundle": { "dependsOn": ["^build", "build"]