-
-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: bump lowest supported node version to node14.13 #1052
Conversation
CI -> I would be okay with that 🤔 |
Codecov Report
@@ Coverage Diff @@
## main #1052 +/- ##
=======================================
Coverage 99.64% 99.65%
=======================================
Files 2135 2135
Lines 229160 229160
Branches 979 983 +4
=======================================
+ Hits 228357 228378 +21
+ Misses 782 761 -21
Partials 21 21
|
I would be okay with that too. |
Await merge of #1060 |
> @faker-js/faker@7.2.0 build:code /home/runner/work/faker/faker
> esno ./scripts/bundle.ts
file:///home/runner/work/faker/faker/node_modules/.pnpm/@[email protected]/node_modules/@esbuild-kit/esm-loader/dist/index.js:1
import g from"path";import{installSourceMapSupport as w,resolveTsPath as T,transform as y,transformDynamicImport as _}from"@esbuild-kit/core-utils";import l from"get-tsconfig";import h from"fs";import{fileURLToPath as I}from"url";const p=/\.([cm]?ts|[tj]sx)$/,j=t=>{const r=g.extname(t);if(r===".mjs"||r===".mts")return"module";if(r===".cjs"||r===".cts")return"commonjs"},i=new Map;async function $(t){if(i.has(t))return i.get(t);if(!await h.promises.access(t).then(()=>!0,()=>!1)){i.set(t,void 0);return}const s=await h.promises.readFile(t,"utf8");try{const o=JSON.parse(s);return i.set(t,o),o}catch{throw new Error(`Error parsing: ${t}`)}}async function b(t){let r=new URL("package.json",t);for(;!r.pathname.endsWith("/node_modules/package.json");){const s=I(r),o=await $(s);if(o)return o;const n=r;if(r=new URL("../package.json",r),r.pathname===n.pathname)break}}async function O(t){var r;const s=await b(t);return(r=s==null?void 0:s.type)!=null?r:"commonjs"}var x=Object.defineProperty,F=Object.defineProperties,L=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,k=(t,r,s)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,P=(t,r)=>{for(var s in r||(r={}))M.call(r,s)&&k(t,s,r[s]);if(v)for(var s of v(r))A.call(r,s)&&k(t,s,r[s]);return t},E=(t,r)=>F(t,L(r));const S=w(),D=l(),V=D==null?void 0:D.config,C=[".js",".json",".ts",".tsx",".jsx"];async function U(t,r,s){let o;for(const n of C)try{return await m(t+n,r,s,!0)}catch(e){if(o===void 0){const{message:a}=e;e.message=e.message.replace(`${n}'`,"'"),e.stack=e.stack.replace(a,e.message),o=e}}throw o}async function J(t,r,s){const o=t.endsWith("/")?"index":`${g.sep}index`;try{return await U(t+o,r,s)}catch(n){const{message:e}=n;throw n.message=n.message.replace(`${o}'`,"'"),n.stack=n.stack.replace(e,n.message),n}}const m=async function(t,r,s,o){var n;if(t.startsWith("node:")&&(t=t.slice(5)),t.endsWith("/"))return await J(t,r,s);if(p.test(r.parentURL)){const c=T(t);if(c)try{return await m(c,r,s,!0)}catch(u){if(u.code!=="ERR_MODULE_NOT_FOUND")throw u}}let e;try{e=await s(t,r,s)}catch(c){if(c instanceof Error&&!o){if(c.code==="ERR_UNSUPPORTED_DIR_IMPORT")return await J(t,r,s);if(c.code==="ERR_MODULE_NOT_FOUND")return await U(t,r,s)}throw c}if(e.url.endsWith(".json"))return E(P({},e),{format:"json"});let{format:a}=e;return e.url.startsWith("file:")&&(a=(n=j(e.url))!=null?n:a,a||(a=await O(e.url))),E(P({},e),{format:a})},q=async function(t,r,s){process.send&&process.send({type:"dependency",path:t}),t.endsWith(".json")&&(r.importAssertions||(r.importAssertions={}),r.importAssertions.type="json");const o=await s(t,r,s);if(!o.source)return o;const n=o.source.toString();if(o.format==="json"||p.test(t)){const a=await y(n,t,{format:"esm",tsconfigRaw:V});return a.map&&S.set(t,a.map),{format:"module",source:a.code}}const e=_({code:n});return e&&(o.source=e.code,e.map&&S.set(t,e.map)),o},R=l(),z=R==null?void 0:R.config,W=w(),B=async function(t,r,s){var o;return t.endsWith(".json")?{format:"module"}:t.startsWith("file:")?{format:(o=j(t))!=null?o:await O(t)}:await s(t,r,s)},H=async function(t,r,s){const{url:o}=r;if(process.send&&process.send({type:"dependency",path:o}),o.endsWith(".json")||p.test(o)){const a=await y(t.toString(),o,{format:"esm",tsconfigRaw:z});return a.map&&W.set(o,a.map),{source:a.code}}const n=await s(t,r,s),e=_({code:n.source.toString()});return e&&(n.source=e.code,e.map&&W.set(o,e.map)),n},f=[[16](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:17),12,0],d=process.version.slice(1).split(".").map(Number),N=(d[0]-f[0]||d[1]-f[1]||d[2]-f[2])<0,K=N?B:void 0,Q=N?H:void 0;export{K as getFormat,q as load,m as resolve,Q as transformSource};
^^^^^^^^^^^^^
SyntaxError: The requested module '@esbuild-kit/core-utils' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from '@esbuild-kit/core-utils';
const {installSourceMapSupport: w,resolveTsPath: T,transform: y,transformDynamicImport: _}from"@esbuild-kit/core-utils";import l from"get-tsconfig";import h from"fs";import{fileURLToPath: I}from"url";const p=/\.([cm]?ts|[tj]sx)$/,j=t=>{const r=g.extname(t);if(r===".mjs"||r===".mts")return"module";if(r===".cjs"||r===".cts")return"commonjs"},i=new Map;async function $(t){if(i.has(t))return i.get(t);if(!await h.promises.access(t).then(()=>!0,()=>!1)){i.set(t,void 0);return}const s=await h.promises.readFile(t,"utf8");try{const o=JSON.parse(s);return i.set(t,o),o}catch{throw new Error(`Error parsing: ${t}`)}}async function b(t){let r=new URL("package.json",t);for(;!r.pathname.endsWith("/node_modules/package.json");){const s=I(r),o=await $(s);if(o)return o;const n=r;if(r=new URL("../package.json",r),r.pathname===n.pathname)break}}async function O(t){var r;const s=await b(t);return(r=s==null?void 0:s.type)!=null?r:"commonjs"}var x=Object.defineProperty,F=Object.defineProperties,L=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,k=(t,r,s)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,P=(t,r)=>{for(var s in r||(r={}))M.call(r,s)&&k(t,s,r[s]);if(v)for(var s of v(r))A.call(r,s)&&k(t,s,r[s]);return t},E=(t,r)=>F(t,L(r));const S=w(),D=l(),V=D==null?void 0:D.config,C=[".js",".json",".ts",".tsx",".jsx"];async function U(t,r,s){let o;for(const n of C)try{return await m(t+n,r,s,!0)}catch(e){if(o===void 0){const{message:a}=e;e.message=e.message.replace(`${n}'`,"'"),e.stack=e.stack.replace(a,e.message),o=e}}throw o}async function J(t,r,s){const o=t.endsWith("/")?"index":`${g.sep}index`;try{return await U(t+o,r,s)}catch(n){const{message:e}=n;throw n.message=n.message.replace(`${o}'`,"'"),n.stack=n.stack.replace(e,n.message),n}}const m=async function(t,r,s,o){var n;if(t.startsWith("node:")&&(t=t.slice(5)),t.endsWith("/"))return await J(t,r,s);if(p.test(r.parentURL)){const c=T(t);if(c)try{return await m(c,r,s,!0)}catch(u){if(u.code!=="ERR_MODULE_NOT_FOUND")throw u}}let e;try{e=await s(t,r,s)}catch(c){if(c instanceof Error&&!o){if(c.code==="ERR_UNSUPPORTED_DIR_IMPORT")return await J(t,r,s);if(c.code==="ERR_MODULE_NOT_FOUND")return await U(t,r,s)}throw c}if(e.url.endsWith(".json"))return E(P({},e),{format:"json"});let{format:a}=e;return e.url.startsWith("file:")&&(a=(n=j(e.url))!=null?n:a,a||(a=await O(e.url))),E(P({},e),{format:a})},q=async function(t,r,s){process.send&&process.send({type:"dependency",path:t}),t.endsWith(".json")&&(r.importAssertions||(r.importAssertions={}),r.importAssertions.type="json");const o=await s(t,r,s);if(!o.source)return o;const n=o.source.toString();if(o.format==="json"||p.test(t)){const a=await y(n,t,{format:"esm",tsconfigRaw:V});return a.map&&S.set(t,a.map),{format:"module",source:a.code}}const e=_({code:n});return e&&(o.source=e.code,e.map&&S.set(t,e.map)),o},R=l(),z=R==null?void 0:R.config,W=w(),B=async function(t,r,s){var o;return t.endsWith(".json")?{format:"module"}:t.startsWith("file:")?{format:(o=j(t))!=null?o:await O(t)}:await s(t,r,s)},H=async function(t,r,s){const{url:o}=r;if(process.send&&process.send({type:"dependency",path:o}),o.endsWith(".json")||p.test(o)){const a=await y(t.toString(),o,{format:"esm",tsconfigRaw:z});return a.map&&W.set(o,a.map),{source:a.code}}const n=await s(t,r,s),e=_({code:n.source.toString()});return e&&(n.source=e.code,e.map&&W.set(o,e.map)),n},f=[16,12,0],d=process.version.slice(1).split(".").map(Number),N=(d[0]-f[0]||d[1]-f[1]||d[2]-f[2])<0,K=N?B:void 0,Q=N?H:void 0;export{K: getFormat,q: load,m: resolve,Q: transformSource} = pkg;
at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:[21](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:22))
at async ModuleJob.run (internal/modules/esm/module_job.js:137:5)
at async Loader.import (internal/modules/esm/loader.js:162:[24](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:25))
at async internal/process/esm_loader.js:57:9
at async Object.loadESM (internal/process/esm_loader.js:67:5)
ELIFECYCLE Command failed with exit code 1.
ERROR: "build:code" exited with 1. |
We probably have to take this into consideration when releasing. |
Yes, I need to find out what's going on here and if we need to up our supported node version or something else |
bcc6e34
to
a06add5
Compare
superseded by |
This bumps the target to the lowest supported target
https://esbuild.github.io/api/#target
It could be that this doesn't change anything, but we are more safe with that