From 59c865834c2539a730456700d6f5e5b11a0d1127 Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Tue, 30 Aug 2022 13:20:16 +0200 Subject: [PATCH 1/2] chore: update postinstall plugin --- .yarn/plugins/@yarnpkg/plugin-postinstall.cjs | 5 +++-- .yarnrc.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs b/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs index 6e9a305e5b..642b5c2dd7 100644 --- a/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs @@ -1,8 +1,9 @@ /* eslint-disable */ +//prettier-ignore module.exports = { name: "@yarnpkg/plugin-postinstall", factory: function (require) { -var plugin;(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>c});const n=require("@yarnpkg/core"),o=require("@yarnpkg/shell"),r=require("clipanion"),l={postinstall:{description:"Postinstall hook that will always run in Yarn v2",type:n.SettingsType.STRING,default:""}};var i=function(e,t,n,o){var r,l=arguments.length,i=l<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(l<3?r(i):l>3?r(t,n,i):r(t,n))||i);return l>3&&i&&Object.defineProperty(t,n,i),i};class a extends r.Command{async execute(){const e=(await n.Configuration.find(this.context.cwd,this.context.plugins)).get("postinstall");e&&o.execute(e)}}i([r.Command.Path("postinstall")],a.prototype,"execute",null);const c={configuration:l,commands:[a],hooks:{afterAllInstalled:e=>{const t=e.configuration.get("postinstall");t&&(console.log("Running postinstall script..."),o.execute(t))}}};plugin=t})(); +var plugin=(()=>{var k=Object.create,r=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var P=t=>r(t,"__esModule",{value:!0});var a=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var C=(t,o)=>{for(var n in o)r(t,n,{get:o[n],enumerable:!0})},S=(t,o,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of h(o))!y.call(t,e)&&e!=="default"&&r(t,e,{get:()=>o[e],enumerable:!(n=w(o,e))||n.enumerable});return t},i=t=>S(P(r(t!=null?k(x(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var A={};C(A,{default:()=>R});var s=i(a("@yarnpkg/core")),d=i(a("@yarnpkg/cli")),u=i(a("clipanion"));var m=i(a("@yarnpkg/core")),g={postinstall:{description:"Postinstall hook that will always run in Yarn v2+",type:m.SettingsType.STRING,default:""}};var f=i(a("@yarnpkg/shell")),c=i(a("@yarnpkg/core")),p=async(t,o)=>{if(process.env.YARN_ENABLE_SCRIPTS==="0"){console.log('Skipping postinstall because of "YARN_ENABLE_SCRIPTS=0"');return}switch(o==null?void 0:o.mode){case c.InstallMode.SkipBuild:case c.InstallMode.UpdateLockfile:{console.log(`Skipping postinstall because of "--mode=${o==null?void 0:o.mode}"`);return}default:break}let n=t.configuration.get("postinstall");console.log(`Running postinstall command "${n}" from the workspace root...`);let e=await(0,f.execute)(n,[],{cwd:t.cwd});if(e!==0)throw new Error(`The postinstall command failed with exit code ${e}`)};var l=class extends d.BaseCommand{async execute(){let o=await s.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await s.Project.find(o,this.context.cwd);await p(n)}};l.paths=[["postinstall"]],l.usage=u.Command.Usage({description:'Manually trigger the "postinstall" command'});var I={configuration:g,commands:[l],hooks:{afterAllInstalled:p}},R=I;return A;})(); return plugin; } -}; \ No newline at end of file +}; diff --git a/.yarnrc.yml b/.yarnrc.yml index ef4c757021..6f4664b47d 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -4,7 +4,7 @@ plugins: - path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs spec: '@yarnpkg/plugin-constraints' - path: .yarn/plugins/@yarnpkg/plugin-postinstall.cjs - spec: 'https://raw.githubusercontent.com/gravitywelluk/yarn-plugin-postinstall/master/bundles/%40yarnpkg/plugin-postinstall.js' + spec: 'https://raw.githubusercontent.com/emmenko/yarn-plugin-postinstall/nm-fix-no-postinstall/bundles/%40yarnpkg/plugin-postinstall.js' - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: '@yarnpkg/plugin-workspace-tools' From 2a64c39bf00e506eea551097aab38219bc5f1f78 Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Thu, 1 Sep 2022 12:04:27 +0200 Subject: [PATCH 2/2] chore: update postinstall plugin --- .yarn/plugins/@yarnpkg/plugin-postinstall.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs b/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs index 642b5c2dd7..ef6887be43 100644 --- a/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-postinstall.cjs @@ -3,7 +3,7 @@ module.exports = { name: "@yarnpkg/plugin-postinstall", factory: function (require) { -var plugin=(()=>{var k=Object.create,r=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var P=t=>r(t,"__esModule",{value:!0});var a=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var C=(t,o)=>{for(var n in o)r(t,n,{get:o[n],enumerable:!0})},S=(t,o,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of h(o))!y.call(t,e)&&e!=="default"&&r(t,e,{get:()=>o[e],enumerable:!(n=w(o,e))||n.enumerable});return t},i=t=>S(P(r(t!=null?k(x(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var A={};C(A,{default:()=>R});var s=i(a("@yarnpkg/core")),d=i(a("@yarnpkg/cli")),u=i(a("clipanion"));var m=i(a("@yarnpkg/core")),g={postinstall:{description:"Postinstall hook that will always run in Yarn v2+",type:m.SettingsType.STRING,default:""}};var f=i(a("@yarnpkg/shell")),c=i(a("@yarnpkg/core")),p=async(t,o)=>{if(process.env.YARN_ENABLE_SCRIPTS==="0"){console.log('Skipping postinstall because of "YARN_ENABLE_SCRIPTS=0"');return}switch(o==null?void 0:o.mode){case c.InstallMode.SkipBuild:case c.InstallMode.UpdateLockfile:{console.log(`Skipping postinstall because of "--mode=${o==null?void 0:o.mode}"`);return}default:break}let n=t.configuration.get("postinstall");console.log(`Running postinstall command "${n}" from the workspace root...`);let e=await(0,f.execute)(n,[],{cwd:t.cwd});if(e!==0)throw new Error(`The postinstall command failed with exit code ${e}`)};var l=class extends d.BaseCommand{async execute(){let o=await s.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await s.Project.find(o,this.context.cwd);await p(n)}};l.paths=[["postinstall"]],l.usage=u.Command.Usage({description:'Manually trigger the "postinstall" command'});var I={configuration:g,commands:[l],hooks:{afterAllInstalled:p}},R=I;return A;})(); +var plugin=(()=>{var w=Object.create,c=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var S=t=>c(t,"__esModule",{value:!0});var n=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var E=(t,e)=>{for(var o in e)c(t,o,{get:e[o],enumerable:!0})},T=(t,e,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!N.call(t,a)&&a!=="default"&&c(t,a,{get:()=>e[a],enumerable:!(o=x(e,a))||o.enumerable});return t},i=t=>T(S(c(t!=null?w(P(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var R={};E(R,{default:()=>A});var s=i(n("@yarnpkg/core")),k=i(n("@yarnpkg/cli")),h=i(n("clipanion"));var u=i(n("@yarnpkg/core")),d={postinstall:{description:"Postinstall hook that will always run in Yarn v2+",type:u.SettingsType.STRING,default:""}};var y=i(n("@yarnpkg/shell")),r=i(n("@yarnpkg/core")),f=async(t,e)=>{await e.report.startTimerPromise("Postinstall step",async()=>{if(process.env.YARN_ENABLE_SCRIPTS==="0"){let m=r.formatUtils.pretty(t.configuration,"YARN_ENABLE_SCRIPTS=0",r.formatUtils.Type.CODE);e.report.reportWarning(r.MessageName.UNNAMED,`Skipping postinstall because of ${m}`);return}switch(e.mode){case r.InstallMode.SkipBuild:case r.InstallMode.UpdateLockfile:{let m=r.formatUtils.pretty(t.configuration,`--mode=${e==null?void 0:e.mode}`,r.formatUtils.Type.CODE);e.report.reportWarning(r.MessageName.UNNAMED,`Skipping postinstall because of ${m}`);return}default:break}let o=t.configuration.get("postinstall"),a=r.formatUtils.pretty(t.configuration,o,r.formatUtils.Type.CODE),l=r.formatUtils.pretty(t.configuration,"workspace root",r.formatUtils.Type.PATH);e.report.reportInfo(r.MessageName.UNNAMED,`Running command ${a} from the ${l}...`),e.report.reportSeparator();let g=await(0,y.execute)(o,[],{cwd:t.cwd,stdout:e.report.createStreamReporter()});if(e.report.reportSeparator(),g!==0)throw new Error(`The postinstall command failed with exit code ${g}`)})};var p=class extends k.BaseCommand{async execute(){let e=await s.Configuration.find(this.context.cwd,this.context.plugins),{project:o}=await s.Project.find(e,this.context.cwd);return(await s.StreamReport.start({configuration:e,stdout:this.context.stdout},async l=>{await f(o,{cache:null,report:l})})).exitCode()}};p.paths=[["postinstall"]],p.usage=h.Command.Usage({description:'Manually trigger the "postinstall" command'});var M={configuration:d,commands:[p],hooks:{afterAllInstalled:f}},A=M;return R;})(); return plugin; } };