From 35a9df0353e5e8c6f907a27dbf18c459acb06eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 31 Aug 2022 16:24:39 -0400 Subject: [PATCH] ship @babel/standalone source maps (#14863) Co-authored-by: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> --- .circleci/config.yml | 10 +++++++++- .gitignore | 1 + Makefile.js | 2 +- Makefile.source.mjs | 1 + packages/babel-standalone/package.json | 4 +++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 054f7c8ede3d..4730643cd10f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,9 +12,15 @@ aliases: - &artifact_babel path: ~/babel/packages/babel-standalone/babel.js + - &artifact_babel_sourcemap + path: ~/babel/packages/babel-standalone/babel.js.map + - &artifact_babel_min path: ~/babel/packages/babel-standalone/babel.min.js + - &artifact_babel_min_sourcemap + path: ~/babel/packages/babel-standalone/babel.min.js.map + - &test262_workdir working_directory: ~/babel/babel-test262-runner @@ -41,12 +47,14 @@ jobs: - restore_cache: *restore-yarn-cache # Builds babel-standalone with the regular Babel config # test-ci-coverage doesn't test babel-standalone, as trying to gather coverage - - run: IS_PUBLISH=true make -j build-standalone-ci + - run: NODE_ENV=production IS_PUBLISH=true make -j build-standalone-ci # data for a JS file that's several megabytes large is bound to fail. Here, # we just run the babel-standalone test separately. - run: yarn jest "\-standalone/test" - store_artifacts: *artifact_babel + - store_artifacts: *artifact_babel_sourcemap - store_artifacts: *artifact_babel_min + - store_artifacts: *artifact_babel_min_sourcemap - save_cache: *save-yarn-cache test262: diff --git a/.gitignore b/.gitignore index 1cd7d922e944..58237d01e74e 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ package-lock.json packages/babel-standalone/babel.js packages/babel-standalone/babel.js.map packages/babel-standalone/babel.min.js +packages/babel-standalone/babel.min.js.map /codemods/*/lib /packages/babel-parser/build .idea/ diff --git a/Makefile.js b/Makefile.js index d23885adb6ca..0fe98372949d 100644 --- a/Makefile.js +++ b/Makefile.js @@ -1,3 +1,3 @@ /* eslint-disable */ // prettier-ignore -"use strict";var e=require("os"),t=require("fs"),r=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),l=c(r),f=c(n),p=c(i),h=c(o),d=c(s),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},y=function(e){return e&&e.Math==Math&&e},g=y("object"==typeof globalThis&&globalThis)||y("object"==typeof window&&window)||y("object"==typeof self&&self)||y("object"==typeof v&&v)||function(){return this}()||Function("return this")(),m={},b=function(e){try{return!!e()}catch(e){return!0}},w=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),E=!b((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),S=E,x=Function.prototype.call,O=S?x.bind(x):function(){return x.apply(x,arguments)},k={},j={}.propertyIsEnumerable,_=Object.getOwnPropertyDescriptor,A=_&&!j.call({1:2},1);k.f=A?function(e){var t=_(this,e);return!!t&&t.enumerable}:j;var R,I,F=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},L=E,P=Function.prototype,T=P.bind,D=P.call,C=L&&T.bind(D,D),N=L?function(e){return e&&C(e)}:function(e){return e&&function(){return D.apply(e,arguments)}},M=N,G=M({}.toString),$=M("".slice),B=function(e){return $(G(e),8,-1)},U=b,W=B,q=Object,z=N("".split),X=U((function(){return!q("z").propertyIsEnumerable(0)}))?function(e){return"String"==W(e)?z(e,""):q(e)}:q,V=TypeError,Y=function(e){if(null==e)throw V("Can't call method on "+e);return e},K=X,H=Y,Q=function(e){return K(H(e))},J=function(e){return"function"==typeof e},Z=J,ee=function(e){return"object"==typeof e?null!==e:Z(e)},te=g,re=J,ne=function(e){return re(e)?e:void 0},ie=function(e,t){return arguments.length<2?ne(te[e]):te[e]&&te[e][t]},oe=N({}.isPrototypeOf),se=ie("navigator","userAgent")||"",ce=g,ae=se,ue=ce.process,le=ce.Deno,fe=ue&&ue.versions||le&&le.version,pe=fe&&fe.v8;pe&&(I=(R=pe.split("."))[0]>0&&R[0]<4?1:+(R[0]+R[1])),!I&&ae&&(!(R=ae.match(/Edge\/(\d+)/))||R[1]>=74)&&(R=ae.match(/Chrome\/(\d+)/))&&(I=+R[1]);var he=I,de=he,ve=b,ye=!!Object.getOwnPropertySymbols&&!ve((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&de&&de<41})),ge=ye&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,me=ie,be=J,we=oe,Ee=Object,Se=ge?function(e){return"symbol"==typeof e}:function(e){var t=me("Symbol");return be(t)&&we(t.prototype,Ee(e))},xe=String,Oe=function(e){try{return xe(e)}catch(e){return"Object"}},ke=J,je=Oe,_e=TypeError,Ae=function(e){if(ke(e))return e;throw _e(je(e)+" is not a function")},Re=Ae,Ie=function(e,t){var r=e[t];return null==r?void 0:Re(r)},Fe=O,Le=J,Pe=ee,Te=TypeError,De={exports:{}},Ce=g,Ne=Object.defineProperty,Me=function(e,t){try{Ne(Ce,e,{value:t,configurable:!0,writable:!0})}catch(r){Ce[e]=t}return t},Ge=Me,$e=g["__core-js_shared__"]||Ge("__core-js_shared__",{}),Be=$e;(De.exports=function(e,t){return Be[e]||(Be[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"});var Ue=Y,We=Object,qe=function(e){return We(Ue(e))},ze=qe,Xe=N({}.hasOwnProperty),Ve=Object.hasOwn||function(e,t){return Xe(ze(e),t)},Ye=N,Ke=0,He=Math.random(),Qe=Ye(1..toString),Je=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Qe(++Ke+He,36)},Ze=g,et=De.exports,tt=Ve,rt=Je,nt=ye,it=ge,ot=et("wks"),st=Ze.Symbol,ct=st&&st.for,at=it?st:st&&st.withoutSetter||rt,ut=function(e){if(!tt(ot,e)||!nt&&"string"!=typeof ot[e]){var t="Symbol."+e;nt&&tt(st,e)?ot[e]=st[e]:ot[e]=it&&ct?ct(t):at(t)}return ot[e]},lt=O,ft=ee,pt=Se,ht=Ie,dt=function(e,t){var r,n;if("string"===t&&Le(r=e.toString)&&!Pe(n=Fe(r,e)))return n;if(Le(r=e.valueOf)&&!Pe(n=Fe(r,e)))return n;if("string"!==t&&Le(r=e.toString)&&!Pe(n=Fe(r,e)))return n;throw Te("Can't convert object to primitive value")},vt=TypeError,yt=ut("toPrimitive"),gt=function(e,t){if(!ft(e)||pt(e))return e;var r,n=ht(e,yt);if(n){if(void 0===t&&(t="default"),r=lt(n,e,t),!ft(r)||pt(r))return r;throw vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),dt(e,t)},mt=Se,bt=function(e){var t=gt(e,"string");return mt(t)?t:t+""},wt=ee,Et=g.document,St=wt(Et)&&wt(Et.createElement),xt=function(e){return St?Et.createElement(e):{}},Ot=xt,kt=!w&&!b((function(){return 7!=Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),jt=w,_t=O,At=k,Rt=F,It=Q,Ft=bt,Lt=Ve,Pt=kt,Tt=Object.getOwnPropertyDescriptor;m.f=jt?Tt:function(e,t){if(e=It(e),t=Ft(t),Pt)try{return Tt(e,t)}catch(e){}if(Lt(e,t))return Rt(!_t(At.f,e,t),e[t])};var Dt={},Ct=w&&b((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Nt=ee,Mt=String,Gt=TypeError,$t=function(e){if(Nt(e))return e;throw Gt(Mt(e)+" is not an object")},Bt=w,Ut=kt,Wt=Ct,qt=$t,zt=bt,Xt=TypeError,Vt=Object.defineProperty,Yt=Object.getOwnPropertyDescriptor;Dt.f=Bt?Wt?function(e,t,r){if(qt(e),t=zt(t),qt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=Yt(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Vt(e,t,r)}:Vt:function(e,t,r){if(qt(e),t=zt(t),qt(r),Ut)try{return Vt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Xt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Kt=Dt,Ht=F,Qt=w?function(e,t,r){return Kt.f(e,t,Ht(1,r))}:function(e,t,r){return e[t]=r,e},Jt={exports:{}},Zt=w,er=Ve,tr=Function.prototype,rr=Zt&&Object.getOwnPropertyDescriptor,nr=er(tr,"name"),ir={EXISTS:nr,PROPER:nr&&"something"===function(){}.name,CONFIGURABLE:nr&&(!Zt||Zt&&rr(tr,"name").configurable)},or=J,sr=$e,cr=N(Function.toString);or(sr.inspectSource)||(sr.inspectSource=function(e){return cr(e)});var ar,ur,lr,fr=sr.inspectSource,pr=J,hr=fr,dr=g.WeakMap,vr=pr(dr)&&/native code/.test(hr(dr)),yr=De.exports,gr=Je,mr=yr("keys"),br=function(e){return mr[e]||(mr[e]=gr(e))},wr={},Er=vr,Sr=g,xr=N,Or=ee,kr=Qt,jr=Ve,_r=$e,Ar=br,Rr=wr,Ir=Sr.TypeError,Fr=Sr.WeakMap;if(Er||_r.state){var Lr=_r.state||(_r.state=new Fr),Pr=xr(Lr.get),Tr=xr(Lr.has),Dr=xr(Lr.set);ar=function(e,t){if(Tr(Lr,e))throw new Ir("Object already initialized");return t.facade=e,Dr(Lr,e,t),t},ur=function(e){return Pr(Lr,e)||{}},lr=function(e){return Tr(Lr,e)}}else{var Cr=Ar("state");Rr[Cr]=!0,ar=function(e,t){if(jr(e,Cr))throw new Ir("Object already initialized");return t.facade=e,kr(e,Cr,t),t},ur=function(e){return jr(e,Cr)?e[Cr]:{}},lr=function(e){return jr(e,Cr)}}var Nr={set:ar,get:ur,has:lr,enforce:function(e){return lr(e)?ur(e):ar(e,{})},getterFor:function(e){return function(t){var r;if(!Or(t)||(r=ur(t)).type!==e)throw Ir("Incompatible receiver, "+e+" required");return r}}},Mr=b,Gr=J,$r=Ve,Br=w,Ur=ir.CONFIGURABLE,Wr=fr,qr=Nr.enforce,zr=Nr.get,Xr=Object.defineProperty,Vr=Br&&!Mr((function(){return 8!==Xr((function(){}),"length",{value:8}).length})),Yr=String(String).split("String"),Kr=Jt.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!$r(e,"name")||Ur&&e.name!==t)&&(Br?Xr(e,"name",{value:t,configurable:!0}):e.name=t),Vr&&r&&$r(r,"arity")&&e.length!==r.arity&&Xr(e,"length",{value:r.arity});try{r&&$r(r,"constructor")&&r.constructor?Br&&Xr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=qr(e);return $r(n,"source")||(n.source=Yr.join("string"==typeof t?t:"")),e};Function.prototype.toString=Kr((function(){return Gr(this)&&zr(this).source||Wr(this)}),"toString");var Hr=J,Qr=Dt,Jr=Jt.exports,Zr=Me,en=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(Hr(r)&&Jr(r,o,n),n.global)i?e[t]=r:Zr(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Qr.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},tn={},rn=Math.ceil,nn=Math.floor,on=Math.trunc||function(e){var t=+e;return(t>0?nn:rn)(t)},sn=function(e){var t=+e;return t!=t||0===t?0:on(t)},cn=sn,an=Math.max,un=Math.min,ln=function(e,t){var r=cn(e);return r<0?an(r+t,0):un(r,t)},fn=sn,pn=Math.min,hn=function(e){return e>0?pn(fn(e),9007199254740991):0},dn=hn,vn=function(e){return dn(e.length)},yn=Q,gn=ln,mn=vn,bn=function(e){return function(t,r,n){var i,o=yn(t),s=mn(o),c=gn(n,s);if(e&&r!=r){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===r)return e||c||0;return!e&&-1}},wn={includes:bn(!0),indexOf:bn(!1)},En=Ve,Sn=Q,xn=wn.indexOf,On=wr,kn=N([].push),jn=function(e,t){var r,n=Sn(e),i=0,o=[];for(r in n)!En(On,r)&&En(n,r)&&kn(o,r);for(;t.length>i;)En(n,r=t[i++])&&(~xn(o,r)||kn(o,r));return o},_n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],An=jn,Rn=_n.concat("length","prototype");tn.f=Object.getOwnPropertyNames||function(e){return An(e,Rn)};var In={};In.f=Object.getOwnPropertySymbols;var Fn=ie,Ln=tn,Pn=In,Tn=$t,Dn=N([].concat),Cn=Fn("Reflect","ownKeys")||function(e){var t=Ln.f(Tn(e)),r=Pn.f;return r?Dn(t,r(e)):t},Nn=Ve,Mn=Cn,Gn=m,$n=Dt,Bn=function(e,t,r){for(var n=Mn(t),i=$n.f,o=Gn.f,s=0;ss;)gi.f(e,r=i[s++],n[r]);return e};var Ei,Si=ie("document","documentElement"),xi=$t,Oi=fi,ki=_n,ji=wr,_i=Si,Ai=xt,Ri=br("IE_PROTO"),Ii=function(){},Fi=function(e){return"