Unverified Commit 24f573f8 authored by Balázs Orbán's avatar Balázs Orbán Committed by GitHub

chore: make sure polyfills are built for `pnpm dev` (#40335)

Utilize `turbo` for `dev`, and make sure polyfills are built. Fixes #40334

Another option would be to document that an initial `pnpm build` is necessary in  [`CONTRIBUTING.md`](https://github.com/vercel/next.js/blob/canary/contributing.md#developing).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
parent 73b47399
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"clean": "pnpm lerna clean -y && pnpm lerna bootstrap && pnpm lerna exec 'rm -rf ./dist'", "clean": "pnpm lerna clean -y && pnpm lerna bootstrap && pnpm lerna exec 'rm -rf ./dist'",
"build": "turbo run build", "build": "turbo run build",
"lerna": "lerna", "lerna": "lerna",
"dev": "lerna run dev --stream --parallel", "dev": "turbo run dev --parallel",
"test-types": "pnpm tsc", "test-types": "pnpm tsc",
"test-unit": "pnpm jest test/unit/", "test-unit": "pnpm jest test/unit/",
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless", "test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"genstats": "cross-env LOCAL_STATS=true node .github/actions/next-stats-action/src/index.js", "genstats": "cross-env LOCAL_STATS=true node .github/actions/next-stats-action/src/index.js",
"git-reset": "git reset --hard HEAD", "git-reset": "git reset --hard HEAD",
"git-clean": "git clean -d -x -e node_modules -e packages -f", "git-clean": "git clean -d -x -e node_modules -e packages -f",
"lint-typescript": "lerna run typescript", "lint-typescript": "turbo run typescript",
"lint-eslint": "eslint . --ext js,jsx,ts,tsx --max-warnings=0 --config .eslintrc.json --no-eslintrc", "lint-eslint": "eslint . --ext js,jsx,ts,tsx --max-warnings=0 --config .eslintrc.json --no-eslintrc",
"lint-no-typescript": "run-p prettier-check lint-eslint", "lint-no-typescript": "run-p prettier-check lint-eslint",
"lint": "run-p test-types lint-typescript prettier-check lint-eslint lint-language", "lint": "run-p test-types lint-typescript prettier-check lint-eslint lint-language",
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
}, },
"scripts": { "scripts": {
"build": "microbundle -i src/index.js -o dist/polyfill-module.js -f iife --no-sourcemap --external none --no-pkg-main", "build": "microbundle -i src/index.js -o dist/polyfill-module.js -f iife --no-sourcemap --external none --no-pkg-main",
"dev": "pnpm build",
"prepublishOnly": "cd ../../ && turbo run build" "prepublishOnly": "cd ../../ && turbo run build"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
}, },
"scripts": { "scripts": {
"build": "microbundle -i src/index.js -o dist/polyfill-nomodule.js -f iife --no-sourcemap --external none --no-pkg-main", "build": "microbundle -i src/index.js -o dist/polyfill-nomodule.js -f iife --no-sourcemap --external none --no-pkg-main",
"dev": "pnpm build",
"prepublishOnly": "cd ../../ && turbo run build" "prepublishOnly": "cd ../../ && turbo run build"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -120,11 +120,11 @@ ...@@ -120,11 +120,11 @@
"@hapi/accept": "5.0.2", "@hapi/accept": "5.0.2",
"@napi-rs/cli": "2.7.0", "@napi-rs/cli": "2.7.0",
"@napi-rs/triples": "1.1.0", "@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "12.3.2-canary.15", "@next/polyfill-module": "workspace:*",
"@next/polyfill-nomodule": "12.3.2-canary.15", "@next/polyfill-nomodule": "workspace:*",
"@next/react-dev-overlay": "12.3.2-canary.15", "@next/react-dev-overlay": "workspace:*",
"@next/react-refresh-utils": "12.3.2-canary.15", "@next/react-refresh-utils": "workspace:*",
"@next/swc": "12.3.2-canary.15", "@next/swc": "workspace:*",
"@segment/ajv-human-errors": "2.1.2", "@segment/ajv-human-errors": "2.1.2",
"@taskr/clear": "1.1.0", "@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0", "@taskr/esnext": "1.1.0",
......
...@@ -457,11 +457,11 @@ importers: ...@@ -457,11 +457,11 @@ importers:
'@napi-rs/cli': 2.7.0 '@napi-rs/cli': 2.7.0
'@napi-rs/triples': 1.1.0 '@napi-rs/triples': 1.1.0
'@next/env': 12.3.2-canary.15 '@next/env': 12.3.2-canary.15
'@next/polyfill-module': 12.3.2-canary.15 '@next/polyfill-module': workspace:*
'@next/polyfill-nomodule': 12.3.2-canary.15 '@next/polyfill-nomodule': workspace:*
'@next/react-dev-overlay': 12.3.2-canary.15 '@next/react-dev-overlay': workspace:*
'@next/react-refresh-utils': 12.3.2-canary.15 '@next/react-refresh-utils': workspace:*
'@next/swc': 12.3.2-canary.15 '@next/swc': workspace:*
'@segment/ajv-human-errors': 2.1.2 '@segment/ajv-human-errors': 2.1.2
'@swc/helpers': 0.4.11 '@swc/helpers': 0.4.11
'@taskr/clear': 1.1.0 '@taskr/clear': 1.1.0
...@@ -594,8 +594,8 @@ importers: ...@@ -594,8 +594,8 @@ importers:
source-map: 0.6.1 source-map: 0.6.1
stream-browserify: 3.0.0 stream-browserify: 3.0.0
stream-http: 3.1.1 stream-http: 3.1.1
string-hash: 1.1.3
string_decoder: 1.3.0 string_decoder: 1.3.0
string-hash: 1.1.3
strip-ansi: 6.0.0 strip-ansi: 6.0.0
styled-jsx: 5.0.7 styled-jsx: 5.0.7
tar: 6.1.11 tar: 6.1.11
...@@ -784,8 +784,8 @@ importers: ...@@ -784,8 +784,8 @@ importers:
source-map: 0.6.1 source-map: 0.6.1
stream-browserify: 3.0.0 stream-browserify: 3.0.0
stream-http: 3.1.1 stream-http: 3.1.1
string-hash: 1.1.3
string_decoder: 1.3.0 string_decoder: 1.3.0
string-hash: 1.1.3
strip-ansi: 6.0.0 strip-ansi: 6.0.0
tar: 6.1.11 tar: 6.1.11
taskr: 1.1.0 taskr: 1.1.0
...@@ -11618,8 +11618,8 @@ packages: ...@@ -11618,8 +11618,8 @@ packages:
engines: { node: '>=10' } engines: { node: '>=10' }
hasBin: true hasBin: true
dependencies: dependencies:
JSONStream: 1.3.5
is-text-path: 1.0.1 is-text-path: 1.0.1
JSONStream: 1.3.5
lodash: 4.17.21 lodash: 4.17.21
meow: 8.1.2 meow: 8.1.2
split2: 2.2.0 split2: 2.2.0
...@@ -27102,7 +27102,6 @@ packages: ...@@ -27102,7 +27102,6 @@ packages:
{ {
integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==,
} }
dev: true
/simple-swizzle/0.2.2: /simple-swizzle/0.2.2:
resolution: resolution:
......
{ {
"$schema": "https://turborepo.org/schema.json",
"pipeline": { "pipeline": {
"build-native": { "build-native": {
"dependsOn": ["^build-native"], "dependsOn": ["^build-native"],
...@@ -15,6 +16,11 @@ ...@@ -15,6 +16,11 @@
"build": { "build": {
"dependsOn": ["^build"], "dependsOn": ["^build"],
"outputs": ["dist/**"] "outputs": ["dist/**"]
} },
"dev": {
"dependsOn": ["^dev"],
"outputs": ["dist/**"]
},
"typescript": {}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment