
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@bscotch/blork-shared
Advanced tools
Blork! is an internal work management service developed and used by Butterscotch Shenanigans ("Bscotch"). It is currently not available in any public way, so this package is only of use to Bscotch staff.
This package includes a client for talking to Blork servers and a bunch of shared utilities for various aspects of working with Blork data.
To automate tasks in Blork, in particular creating new tasks, you can use the Blork Client provided by this package.
import { BlorkClient, textToNewTasks } from '@bscotch/blork-shared';
const client = new BlorkClient({
baseUrl: 'http://localhost:8080', // or wherever the Blork instance is hosted
userId: 'your-user-id', // Unless you can rely on browser cookies
password: 'your-password', // ^^
});
// Make sure the server is up
await client.isHealthy();
// Get *all* tasks
const allTasks = await client.getTasks();
// Create a new, empty task
const newTask = await client.createTasks('parent-task-id', { tasks: [{}] });
// Create some tasks from a nested, text-based task list
const asTasks = textToNewTasks('hello\n\tworld\n\thi');
await client.createTasks('parent-task-id', { tasks: asTasks });
// Or just send the template directly!
await client.createTasks('parent-task-id', {
template: 'hello\n\tworld\n\thi',
});
// ... plus lots of methods to set done-state, snooze a task, delete a task, etc etc
The Blork server and webapp both construct and maintain task caches to stay up to date and validate operations. For most other use-cases this will be overkill, but since this package includes a lot of utilities for a "Task Cache" you may want to construct one even if it doesn't need to be kept up to date.
For example:
import {
type TaskCache,
listTaskChildrenRecursive,
planTaskDeletion,
taskIsNotBlocked,
} from '@bscotch/blork-shared';
// Get *all* tasks
const allTasks = await client.getTasks();
// Turn them into a simple, Map-based cache
const cache: TaskCache = new Map();
allTasks.forEach((task) => cache.set(task.taskId, task));
// Use that cache for all kinds of operations
const children = listTaskChildrenRecursive(cache, 'some-task-id');
// See if a deletion is possible, and what all changes will happen
// as a consequence (the Blork server performs this process, so you
// you don't need to do it before attempting to delete a task)
const deletionPlan = planTaskDeletion(cache, 'some-task-id');
if (taskIsNotBlocked(cache, 'some-task-id')) {
// Then this task is not blocked by anything
}
You can also use the Blork Query Language to search through your task cache:
import { searchTasks } from '@bscotch/blork-shared';
const users = await client.listAllUsers();
const { parsedQuery, matches } = searchTasks(
'hello world > is:starred > @me title:some stuff',
taskCache,
{
users,
currentUserId: 'my-user-id',
},
);
FAQs
Client and shared utilities for Blork projects.
We found that @bscotch/blork-shared demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.