@ryanatkn/gro 0.114.0 → 0.115.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 +3 -1
- package/dist/docs/gro_plugin_sveltekit_app.md +3 -3
- package/dist/docs/package_json.md +3 -3
- package/dist/gro_plugin_sveltekit_app.d.ts +2 -2
- package/dist/gro_plugin_sveltekit_app.js +4 -4
- package/dist/package.d.ts +1 -0
- package/dist/package.js +3 -2
- package/dist/package_json.d.ts +3 -0
- package/dist/package_json.js +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="static/favicon.png" align="right" width="192" height="192">
|
|
4
4
|
|
|
5
|
-
> task runner and toolkit extending SvelteKit
|
|
5
|
+
> task runner and toolkit extending SvelteKit 🌰 generate, run, optimize
|
|
6
|
+
|
|
7
|
+
[gro.ryanatkn.com](https://gro.ryanatkn.com/)
|
|
6
8
|
|
|
7
9
|
[`npm i -D @ryanatkn/gro`](https://www.npmjs.com/package/@ryanatkn/gro)
|
|
8
10
|
|
|
@@ -15,7 +15,7 @@ const config: Gro_ConfigCreator = async (cfg) => {
|
|
|
15
15
|
// host_target?: Host_Target;
|
|
16
16
|
// well_known_package_json?: boolean | Map_Package_Json;
|
|
17
17
|
// well_known_src_json?: boolean | Map_Src_Json;
|
|
18
|
-
//
|
|
18
|
+
// well_known_src_files?: boolean | Copy_File_Filter;
|
|
19
19
|
}),
|
|
20
20
|
];
|
|
21
21
|
return cfg;
|
|
@@ -102,12 +102,12 @@ The `.well-known/src.json` file contains more details about
|
|
|
102
102
|
the `package.json`'s `exports`, like exported identifier names and types.
|
|
103
103
|
It maps each export to a source file in `.well-known/src/`.
|
|
104
104
|
|
|
105
|
-
## `
|
|
105
|
+
## `well_known_src_files`
|
|
106
106
|
|
|
107
107
|
The contents of your `src/` directory can be included in the output
|
|
108
108
|
if you want your app's source code to be available the same as the built files.
|
|
109
109
|
This is disabled by default.
|
|
110
|
-
If `
|
|
110
|
+
If `well_known_src_files` is truthy,
|
|
111
111
|
the plugin copies `src/` to `static/.well-known/src/` during `vite build`.
|
|
112
112
|
Passing `true` uses the same filter as `exports` in `package.json` by default,
|
|
113
113
|
and it also accepts a custom filter function.
|
|
@@ -18,9 +18,9 @@ behavior designed for public open source projects:
|
|
|
18
18
|
containing additional information about the source modules,
|
|
19
19
|
mapping it with the optional
|
|
20
20
|
[`well_known_src_json` option](./gro_plugin_sveltekit_app.md#well_known_src_json).
|
|
21
|
-
- If you opt in with `
|
|
21
|
+
- If you opt in with `well_known_src_files`,
|
|
22
22
|
`gro_plugin_sveltekit_app` outputs `.well-known/src/` by
|
|
23
|
-
copying over `src/` during `vite build`, filtered by `
|
|
23
|
+
copying over `src/` during `vite build`, filtered by `well_known_src_files` if it's a function.
|
|
24
24
|
This is costly (usually more than doubling the final output size
|
|
25
25
|
of the code files in bytes, not counting images and such),
|
|
26
26
|
it slows the build because it copies your entire source tree (sorry to hard drives),
|
|
@@ -28,5 +28,5 @@ behavior designed for public open source projects:
|
|
|
28
28
|
|
|
29
29
|
> ⚠️ Setting `"public": true` in `package.json` exposes your `package.json`
|
|
30
30
|
> and `src.json` metadata with your other built files by default!
|
|
31
|
-
> Further opting in with `
|
|
31
|
+
> Further opting in with `well_known_src_files` exposes your actual source files.
|
|
32
32
|
> If your built files are public, that means these additional files are also public.
|
|
@@ -22,10 +22,10 @@ export interface Options {
|
|
|
22
22
|
* If truthy, copies `src/` to `/.well-known/src/` to the static output.
|
|
23
23
|
* Pass a function to customize which files get copied.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
well_known_src_files?: boolean | Copy_File_Filter;
|
|
26
26
|
}
|
|
27
27
|
export type Host_Target = 'github_pages' | 'static' | 'node';
|
|
28
28
|
export interface Copy_File_Filter {
|
|
29
29
|
(file_path: string): boolean | Promise<boolean>;
|
|
30
30
|
}
|
|
31
|
-
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json, well_known_src_json,
|
|
31
|
+
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json, well_known_src_json, well_known_src_files, }?: Options) => Plugin<Plugin_Context>;
|
|
@@ -11,7 +11,7 @@ import { serialize_src_json, create_src_json } from './src_json.js';
|
|
|
11
11
|
import { DEFAULT_EXPORTS_EXCLUDER } from './config.js';
|
|
12
12
|
import { SVELTEKIT_CONFIG_FILENAME } from './paths.js';
|
|
13
13
|
export const has_sveltekit_app = () => exists(SVELTEKIT_CONFIG_FILENAME);
|
|
14
|
-
export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json, well_known_src_json,
|
|
14
|
+
export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json, well_known_src_json, well_known_src_files, } = {}) => {
|
|
15
15
|
let sveltekit_process = null;
|
|
16
16
|
return {
|
|
17
17
|
name: 'gro_plugin_sveltekit_app',
|
|
@@ -65,10 +65,10 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
|
|
|
65
65
|
serialized_src_json
|
|
66
66
|
? await create_temporarily(join(assets_path, '.well-known/src.json'), serialized_src_json)
|
|
67
67
|
: null,
|
|
68
|
-
serialized_src_json &&
|
|
69
|
-
? await copy_temporarily('src', assets_path, '.well-known',
|
|
68
|
+
serialized_src_json && well_known_src_files
|
|
69
|
+
? await copy_temporarily('src', assets_path, '.well-known', well_known_src_files === true
|
|
70
70
|
? (file_path) => !DEFAULT_EXPORTS_EXCLUDER.test(file_path)
|
|
71
|
-
:
|
|
71
|
+
: well_known_src_files)
|
|
72
72
|
: null,
|
|
73
73
|
/**
|
|
74
74
|
* GitHub pages processes everything with Jekyll by default,
|
package/dist/package.d.ts
CHANGED
package/dist/package.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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.115.1',
|
|
5
5
|
description: 'task runner and toolkit extending SvelteKit',
|
|
6
|
+
motto: 'generate, run, optimize',
|
|
6
7
|
icon: '🌰',
|
|
7
8
|
public: true,
|
|
8
9
|
bin: { gro: 'dist/gro.js' },
|
|
@@ -235,7 +236,7 @@ export const package_json = {
|
|
|
235
236
|
};
|
|
236
237
|
export const src_json = {
|
|
237
238
|
name: '@ryanatkn/gro',
|
|
238
|
-
version: '0.
|
|
239
|
+
version: '0.115.1',
|
|
239
240
|
modules: {
|
|
240
241
|
'.': {
|
|
241
242
|
path: 'index.ts',
|
package/dist/package_json.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare const Package_Json: z.ZodIntersection<z.ZodRecord<z.ZodString, z.
|
|
|
51
51
|
icon: z.ZodOptional<z.ZodString>;
|
|
52
52
|
private: z.ZodOptional<z.ZodBoolean>;
|
|
53
53
|
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
motto: z.ZodOptional<z.ZodString>;
|
|
54
55
|
license: z.ZodOptional<z.ZodString>;
|
|
55
56
|
homepage: z.ZodOptional<z.ZodString>;
|
|
56
57
|
repository: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
@@ -141,6 +142,7 @@ export declare const Package_Json: z.ZodIntersection<z.ZodRecord<z.ZodString, z.
|
|
|
141
142
|
icon: z.ZodOptional<z.ZodString>;
|
|
142
143
|
private: z.ZodOptional<z.ZodBoolean>;
|
|
143
144
|
description: z.ZodOptional<z.ZodString>;
|
|
145
|
+
motto: z.ZodOptional<z.ZodString>;
|
|
144
146
|
license: z.ZodOptional<z.ZodString>;
|
|
145
147
|
homepage: z.ZodOptional<z.ZodString>;
|
|
146
148
|
repository: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
@@ -231,6 +233,7 @@ export declare const Package_Json: z.ZodIntersection<z.ZodRecord<z.ZodString, z.
|
|
|
231
233
|
icon: z.ZodOptional<z.ZodString>;
|
|
232
234
|
private: z.ZodOptional<z.ZodBoolean>;
|
|
233
235
|
description: z.ZodOptional<z.ZodString>;
|
|
236
|
+
motto: z.ZodOptional<z.ZodString>;
|
|
234
237
|
license: z.ZodOptional<z.ZodString>;
|
|
235
238
|
homepage: z.ZodOptional<z.ZodString>;
|
|
236
239
|
repository: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
package/dist/package_json.js
CHANGED
|
@@ -60,6 +60,7 @@ export const Package_Json = z.intersection(z.record(z.unknown()), z
|
|
|
60
60
|
icon: z.string({ description: 'a Gro extension' }).optional(), // TODO maybe base64 favicon?
|
|
61
61
|
private: z.boolean({ description: 'disallow npm publish' }).optional(),
|
|
62
62
|
description: z.string().optional(),
|
|
63
|
+
motto: z.string().optional(),
|
|
63
64
|
license: z.string().optional(),
|
|
64
65
|
homepage: Url.optional(),
|
|
65
66
|
repository: z.union([z.string(), Url, Package_Json_Repository]).optional(),
|