Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@semrel-extra/topo

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semrel-extra/topo - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

renovate.json

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [1.1.0](https://github.com/semrel-extra/topo/compare/v1.0.0...v1.1.0) (2021-12-26)
### Features
* add nodes and edges to topoContext ([18f60c0](https://github.com/semrel-extra/topo/commit/18f60c09cbaec005b9110b369ba77053246de3db))
# 1.0.0 (2021-12-25)

@@ -2,0 +9,0 @@

2

package.json
{
"name": "@semrel-extra/topo",
"version": "1.0.0",
"version": "1.1.0",
"description": "Helper to resolve monorepo dependencies graph",

@@ -5,0 +5,0 @@ "publishConfig": {

@@ -23,3 +23,9 @@ # @semrel-extra/topo

{
queue: ['plk-a', 'pkg-b', 'pkg-x', 'pkg-y', 'pkg-x']
queue: ['pkg-a', 'pkg-b', 'pkg-z', 'pkg-y', 'pkg-x'],
nodes: ['pkg-a', 'pkg-b', 'pkg-x', 'pkg-y', 'pkg-z'],
edges: [
['pkg-a', 'pkg-b'],
['pkg-z', 'pkg-y'],
['pkg-y', 'pkg-x'],
]
}

@@ -26,0 +32,0 @@ ```

@@ -21,3 +21,9 @@ import toposort from 'toposort'

export const topo = async (otions: ITopoOtions): Promise<{ queue: string[] }> => {
export interface ITopoContext {
queue: string[]
nodes: string[]
edges: [string, string | undefined][]
}
export const topo = async (otions: ITopoOtions): Promise<ITopoContext> => {
const manifestsPaths = await getManifestsPaths(otions)

@@ -27,3 +33,7 @@ const manifests = await Promise.all(manifestsPaths.map(p => readFile(p, 'utf-8').then(JSON.parse)))

return { queue: toposort.array(nodes, edges) }
return {
queue: toposort.array(nodes, edges),
edges,
nodes,
}
}

@@ -30,0 +40,0 @@

@@ -23,4 +23,10 @@ import { test } from 'uvu'

const workspaces = ['packages/*']
const result = (await topo({cwd, workspaces})).queue
const expected = ['a', 'e', 'c']
const result = await topo({cwd, workspaces})
const expected = {
queue: ['a', 'e', 'c'],
nodes: ['a', 'c', 'e'],
edges: [
[ 'e', 'c' ]
],
}

@@ -27,0 +33,0 @@ assert.equal(result, expected)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc