Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
.pnp.*

.idea
8 changes: 8 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-lockfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable */
module.exports = {
name: "@yarnpkg/plugin-workspace-lockfile",
factory: function (require) {
var plugin;(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:()=>i});const t=require("@yarnpkg/core"),r=require("@yarnpkg/cli"),a=require("@yarnpkg/fslib"),n=async(e,o,{cwd:a})=>{const n=await t.Configuration.find(a,(0,r.getPluginConfiguration)(),{lookup:t.ProjectLookup.MANIFEST}),{projectCwd:i}=n;n.values.set("cacheFolder",n.get("globalFolder")+"/cache"),n.values.set("enableMirror",!0),n.values.set("enableGlobalCache",!0);const s=await t.Cache.find(n),{project:c,workspace:l}=await t.Project.find(n,a);c.storedResolutions=new Map(e.storedResolutions);let p=new Set([l]);for(const e of p)for(const o of t.Manifest.hardDependencies)for(const t of e.manifest.getForScope(o).values()){const e=c.tryWorkspaceByDescriptor(t);null!==e&&p.add(e)}return await c.resolveEverything({cache:s,report:new t.ThrowReport}),await c.fetchEverything({cache:s,report:new t.ThrowReport}),c.generateLockfile()},i={configuration:{workspaceLockfiles:{description:"List of the workspaces that need a specific lockfile",type:t.SettingsType.STRING,default:!0,isArray:!0},workspaceLockfileName:{description:"Name of the workspaces specific lockfile",type:t.SettingsType.STRING,default:"yarn.lock-workspace"}},hooks:{afterAllInstalled:async e=>{const o=await t.Configuration.find(e.cwd,(0,r.getPluginConfiguration)()),i=o.values.get("workspaceLockfiles"),s=o.values.get("workspaceLockfileName");await t.StreamReport.start({configuration:o,stdout:process.stdout,includeLogs:!0},async o=>{const r=Array.isArray(i)?new Set(i.map(o=>e.getWorkspaceByIdent(t.structUtils.parseIdent(o)))):new Set(e.workspaces);for(const t of r){const r=a.ppath.join(t.cwd,s);await a.xfs.writeFilePromise(r,await n(e,0,t)),o.reportInfo(null,`${c="✓",`${c}`} Wrote ${r}`)}var c})}}};plugin=o})();
return plugin;
}
};
55 changes: 0 additions & 55 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

10 changes: 9 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
yarnPath: ".yarn/releases/yarn-berry.cjs"
changesetBaseRefs:
- main
- origin/main
- upstream/main

npmScopes:
openagenda:
npmPublishRegistry: "https://registry.npmjs.org/"
npmRegistryServer: "https://registry.npmjs.org/"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Usage:

```
yarn plugin import https://raw.githubusercontent.com/andreialecu/yarn-plugin-workspace-lockfile/main/packages/plugin/bundles/%40yarnpkg/plugin-workspace-lockfile.js
yarn plugin import https://unpkg.com/@openagenda/yarn-plugin-workspace-lockfile

yarn install
```
Expand All @@ -16,4 +16,4 @@ This can be useful if you need to partition a big monorepo into smaller repos wh

You can set-up git submodules in the root monorepo, so that each workspace directory is an individual git repository.

Developers can then clone the repository they need to work on, and either rename `yarn.lock-workspace` to `yarn.lock` before installing, or they can create a `.yarnrc.yml` file that contains `lockfileFilename: yarn.lock-workspace`.
Developers can then clone the repository they need to work on, and either rename `yarn.lock-workspace` to `yarn.lock` before installing, or they can create a `.yarnrc.yml` file that contains `lockfileFilename: yarn.lock-workspace`.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"packages/*"
],
"dependencies": {
"typescript": "^4.0.5"
}
"typescript": "^5.2.2"
},
"packageManager": "yarn@4.5.3"
}
194 changes: 3 additions & 191 deletions packages/plugin/bundles/@yarnpkg/plugin-workspace-lockfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 20 additions & 8 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
{
"name": "yarn-plugin-workspace-lockfile",
"name": "@openagenda/yarn-plugin-workspace-lockfile",
"version": "0.1.0",
"main": "./sources/index.ts",
"dependencies": {
"@types/node": "^13.0.0",
"@yarnpkg/builder": "^2.1.2",
"@yarnpkg/cli": "^2.3.0",
"@yarnpkg/core": "^2.3.0",
"@yarnpkg/fslib": "^2.3.0",
"typescript": "^4.0.5"
"@types/node": "^20.9.2",
"@yarnpkg/builder": "^4.0.0",
"@yarnpkg/cli": "^4.0.2",
"@yarnpkg/core": "^4.0.2",
"@yarnpkg/fslib": "^3.0.1",
"@yarnpkg/parsers": "^3.0.0",
"typescript": "^5.2.2"
},
"scripts": {
"build:plugin": "builder build plugin --no-minify"
"build:plugin": "builder build plugin",
"prepack": "run build:plugin"
},
"publishConfig": {
"main": "./bundles/@yarnpkg/plugin-workspace-lockfile.js"
},
"files": [
"/bundles/**/*"
],
"engines": {
"node": ">=18"
}
}
Loading