@ryanatkn/gro 0.128.0 → 0.129.0
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 +2 -2
- package/dist/changelog.js +1 -1
- package/dist/changelog.test.js +1 -1
- package/dist/docs/dev.md +1 -1
- package/dist/git.d.ts +1 -1
- package/dist/gro.js +1 -1
- package/dist/gro_helpers.d.ts +6 -1
- package/dist/gro_helpers.js +22 -10
- package/dist/package.d.ts +1 -0
- package/dist/package.js +6 -5
- package/dist/reinstall.task.js +1 -1
- package/dist/run.task.js +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# gro <img src="static/
|
|
1
|
+
# gro <img src="static/logo.svg" alt="a pixelated green oak acorn with a glint of sun" width="32" height="32">
|
|
2
2
|
|
|
3
|
-
<img src="static/
|
|
3
|
+
[<img src="static/logo.svg" alt="a pixelated green oak acorn with a glint of sun" align="right" width="192" height="192">](https://gro.ryanatkn.com/)
|
|
4
4
|
|
|
5
5
|
> task runner and toolkit extending SvelteKit 🌰 generate, run, optimize
|
|
6
6
|
|
package/dist/changelog.js
CHANGED
package/dist/changelog.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test } from 'uvu';
|
|
2
2
|
import * as assert from 'uvu/assert';
|
|
3
3
|
import { Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
-
import { readFile, writeFile } from 'fs/promises';
|
|
4
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
5
5
|
import { update_changelog } from './changelog.js';
|
|
6
6
|
import { load_from_env } from './env.js';
|
|
7
7
|
const log = new Logger();
|
package/dist/docs/dev.md
CHANGED
|
@@ -35,6 +35,6 @@ See [plugin.md](plugin.md) to learn more.
|
|
|
35
35
|
|
|
36
36
|
<p align="center">
|
|
37
37
|
<a href="https://github.com/ryanatkn/gro">
|
|
38
|
-
<img src="static/
|
|
38
|
+
<img src="static/logo.svg" alt="a pixelated green oak acorn with a glint of sun" width="192" height="192">
|
|
39
39
|
</a>
|
|
40
40
|
</p>
|
package/dist/git.d.ts
CHANGED
package/dist/gro.js
CHANGED
|
@@ -11,7 +11,7 @@ and it also provides special handling for the case
|
|
|
11
11
|
where we're running Gro inside Gro's own repo for development.
|
|
12
12
|
|
|
13
13
|
*/
|
|
14
|
-
const invoke_path =
|
|
14
|
+
const invoke_path = resolve_gro_module_path('invoke.js');
|
|
15
15
|
const loader_path = join(invoke_path, '../loader.js');
|
|
16
16
|
const spawned = await spawn_with_loader(loader_path, invoke_path, process.argv.slice(2));
|
|
17
17
|
if (!spawned.ok) {
|
package/dist/gro_helpers.d.ts
CHANGED
|
@@ -33,10 +33,15 @@ import { type Spawn_Result } from '@ryanatkn/belt/process.js';
|
|
|
33
33
|
* When using the global CLI, this uses the global Gro installation.
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
|
-
export declare const resolve_gro_module_path: (path?: string) =>
|
|
36
|
+
export declare const resolve_gro_module_path: (path?: string) => string;
|
|
37
37
|
/**
|
|
38
38
|
* Runs a file using the Gro loader.
|
|
39
39
|
*
|
|
40
|
+
* Uses conditional exports to correctly set up `esm-env` as development by default,
|
|
41
|
+
* so if you want production set `NODE_ENV=production`.
|
|
42
|
+
*
|
|
43
|
+
* @see https://nodejs.org/api/packages.html#conditional-exports
|
|
44
|
+
*
|
|
40
45
|
* @param loader_path path to loader
|
|
41
46
|
* @param invoke_path path to file to spawn with `node`
|
|
42
47
|
*/
|
package/dist/gro_helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
@@ -43,12 +43,12 @@ This module is intended to have minimal dependencies to avoid over-imports in th
|
|
|
43
43
|
* When using the global CLI, this uses the global Gro installation.
|
|
44
44
|
*
|
|
45
45
|
*/
|
|
46
|
-
export const resolve_gro_module_path =
|
|
46
|
+
export const resolve_gro_module_path = (path = '') => {
|
|
47
47
|
const gro_bin_path = resolve(NODE_MODULES_DIRNAME, '.bin/gro');
|
|
48
48
|
// case 1
|
|
49
49
|
// Prefer any locally installed version of Gro.
|
|
50
50
|
if (existsSync(gro_bin_path)) {
|
|
51
|
-
return join(
|
|
51
|
+
return join(realpathSync(gro_bin_path), '..', path);
|
|
52
52
|
}
|
|
53
53
|
// case 2
|
|
54
54
|
// If running Gro inside its own repo, require the local dist.
|
|
@@ -65,16 +65,28 @@ export const resolve_gro_module_path = async (path = '') => {
|
|
|
65
65
|
/**
|
|
66
66
|
* Runs a file using the Gro loader.
|
|
67
67
|
*
|
|
68
|
+
* Uses conditional exports to correctly set up `esm-env` as development by default,
|
|
69
|
+
* so if you want production set `NODE_ENV=production`.
|
|
70
|
+
*
|
|
71
|
+
* @see https://nodejs.org/api/packages.html#conditional-exports
|
|
72
|
+
*
|
|
68
73
|
* @param loader_path path to loader
|
|
69
74
|
* @param invoke_path path to file to spawn with `node`
|
|
70
75
|
*/
|
|
71
|
-
export const spawn_with_loader =
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
export const spawn_with_loader = (loader_path, invoke_path, argv) => {
|
|
77
|
+
const args = [
|
|
78
|
+
'--import',
|
|
79
|
+
// This does the same as `$lib/register.ts` but without the cost of importing another file.
|
|
80
|
+
`data:text/javascript,
|
|
74
81
|
import {register} from "node:module";
|
|
75
82
|
import {pathToFileURL} from "node:url";
|
|
76
83
|
register("${loader_path}", pathToFileURL("./"));`,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
'--enable-source-maps', // because TypeScript
|
|
85
|
+
];
|
|
86
|
+
// In almost all cases we want the exports condition to be `"development"`.
|
|
87
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
88
|
+
args.push('-C', 'development'); // same as `--conditions`
|
|
89
|
+
}
|
|
90
|
+
args.push(invoke_path, ...argv);
|
|
91
|
+
return spawn('node', args);
|
|
92
|
+
};
|
package/dist/package.d.ts
CHANGED
package/dist/package.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// generated by src/lib/package.gen.ts
|
|
2
2
|
export const package_json = {
|
|
3
3
|
name: '@ryanatkn/gro',
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.129.0',
|
|
5
5
|
description: 'task runner and toolkit extending SvelteKit',
|
|
6
6
|
motto: 'generate, run, optimize',
|
|
7
7
|
glyph: '🌰',
|
|
8
|
-
logo: '
|
|
8
|
+
logo: 'logo.svg',
|
|
9
9
|
logo_alt: 'a pixelated green oak acorn with a glint of sun',
|
|
10
10
|
public: true,
|
|
11
11
|
license: 'MIT',
|
|
@@ -38,6 +38,7 @@ export const package_json = {
|
|
|
38
38
|
chokidar: '^3.6.0',
|
|
39
39
|
dotenv: '^16.4.5',
|
|
40
40
|
'es-module-lexer': '^1.5.4',
|
|
41
|
+
'esm-env': '^1.0.0',
|
|
41
42
|
mri: '^1.2.0',
|
|
42
43
|
prettier: '^3.3.2',
|
|
43
44
|
'prettier-plugin-svelte': '^3.2.5',
|
|
@@ -50,8 +51,8 @@ export const package_json = {
|
|
|
50
51
|
'@changesets/changelog-git': '^0.2.0',
|
|
51
52
|
'@changesets/types': '^6.0.0',
|
|
52
53
|
'@ryanatkn/eslint-config': '^0.1.3',
|
|
53
|
-
'@ryanatkn/fuz': '^0.
|
|
54
|
-
'@ryanatkn/moss': '^0.6.
|
|
54
|
+
'@ryanatkn/fuz': '^0.107.0',
|
|
55
|
+
'@ryanatkn/moss': '^0.6.3',
|
|
55
56
|
'@sveltejs/adapter-static': '^3.0.2',
|
|
56
57
|
'@sveltejs/kit': '^2.5.18',
|
|
57
58
|
'@sveltejs/package': '^2.3.2',
|
|
@@ -262,7 +263,7 @@ export const package_json = {
|
|
|
262
263
|
};
|
|
263
264
|
export const src_json = {
|
|
264
265
|
name: '@ryanatkn/gro',
|
|
265
|
-
version: '0.
|
|
266
|
+
version: '0.129.0',
|
|
266
267
|
modules: {
|
|
267
268
|
'.': {
|
|
268
269
|
path: 'index.ts',
|
package/dist/reinstall.task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
3
|
-
import { rm } from 'fs/promises';
|
|
3
|
+
import { rm } from 'node:fs/promises';
|
|
4
4
|
import { Task_Error } from './task.js';
|
|
5
5
|
import { LOCKFILE_FILENAME, NODE_MODULES_DIRNAME } from './path_constants.js';
|
|
6
6
|
export const Args = z.object({}).strict();
|
package/dist/run.task.js
CHANGED
|
@@ -22,7 +22,7 @@ export const task = {
|
|
|
22
22
|
if (!existsSync(path)) {
|
|
23
23
|
throw new Task_Error('Cannot find file to run at path: ' + path);
|
|
24
24
|
}
|
|
25
|
-
const loader_path =
|
|
25
|
+
const loader_path = resolve_gro_module_path('loader.js');
|
|
26
26
|
const spawned = await spawn_with_loader(loader_path, path, argv);
|
|
27
27
|
if (!spawned.ok) {
|
|
28
28
|
throw new Task_Error(`\`gro run ${path}\` failed with exit code ${spawned.code}`);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
7
|
-
"logo": "
|
|
7
|
+
"logo": "logo.svg",
|
|
8
8
|
"logo_alt": "a pixelated green oak acorn with a glint of sun",
|
|
9
9
|
"public": true,
|
|
10
10
|
"license": "MIT",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"chokidar": "^3.6.0",
|
|
49
49
|
"dotenv": "^16.4.5",
|
|
50
50
|
"es-module-lexer": "^1.5.4",
|
|
51
|
+
"esm-env": "^1.0.0",
|
|
51
52
|
"mri": "^1.2.0",
|
|
52
53
|
"prettier": "^3.3.2",
|
|
53
54
|
"prettier-plugin-svelte": "^3.2.5",
|
|
@@ -63,8 +64,8 @@
|
|
|
63
64
|
"@changesets/changelog-git": "^0.2.0",
|
|
64
65
|
"@changesets/types": "^6.0.0",
|
|
65
66
|
"@ryanatkn/eslint-config": "^0.1.3",
|
|
66
|
-
"@ryanatkn/fuz": "^0.
|
|
67
|
-
"@ryanatkn/moss": "^0.6.
|
|
67
|
+
"@ryanatkn/fuz": "^0.107.0",
|
|
68
|
+
"@ryanatkn/moss": "^0.6.3",
|
|
68
69
|
"@sveltejs/adapter-static": "^3.0.2",
|
|
69
70
|
"@sveltejs/kit": "^2.5.18",
|
|
70
71
|
"@sveltejs/package": "^2.3.2",
|