@ryanatkn/gro 0.112.1 → 0.112.3

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/dist/package.d.ts CHANGED
@@ -277,6 +277,10 @@ export declare const package_json: {
277
277
  default: string;
278
278
  types: string;
279
279
  };
280
+ './package_meta.js': {
281
+ default: string;
282
+ types: string;
283
+ };
280
284
  './package.gen.js': {
281
285
  default: string;
282
286
  types: string;
@@ -720,6 +724,13 @@ export declare const src_json: {
720
724
  kind: string;
721
725
  }[];
722
726
  };
727
+ './package_meta.js': {
728
+ path: string;
729
+ declarations: {
730
+ name: string;
731
+ kind: string;
732
+ }[];
733
+ };
723
734
  './package.gen.js': {
724
735
  path: string;
725
736
  declarations: {
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // generated by src/lib/package.gen.ts
2
2
  export const package_json = {
3
3
  name: '@ryanatkn/gro',
4
- version: '0.112.1',
4
+ version: '0.112.3',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  icon: '🌰',
7
7
  public: true,
@@ -31,9 +31,9 @@ export const package_json = {
31
31
  ],
32
32
  files: ['dist'],
33
33
  dependencies: {
34
- '@ryanatkn/belt': '^0.20.3',
34
+ '@ryanatkn/belt': '^0.20.4',
35
35
  chokidar: '^3.6.0',
36
- dotenv: '^16.4.4',
36
+ dotenv: '^16.4.5',
37
37
  'es-module-lexer': '^1.4.1',
38
38
  kleur: '^4.1.5',
39
39
  mri: '^1.2.0',
@@ -49,19 +49,19 @@ export const package_json = {
49
49
  '@changesets/changelog-git': '^0.2.0',
50
50
  '@changesets/types': '^6.0.0',
51
51
  '@ryanatkn/eslint-config': '^0.1.0',
52
- '@ryanatkn/fuz': '^0.83.0',
52
+ '@ryanatkn/fuz': '^0.88.0',
53
53
  '@sveltejs/adapter-static': '^3.0.1',
54
- '@sveltejs/kit': '^2.5.0',
55
- '@sveltejs/package': '^2.2.6',
54
+ '@sveltejs/kit': '^2.5.1',
55
+ '@sveltejs/package': '^2.2.7',
56
56
  '@sveltejs/vite-plugin-svelte': '^3.0.2',
57
57
  '@types/fs-extra': '^11.0.4',
58
- '@types/node': '^20.11.19',
59
- '@typescript-eslint/eslint-plugin': '^7.0.1',
60
- '@typescript-eslint/parser': '^7.0.1',
58
+ '@types/node': '^20.11.20',
59
+ '@typescript-eslint/eslint-plugin': '^7.0.2',
60
+ '@typescript-eslint/parser': '^7.0.2',
61
61
  esbuild: '^0.19.0',
62
- eslint: '^8.56.0',
62
+ eslint: '^8.57.0',
63
63
  'eslint-plugin-svelte': '^2.35.1',
64
- svelte: '^4.2.11',
64
+ svelte: '^4.2.12',
65
65
  'svelte-check': '^3.6.4',
66
66
  typescript: '^5.3.3',
67
67
  uvu: '^0.5.6',
@@ -164,6 +164,7 @@ export const package_json = {
164
164
  './module.js': { default: './dist/module.js', types: './dist/module.d.ts' },
165
165
  './modules.js': { default: './dist/modules.js', types: './dist/modules.d.ts' },
166
166
  './package_json.js': { default: './dist/package_json.js', types: './dist/package_json.d.ts' },
167
+ './package_meta.js': { default: './dist/package_meta.js', types: './dist/package_meta.d.ts' },
167
168
  './package.gen.js': { default: './dist/package.gen.js', types: './dist/package.gen.d.ts' },
168
169
  './package.js': { default: './dist/package.js', types: './dist/package.d.ts' },
169
170
  './path.js': { default: './dist/path.js', types: './dist/path.d.ts' },
@@ -232,7 +233,7 @@ export const package_json = {
232
233
  };
233
234
  export const src_json = {
234
235
  name: '@ryanatkn/gro',
235
- version: '0.112.1',
236
+ version: '0.112.3',
236
237
  modules: {
237
238
  '.': {
238
239
  path: 'index.ts',
@@ -604,6 +605,16 @@ export const src_json = {
604
605
  { name: 'parse_repo_url', kind: 'function' },
605
606
  ],
606
607
  },
608
+ './package_meta.js': {
609
+ path: 'package_meta.ts',
610
+ declarations: [
611
+ { name: 'Package_Meta', kind: 'type' },
612
+ { name: 'parse_package_meta', kind: 'function' },
613
+ { name: 'parse_repo_name', kind: 'function' },
614
+ { name: 'format_host', kind: 'function' },
615
+ { name: 'parse_org_url', kind: 'function' },
616
+ ],
617
+ },
607
618
  './package.gen.js': { path: 'package.gen.ts', declarations: [{ name: 'gen', kind: 'function' }] },
608
619
  './package.js': {
609
620
  path: 'package.ts',
@@ -0,0 +1,23 @@
1
+ import type { Package_Json } from './package_json.js';
2
+ import type { Src_Json } from './src_json.js';
3
+ import type { Url } from './paths.js';
4
+ export interface Package_Meta {
5
+ url: Url;
6
+ package_json: Package_Json;
7
+ src_json: Src_Json;
8
+ name: string;
9
+ repo_name: string;
10
+ repo_url: Url | null;
11
+ /**
12
+ * the is the github user/org, not npm
13
+ */
14
+ owner_name: string | null;
15
+ homepage_url: Url | null;
16
+ npm_url: Url | null;
17
+ changelog_url: Url | null;
18
+ published: boolean;
19
+ }
20
+ export declare const parse_package_meta: (url: Flavored<string, "Url">, package_json: Package_Json, src_json: Src_Json) => Package_Meta;
21
+ export declare const parse_repo_name: (name: string) => string;
22
+ export declare const format_host: (url: string) => string;
23
+ export declare const parse_org_url: (pkg: Package_Meta) => string | null;
@@ -0,0 +1,48 @@
1
+ import { strip_start, strip_end } from '@ryanatkn/belt/string.js';
2
+ export const parse_package_meta = (url, package_json, src_json) => {
3
+ const { name } = package_json;
4
+ // TODO hacky
5
+ const parse_repo = (r) => {
6
+ if (!r)
7
+ return null;
8
+ return strip_end(strip_start(strip_end(r, '.git'), 'git+'), '/');
9
+ };
10
+ const repo_url = parse_repo(package_json.repository
11
+ ? typeof package_json.repository === 'string'
12
+ ? package_json.repository
13
+ : package_json.repository.url
14
+ : null);
15
+ const homepage_url = package_json.homepage ?? null;
16
+ const published = !package_json.private && !!package_json.exports && package_json.version !== '0.0.1';
17
+ // TODO generic registries
18
+ const npm_url = published ? 'https://www.npmjs.com/package/' + package_json.name : null;
19
+ const changelog_url = published && repo_url ? repo_url + '/blob/main/CHANGELOG.md' : null;
20
+ const repo_name = parse_repo_name(name);
21
+ const owner_name = repo_url ? strip_start(repo_url, 'https://github.com/').split('/')[0] : null;
22
+ return {
23
+ url,
24
+ package_json,
25
+ src_json,
26
+ name,
27
+ repo_name,
28
+ repo_url,
29
+ owner_name,
30
+ homepage_url,
31
+ npm_url,
32
+ changelog_url,
33
+ published,
34
+ };
35
+ };
36
+ // TODO proper parsing
37
+ export const parse_repo_name = (name) => name[0] === '@' ? name.split('/')[1] : name;
38
+ export const format_host = (url) => strip_start(new URL(url).host, 'www.');
39
+ export const parse_org_url = (pkg) => {
40
+ const { repo_name, repo_url } = pkg;
41
+ if (!repo_url)
42
+ return null;
43
+ const suffix = '/' + repo_name;
44
+ if (repo_url.endsWith(suffix)) {
45
+ return strip_end(repo_url, suffix);
46
+ }
47
+ return null;
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.112.1",
3
+ "version": "0.112.3",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "icon": "🌰",
6
6
  "public": true,
@@ -46,9 +46,9 @@
46
46
  "dist"
47
47
  ],
48
48
  "dependencies": {
49
- "@ryanatkn/belt": "^0.20.3",
49
+ "@ryanatkn/belt": "^0.20.4",
50
50
  "chokidar": "^3.6.0",
51
- "dotenv": "^16.4.4",
51
+ "dotenv": "^16.4.5",
52
52
  "es-module-lexer": "^1.4.1",
53
53
  "kleur": "^4.1.5",
54
54
  "mri": "^1.2.0",
@@ -67,19 +67,19 @@
67
67
  "@changesets/changelog-git": "^0.2.0",
68
68
  "@changesets/types": "^6.0.0",
69
69
  "@ryanatkn/eslint-config": "^0.1.0",
70
- "@ryanatkn/fuz": "^0.83.0",
70
+ "@ryanatkn/fuz": "^0.88.0",
71
71
  "@sveltejs/adapter-static": "^3.0.1",
72
- "@sveltejs/kit": "^2.5.0",
73
- "@sveltejs/package": "^2.2.6",
72
+ "@sveltejs/kit": "^2.5.1",
73
+ "@sveltejs/package": "^2.2.7",
74
74
  "@sveltejs/vite-plugin-svelte": "^3.0.2",
75
75
  "@types/fs-extra": "^11.0.4",
76
- "@types/node": "^20.11.19",
77
- "@typescript-eslint/eslint-plugin": "^7.0.1",
78
- "@typescript-eslint/parser": "^7.0.1",
76
+ "@types/node": "^20.11.20",
77
+ "@typescript-eslint/eslint-plugin": "^7.0.2",
78
+ "@typescript-eslint/parser": "^7.0.2",
79
79
  "esbuild": "^0.19.0",
80
- "eslint": "^8.56.0",
80
+ "eslint": "^8.57.0",
81
81
  "eslint-plugin-svelte": "^2.35.1",
82
- "svelte": "^4.2.11",
82
+ "svelte": "^4.2.12",
83
83
  "svelte-check": "^3.6.4",
84
84
  "typescript": "^5.3.3",
85
85
  "uvu": "^0.5.6"
@@ -293,6 +293,10 @@
293
293
  "default": "./dist/package_json.js",
294
294
  "types": "./dist/package_json.d.ts"
295
295
  },
296
+ "./package_meta.js": {
297
+ "default": "./dist/package_meta.js",
298
+ "types": "./dist/package_meta.d.ts"
299
+ },
296
300
  "./package.gen.js": {
297
301
  "default": "./dist/package.gen.js",
298
302
  "types": "./dist/package.gen.d.ts"