@h-rig/standard-plugin 0.0.6-alpha.51 → 0.0.6-alpha.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // packages/standard-plugin/src/files-source.ts
3
3
  import { readFileSync, readdirSync, existsSync, statSync, writeFileSync } from "fs";
4
- import { join, basename } from "path";
4
+ import { join, basename, isAbsolute, resolve } from "path";
5
5
  var DEFAULT_PATTERN = /\.(task\.)?json$/;
6
6
  function readTaskFile(file, pattern) {
7
7
  const raw = JSON.parse(readFileSync(file, "utf-8"));
@@ -22,10 +22,11 @@ function readTaskFile(file, pattern) {
22
22
  }
23
23
  function createFilesTaskSource(opts) {
24
24
  const pattern = opts.pattern ?? DEFAULT_PATTERN;
25
- const directory = opts.path ?? opts.dir;
26
- if (!directory) {
25
+ const configured = opts.path ?? opts.dir;
26
+ if (!configured) {
27
27
  throw new Error("createFilesTaskSource: either `path` or `dir` must be provided");
28
28
  }
29
+ const directory = isAbsolute(configured) ? configured : resolve(opts.projectRoot ?? process.cwd(), configured);
29
30
  const findTaskFile = (id) => {
30
31
  if (!existsSync(directory))
31
32
  return;
package/dist/src/index.js CHANGED
@@ -476,7 +476,7 @@ function createGitHubIssuesTaskSource(opts) {
476
476
 
477
477
  // packages/standard-plugin/src/files-source.ts
478
478
  import { readFileSync as readFileSync2, readdirSync, existsSync as existsSync2, statSync, writeFileSync } from "fs";
479
- import { join, basename } from "path";
479
+ import { join, basename, isAbsolute, resolve as resolve2 } from "path";
480
480
  var DEFAULT_PATTERN = /\.(task\.)?json$/;
481
481
  function readTaskFile(file, pattern) {
482
482
  const raw = JSON.parse(readFileSync2(file, "utf-8"));
@@ -497,10 +497,11 @@ function readTaskFile(file, pattern) {
497
497
  }
498
498
  function createFilesTaskSource(opts) {
499
499
  const pattern = opts.pattern ?? DEFAULT_PATTERN;
500
- const directory = opts.path ?? opts.dir;
501
- if (!directory) {
500
+ const configured = opts.path ?? opts.dir;
501
+ if (!configured) {
502
502
  throw new Error("createFilesTaskSource: either `path` or `dir` must be provided");
503
503
  }
504
+ const directory = isAbsolute(configured) ? configured : resolve2(opts.projectRoot ?? process.cwd(), configured);
504
505
  const findTaskFile = (id) => {
505
506
  if (!existsSync2(directory))
506
507
  return;
@@ -644,9 +645,10 @@ function standardPlugin(opts = {}) {
644
645
  id: "std:files",
645
646
  kind: "files",
646
647
  description: "JSON files in a local directory",
647
- factory(config) {
648
+ factory(config, context) {
648
649
  return createFilesTaskSource({
649
- path: requireStringField(config, "path", "files")
650
+ path: requireStringField(config, "path", "files"),
651
+ ...context?.projectRoot ? { projectRoot: context.projectRoot } : {}
650
652
  });
651
653
  }
652
654
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/standard-plugin",
3
- "version": "0.0.6-alpha.51",
3
+ "version": "0.0.6-alpha.52",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -19,8 +19,8 @@
19
19
  "main": "./dist/src/index.js",
20
20
  "module": "./dist/src/index.js",
21
21
  "dependencies": {
22
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.51",
23
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.51",
22
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.52",
23
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.52",
24
24
  "effect": "4.0.0-beta.78"
25
25
  }
26
26
  }