Skip to content

Commit

Permalink
Add @yarnpkg/plugin-nolyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Oct 30, 2023
1 parent 0ddd802 commit a68b633
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 563 deletions.
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-nolyfill.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-nolyfill",
factory: function (require) {
"use strict";var plugin=(()=>{var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var y=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var c=(r,e)=>{for(var t in e)p(r,t,{get:e[t],enumerable:!0})},g=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!n.call(r,o)&&o!==t&&p(r,o,{get:()=>e[o],enumerable:!(s=i(e,o))||s.enumerable});return r};var f=r=>g(p({},"__esModule",{value:!0}),r);var j={};c(j,{default:()=>w});var a=y("@yarnpkg/core"),d=[["array-includes"],["array.prototype.findlastindex"],["array.prototype.findlast"],["array.prototype.at"],["string.prototype.at"],["array.prototype.flat"],["array.prototype.flatmap"],["arraybuffer.prototype.slice"],["function.prototype.name"],["has"],["object-keys"],["object.assign"],["object.entries"],["object.fromentries"],["object.hasown"],["object.values"],["string.prototype.trim"],["string.prototype.trimend"],["string.prototype.trimstart"],["string.prototype.trimleft"],["string.prototype.trimright"],["string.prototype.matchall"],["regexp.prototype.flags"],["globalthis"],["array.prototype.tosorted"],["object.groupby"],["array.prototype.find"],["array.from"],["string.prototype.padend"],["string.prototype.padstart"],["object.getownpropertydescriptors"],["array.prototype.reduce"],["object-is"],["reflect.ownkeys"],["string.prototype.replaceall"],["reflect.getprototypeof"],["es-aggregate-error"],["promise.any",{"@nolyfill/es-aggregate-error":"workspace:*"},">=12.4.0"],["promise.allsettled"]],h=[["has-property-descriptors"],["gopd"],["has-proto"],["get-symbol-description",{"@nolyfill/shared":"workspace:*"}],["is-array-buffer",{"@nolyfill/shared":"workspace:*"}],["is-shared-array-buffer",{"@nolyfill/shared":"workspace:*"}],["typed-array-buffer",{"@nolyfill/shared":"workspace:*"}],["typed-array-byte-length",{"@nolyfill/shared":"workspace:*"}],["typed-array-byte-offset",{"@nolyfill/shared":"workspace:*"}],["typed-array-length",{"@nolyfill/shared":"workspace:*"}],["harmony-reflect"],["array-buffer-byte-length",{"@nolyfill/is-array-buffer":"workspace:*","@nolyfill/shared":"workspace:*"}],["iterator.prototype"],["available-typed-arrays"],["which-typed-array",{"@nolyfill/shared":"workspace:*"}],["which-boxed-primitive"],["unbox-primitive"],["is-regex"],["safe-regex-test"],["safe-array-concat"],["asynciterator.prototype"],["is-weakref"],["is-symbol"],["is-string"],["is-date-object"],["es-set-tostringtag"],["define-properties",{"@nolyfill/shared":"workspace:*"}],["deep-equal",{dequal:"2.0.3"}],["is-arguments"],["is-generator-function"],["side-channel"],["internal-slot"]],m=["function-bind","has-tostringtag","has-symbols","es-iterator-helpers"],u=[...m,...d.map(r=>r[0]),...h.map(r=>r[0])].sort(),b=new Map(u.map(r=>[a.structUtils.makeIdent(null,r).identHash,a.structUtils.makeIdent("nolyfill",r)])),k={hooks:{reduceDependency:async r=>{let e=b.get(r.identHash);if(e){let t=a.structUtils.makeDescriptor(e,"latest"),s=a.structUtils.makeRange({protocol:"npm:",source:null,selector:a.structUtils.stringifyDescriptor(t),params:null});return a.structUtils.makeDescriptor(r,s)}return r}}},w=k;return f(j);})();
return plugin;
}
};
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ logFilters:
level: discard

nodeLinker: node-modules

plugins:
- checksum: 04cbf7ea36b0aaedbec723f6f5165e80f817e1ef242a9d811ebca7977ec6b8756811d9406a0ccd2968f9e9768b426b2213a736aa2c6252f2c5631f6d4de2162b
path: .yarn/plugins/@yarnpkg/plugin-nolyfill.cjs
spec: "https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v0.1.0/bundles/@yarnpkg/plugin-nolyfill.js"
Loading

0 comments on commit a68b633

Please sign in to comment.