jsrepo 1.0.0 → 1.0.1
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.
- package/README.md +1 -3
- package/dist/index.js +8 -8
- package/package.json +6 -12
- package/schema.json +2 -2
- package/src/commands/add.ts +2 -2
- package/src/commands/build.ts +1 -1
- package/src/commands/init.ts +4 -4
- package/src/commands/test.ts +3 -3
- package/src/config/index.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/pnpm-lock.yaml +0 -3185
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -667,7 +667,7 @@ var Err = (err) => {
|
|
|
667
667
|
};
|
|
668
668
|
|
|
669
669
|
// src/config/index.ts
|
|
670
|
-
var CONFIG_NAME = "
|
|
670
|
+
var CONFIG_NAME = "jsrepo.json";
|
|
671
671
|
var schema = v.object({
|
|
672
672
|
$schema: v.string(),
|
|
673
673
|
repos: v.optional(v.array(v.string()), []),
|
|
@@ -681,7 +681,7 @@ var getConfig = () => {
|
|
|
681
681
|
}
|
|
682
682
|
const config = v.safeParse(schema, JSON.parse(fs.readFileSync(CONFIG_NAME).toString()));
|
|
683
683
|
if (!config.success) {
|
|
684
|
-
return Err(
|
|
684
|
+
return Err(`There was an error reading your \`${CONFIG_NAME}\` file!`);
|
|
685
685
|
}
|
|
686
686
|
return Ok(config.output);
|
|
687
687
|
};
|
|
@@ -695,7 +695,7 @@ import * as v2 from "valibot";
|
|
|
695
695
|
|
|
696
696
|
// src/utils/index.ts
|
|
697
697
|
import color from "chalk";
|
|
698
|
-
var OUTPUT_FILE = "
|
|
698
|
+
var OUTPUT_FILE = "jsrepo-manifest.json";
|
|
699
699
|
var WARN = color.bgRgb(245, 149, 66).white("WARN");
|
|
700
700
|
var INFO = color.bgBlueBright.white("INFO");
|
|
701
701
|
|
|
@@ -1135,7 +1135,7 @@ var schema2 = v4.object({
|
|
|
1135
1135
|
repo: v4.optional(v4.string()),
|
|
1136
1136
|
allow: v4.boolean()
|
|
1137
1137
|
});
|
|
1138
|
-
var add = new Command("add").argument("[blocks...]", "
|
|
1138
|
+
var add = new Command("add").argument("[blocks...]", "Names of the blocks you want to add to your project.").option("-y, --yes", "Add and install any required dependencies.", false).option("-A, --allow", "Allow jsrepo to download code from the provided repo.", false).option("--repo <repo>", "Repository to download the blocks from.").option("--verbose", "Include debug logs.", false).action(async (blockNames, opts) => {
|
|
1139
1139
|
const options = v4.parse(schema2, opts);
|
|
1140
1140
|
await _add(blockNames, options);
|
|
1141
1141
|
});
|
|
@@ -1477,7 +1477,7 @@ var schema3 = v5.object({
|
|
|
1477
1477
|
dirs: v5.array(v5.string()),
|
|
1478
1478
|
cwd: v5.string()
|
|
1479
1479
|
});
|
|
1480
|
-
var build = new Command2("build").description(`Builds the provided --dirs in the project root into a \`${OUTPUT_FILE}\` file.`).option("--dirs [dirs...]", "The directories containing the blocks.", ["./blocks"]).option("--no-output", `Do not output a \`${OUTPUT_FILE}\` file.`).option("--verbose", "Include debug logs.", false).option("--cwd <cwd>", "The current working directory", process.cwd()).action(async (opts) => {
|
|
1480
|
+
var build = new Command2("build").description(`Builds the provided --dirs in the project root into a \`${OUTPUT_FILE}\` file.`).option("--dirs [dirs...]", "The directories containing the blocks.", ["./blocks"]).option("--no-output", `Do not output a \`${OUTPUT_FILE}\` file.`).option("--verbose", "Include debug logs.", false).option("--cwd <cwd>", "The current working directory.", process.cwd()).action(async (opts) => {
|
|
1481
1481
|
const options = v5.parse(schema3, opts);
|
|
1482
1482
|
await _build(options);
|
|
1483
1483
|
});
|
|
@@ -1830,10 +1830,10 @@ var schema5 = v7.object({
|
|
|
1830
1830
|
repos: v7.optional(v7.array(v7.string())),
|
|
1831
1831
|
watermark: v7.boolean()
|
|
1832
1832
|
});
|
|
1833
|
-
var init = new Command4("init").description("Initializes
|
|
1833
|
+
var init = new Command4("init").description("Initializes your project with a configuration file.").option("--path <path>", "Path to install the blocks.").option("--repos [repos...]", "Repository to install the blocks from.").option(
|
|
1834
1834
|
"--no-watermark",
|
|
1835
1835
|
"Will not add a watermark to each file upon adding it to your project."
|
|
1836
|
-
).option("--tests", "Will include tests
|
|
1836
|
+
).option("--tests", "Will include tests with the blocks.").action(async (opts) => {
|
|
1837
1837
|
const options = v7.parse(schema5, opts);
|
|
1838
1838
|
await _init(options);
|
|
1839
1839
|
});
|
|
@@ -1917,7 +1917,7 @@ var schema6 = v8.object({
|
|
|
1917
1917
|
repo: v8.optional(v8.string()),
|
|
1918
1918
|
allow: v8.boolean()
|
|
1919
1919
|
});
|
|
1920
|
-
var test = new Command5("test").description("Tests blocks against most recent tests").addArgument(new Argument("[blocks...]", "
|
|
1920
|
+
var test = new Command5("test").description("Tests local blocks against most recent remote tests.").addArgument(new Argument("[blocks...]", "The blocks you want to test.").default([])).option("--verbose", "Include debug logs.", false).option("-A, --allow", "Allow jsrepo to download code from the provided repo.", false).option("--repo <repo>", "Repository to download the blocks from.").option("--debug", "Leaves the temp test file around for debugging upon failure.", false).action(async (blockNames, opts) => {
|
|
1921
1921
|
const options = v8.parse(schema6, opts);
|
|
1922
1922
|
await _test(blockNames, options);
|
|
1923
1923
|
});
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsrepo",
|
|
3
|
-
"description": "A CLI to
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"description": "A CLI to add shared code from remote repositories.",
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ieedan/jsrepo"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"tested",
|
|
13
|
-
"documented"
|
|
10
|
+
"repo",
|
|
11
|
+
"cli"
|
|
14
12
|
],
|
|
15
13
|
"author": "Aidan Bleser",
|
|
16
14
|
"license": "MIT",
|
|
@@ -28,8 +26,7 @@
|
|
|
28
26
|
"README.md",
|
|
29
27
|
"schema.json",
|
|
30
28
|
"dist/**/*",
|
|
31
|
-
"src/**/*"
|
|
32
|
-
"blocks/**/*"
|
|
29
|
+
"src/**/*"
|
|
33
30
|
],
|
|
34
31
|
"devDependencies": {
|
|
35
32
|
"@biomejs/biome": "1.9.4",
|
|
@@ -41,7 +38,6 @@
|
|
|
41
38
|
"vitest": "^2.1.5"
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
|
-
"@changesets/cli": "^2.27.9",
|
|
45
41
|
"@clack/prompts": "^0.8.1",
|
|
46
42
|
"ansi-regex": "^6.1.0",
|
|
47
43
|
"chalk": "^5.3.0",
|
|
@@ -61,9 +57,7 @@
|
|
|
61
57
|
"build": "tsup",
|
|
62
58
|
"format": "biome format --write",
|
|
63
59
|
"lint": "biome lint --write",
|
|
64
|
-
"check": "biome check",
|
|
65
|
-
"ci:release": "tsup && changeset publish",
|
|
66
|
-
"changeset": "changeset",
|
|
60
|
+
"check": "biome check && tsc",
|
|
67
61
|
"test": "vitest",
|
|
68
62
|
"check:types": "tsc"
|
|
69
63
|
}
|
package/schema.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
5
|
"repos": {
|
|
6
|
-
"description": "Repositories to download
|
|
6
|
+
"description": "Repositories to download code from.",
|
|
7
7
|
"type": "array",
|
|
8
8
|
"items": {
|
|
9
9
|
"type": "string"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"path": {
|
|
13
|
-
"description": "Path to add
|
|
13
|
+
"description": "Path to add code to in your project.",
|
|
14
14
|
"type": "string"
|
|
15
15
|
},
|
|
16
16
|
"includeTests": {
|
package/src/commands/add.ts
CHANGED
|
@@ -30,10 +30,10 @@ const schema = v.object({
|
|
|
30
30
|
type Options = v.InferInput<typeof schema>;
|
|
31
31
|
|
|
32
32
|
const add = new Command('add')
|
|
33
|
-
.argument('[blocks...]', '
|
|
33
|
+
.argument('[blocks...]', 'Names of the blocks you want to add to your project.')
|
|
34
34
|
.option('-y, --yes', 'Add and install any required dependencies.', false)
|
|
35
35
|
.option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false)
|
|
36
|
-
.option('--repo <repo>', 'Repository to download the blocks from')
|
|
36
|
+
.option('--repo <repo>', 'Repository to download the blocks from.')
|
|
37
37
|
.option('--verbose', 'Include debug logs.', false)
|
|
38
38
|
.action(async (blockNames, opts) => {
|
|
39
39
|
const options = v.parse(schema, opts);
|
package/src/commands/build.ts
CHANGED
|
@@ -23,7 +23,7 @@ const build = new Command('build')
|
|
|
23
23
|
.option('--dirs [dirs...]', 'The directories containing the blocks.', ['./blocks'])
|
|
24
24
|
.option('--no-output', `Do not output a \`${OUTPUT_FILE}\` file.`)
|
|
25
25
|
.option('--verbose', 'Include debug logs.', false)
|
|
26
|
-
.option('--cwd <cwd>', 'The current working directory', process.cwd())
|
|
26
|
+
.option('--cwd <cwd>', 'The current working directory.', process.cwd())
|
|
27
27
|
.action(async (opts) => {
|
|
28
28
|
const options = v.parse(schema, opts);
|
|
29
29
|
|
package/src/commands/init.ts
CHANGED
|
@@ -17,14 +17,14 @@ const schema = v.object({
|
|
|
17
17
|
type Options = v.InferInput<typeof schema>;
|
|
18
18
|
|
|
19
19
|
const init = new Command('init')
|
|
20
|
-
.description('Initializes
|
|
21
|
-
.option('--path <path>', 'Path to install the blocks')
|
|
22
|
-
.option('--repos [repos...]', 'Repository to install the blocks from')
|
|
20
|
+
.description('Initializes your project with a configuration file.')
|
|
21
|
+
.option('--path <path>', 'Path to install the blocks.')
|
|
22
|
+
.option('--repos [repos...]', 'Repository to install the blocks from.')
|
|
23
23
|
.option(
|
|
24
24
|
'--no-watermark',
|
|
25
25
|
'Will not add a watermark to each file upon adding it to your project.'
|
|
26
26
|
)
|
|
27
|
-
.option('--tests', 'Will include tests
|
|
27
|
+
.option('--tests', 'Will include tests with the blocks.')
|
|
28
28
|
.action(async (opts) => {
|
|
29
29
|
const options = v.parse(schema, opts);
|
|
30
30
|
|
package/src/commands/test.ts
CHANGED
|
@@ -27,11 +27,11 @@ const schema = v.object({
|
|
|
27
27
|
type Options = v.InferInput<typeof schema>;
|
|
28
28
|
|
|
29
29
|
const test = new Command('test')
|
|
30
|
-
.description('Tests blocks against most recent tests')
|
|
31
|
-
.addArgument(new Argument('[blocks...]', '
|
|
30
|
+
.description('Tests local blocks against most recent remote tests.')
|
|
31
|
+
.addArgument(new Argument('[blocks...]', 'The blocks you want to test.').default([]))
|
|
32
32
|
.option('--verbose', 'Include debug logs.', false)
|
|
33
33
|
.option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false)
|
|
34
|
-
.option('--repo <repo>', 'Repository to download the blocks from')
|
|
34
|
+
.option('--repo <repo>', 'Repository to download the blocks from.')
|
|
35
35
|
.option('--debug', 'Leaves the temp test file around for debugging upon failure.', false)
|
|
36
36
|
.action(async (blockNames, opts) => {
|
|
37
37
|
const options = v.parse(schema, opts);
|
package/src/config/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
import { Err, Ok, type Result } from '../blocks/types/result';
|
|
4
4
|
|
|
5
|
-
const CONFIG_NAME = '
|
|
5
|
+
const CONFIG_NAME = 'jsrepo.json';
|
|
6
6
|
|
|
7
7
|
const schema = v.object({
|
|
8
8
|
$schema: v.string(),
|
|
@@ -20,7 +20,7 @@ const getConfig = (): Result<Config, string> => {
|
|
|
20
20
|
const config = v.safeParse(schema, JSON.parse(fs.readFileSync(CONFIG_NAME).toString()));
|
|
21
21
|
|
|
22
22
|
if (!config.success) {
|
|
23
|
-
return Err(
|
|
23
|
+
return Err(`There was an error reading your \`${CONFIG_NAME}\` file!`);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
return Ok(config.output);
|