@ryanatkn/gro 0.112.0 → 0.112.2

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
@@ -54,9 +54,8 @@ export declare const package_json: {
54
54
  devDependencies: {
55
55
  '@changesets/changelog-git': string;
56
56
  '@changesets/types': string;
57
- '@feltjs/eslint-config': string;
58
- '@fuz.dev/fuz': string;
59
- '@fuz.dev/fuz_library': string;
57
+ '@ryanatkn/eslint-config': string;
58
+ '@ryanatkn/fuz': string;
60
59
  '@sveltejs/adapter-static': string;
61
60
  '@sveltejs/kit': string;
62
61
  '@sveltejs/package': string;
@@ -278,6 +277,10 @@ export declare const package_json: {
278
277
  default: string;
279
278
  types: string;
280
279
  };
280
+ './package_meta.js': {
281
+ default: string;
282
+ types: string;
283
+ };
281
284
  './package.gen.js': {
282
285
  default: string;
283
286
  types: string;
@@ -721,6 +724,13 @@ export declare const src_json: {
721
724
  kind: string;
722
725
  }[];
723
726
  };
727
+ './package_meta.js': {
728
+ path: string;
729
+ declarations: {
730
+ name: string;
731
+ kind: string;
732
+ }[];
733
+ };
724
734
  './package.gen.js': {
725
735
  path: string;
726
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.0',
4
+ version: '0.112.2',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  icon: '🌰',
7
7
  public: true,
@@ -31,14 +31,14 @@ export const package_json = {
31
31
  ],
32
32
  files: ['dist'],
33
33
  dependencies: {
34
- '@ryanatkn/belt': '^0.20.1',
35
- chokidar: '^3.5.3',
36
- dotenv: '^16.3.1',
34
+ '@ryanatkn/belt': '^0.20.3',
35
+ chokidar: '^3.6.0',
36
+ dotenv: '^16.4.4',
37
37
  'es-module-lexer': '^1.4.1',
38
38
  kleur: '^4.1.5',
39
39
  mri: '^1.2.0',
40
- prettier: '^3.1.1',
41
- 'prettier-plugin-svelte': '^3.1.2',
40
+ prettier: '^3.2.5',
41
+ 'prettier-plugin-svelte': '^3.2.1',
42
42
  'tiny-glob': '^0.2.9',
43
43
  'ts-morph': '^21.0.1',
44
44
  tslib: '^2.6.2',
@@ -48,26 +48,25 @@ export const package_json = {
48
48
  devDependencies: {
49
49
  '@changesets/changelog-git': '^0.2.0',
50
50
  '@changesets/types': '^6.0.0',
51
- '@feltjs/eslint-config': '^0.4.1',
52
- '@fuz.dev/fuz': '^0.81.0',
53
- '@fuz.dev/fuz_library': '^0.23.0',
51
+ '@ryanatkn/eslint-config': '^0.1.0',
52
+ '@ryanatkn/fuz': '^0.83.0',
54
53
  '@sveltejs/adapter-static': '^3.0.1',
55
- '@sveltejs/kit': '^2.0.6',
56
- '@sveltejs/package': '^2.2.5',
57
- '@sveltejs/vite-plugin-svelte': '^3.0.1',
54
+ '@sveltejs/kit': '^2.5.0',
55
+ '@sveltejs/package': '^2.2.6',
56
+ '@sveltejs/vite-plugin-svelte': '^3.0.2',
58
57
  '@types/fs-extra': '^11.0.4',
59
- '@types/node': '^20.10.6',
60
- '@typescript-eslint/eslint-plugin': '^6.17.0',
61
- '@typescript-eslint/parser': '^6.17.0',
62
- esbuild: '^0.19.11',
58
+ '@types/node': '^20.11.19',
59
+ '@typescript-eslint/eslint-plugin': '^7.0.1',
60
+ '@typescript-eslint/parser': '^7.0.1',
61
+ esbuild: '^0.19.0',
63
62
  eslint: '^8.56.0',
64
63
  'eslint-plugin-svelte': '^2.35.1',
65
- svelte: '^4.2.8',
66
- 'svelte-check': '^3.6.2',
64
+ svelte: '^4.2.11',
65
+ 'svelte-check': '^3.6.4',
67
66
  typescript: '^5.3.3',
68
67
  uvu: '^0.5.6',
69
68
  },
70
- eslintConfig: { root: true, extends: '@feltjs', rules: { 'no-console': 1 } },
69
+ eslintConfig: { root: true, extends: '@ryanatkn', rules: { 'no-console': 1 } },
71
70
  prettier: {
72
71
  plugins: ['prettier-plugin-svelte'],
73
72
  useTabs: true,
@@ -165,6 +164,7 @@ export const package_json = {
165
164
  './module.js': { default: './dist/module.js', types: './dist/module.d.ts' },
166
165
  './modules.js': { default: './dist/modules.js', types: './dist/modules.d.ts' },
167
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' },
168
168
  './package.gen.js': { default: './dist/package.gen.js', types: './dist/package.gen.d.ts' },
169
169
  './package.js': { default: './dist/package.js', types: './dist/package.d.ts' },
170
170
  './path.js': { default: './dist/path.js', types: './dist/path.d.ts' },
@@ -233,7 +233,7 @@ export const package_json = {
233
233
  };
234
234
  export const src_json = {
235
235
  name: '@ryanatkn/gro',
236
- version: '0.112.0',
236
+ version: '0.112.2',
237
237
  modules: {
238
238
  '.': {
239
239
  path: 'index.ts',
@@ -605,6 +605,16 @@ export const src_json = {
605
605
  { name: 'parse_repo_url', kind: 'function' },
606
606
  ],
607
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
+ },
608
618
  './package.gen.js': { path: 'package.gen.ts', declarations: [{ name: 'gen', kind: 'function' }] },
609
619
  './package.js': {
610
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
+ };
@@ -3,15 +3,15 @@ import * as assert from 'uvu/assert';
3
3
  import { resolve_node_specifier } from './resolve_node_specifier.js';
4
4
  import { paths } from './paths.js';
5
5
  test('resolves a JS specifier', async () => {
6
- assert.is(await resolve_node_specifier('@fuz.dev/fuz_library/tome.js'), paths.root + 'node_modules/@fuz.dev/fuz_library/dist/tome.js');
6
+ assert.is(await resolve_node_specifier('@ryanatkn/fuz/tome.js'), paths.root + 'node_modules/@ryanatkn/fuz/dist/tome.js');
7
7
  });
8
8
  test('resolves a Svelte specifier', async () => {
9
- assert.is(await resolve_node_specifier('@fuz.dev/fuz_library/Library.svelte'), paths.root + 'node_modules/@fuz.dev/fuz_library/dist/Library.svelte');
9
+ assert.is(await resolve_node_specifier('@ryanatkn/fuz/Library.svelte'), paths.root + 'node_modules/@ryanatkn/fuz/dist/Library.svelte');
10
10
  });
11
11
  test('throws for a specifier that does not exist', async () => {
12
12
  let err;
13
13
  try {
14
- await resolve_node_specifier('@fuz.dev/fuz_library/this_does_not_exist');
14
+ await resolve_node_specifier('@ryanatkn/fuz/this_does_not_exist');
15
15
  }
16
16
  catch (_err) {
17
17
  err = _err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.112.0",
3
+ "version": "0.112.2",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "icon": "🌰",
6
6
  "public": true,
@@ -46,14 +46,14 @@
46
46
  "dist"
47
47
  ],
48
48
  "dependencies": {
49
- "@ryanatkn/belt": "^0.20.1",
50
- "chokidar": "^3.5.3",
51
- "dotenv": "^16.3.1",
49
+ "@ryanatkn/belt": "^0.20.3",
50
+ "chokidar": "^3.6.0",
51
+ "dotenv": "^16.4.4",
52
52
  "es-module-lexer": "^1.4.1",
53
53
  "kleur": "^4.1.5",
54
54
  "mri": "^1.2.0",
55
- "prettier": "^3.1.1",
56
- "prettier-plugin-svelte": "^3.1.2",
55
+ "prettier": "^3.2.5",
56
+ "prettier-plugin-svelte": "^3.2.1",
57
57
  "tiny-glob": "^0.2.9",
58
58
  "ts-morph": "^21.0.1",
59
59
  "tslib": "^2.6.2",
@@ -66,28 +66,27 @@
66
66
  "devDependencies": {
67
67
  "@changesets/changelog-git": "^0.2.0",
68
68
  "@changesets/types": "^6.0.0",
69
- "@feltjs/eslint-config": "^0.4.1",
70
- "@fuz.dev/fuz": "^0.81.0",
71
- "@fuz.dev/fuz_library": "^0.23.0",
69
+ "@ryanatkn/eslint-config": "^0.1.0",
70
+ "@ryanatkn/fuz": "^0.83.0",
72
71
  "@sveltejs/adapter-static": "^3.0.1",
73
- "@sveltejs/kit": "^2.0.6",
74
- "@sveltejs/package": "^2.2.5",
75
- "@sveltejs/vite-plugin-svelte": "^3.0.1",
72
+ "@sveltejs/kit": "^2.5.0",
73
+ "@sveltejs/package": "^2.2.6",
74
+ "@sveltejs/vite-plugin-svelte": "^3.0.2",
76
75
  "@types/fs-extra": "^11.0.4",
77
- "@types/node": "^20.10.6",
78
- "@typescript-eslint/eslint-plugin": "^6.17.0",
79
- "@typescript-eslint/parser": "^6.17.0",
80
- "esbuild": "^0.19.11",
76
+ "@types/node": "^20.11.19",
77
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
78
+ "@typescript-eslint/parser": "^7.0.1",
79
+ "esbuild": "^0.19.0",
81
80
  "eslint": "^8.56.0",
82
81
  "eslint-plugin-svelte": "^2.35.1",
83
- "svelte": "^4.2.8",
84
- "svelte-check": "^3.6.2",
82
+ "svelte": "^4.2.11",
83
+ "svelte-check": "^3.6.4",
85
84
  "typescript": "^5.3.3",
86
85
  "uvu": "^0.5.6"
87
86
  },
88
87
  "eslintConfig": {
89
88
  "root": true,
90
- "extends": "@feltjs",
89
+ "extends": "@ryanatkn",
91
90
  "rules": {
92
91
  "no-console": 1
93
92
  }
@@ -294,6 +293,10 @@
294
293
  "default": "./dist/package_json.js",
295
294
  "types": "./dist/package_json.d.ts"
296
295
  },
296
+ "./package_meta.js": {
297
+ "default": "./dist/package_meta.js",
298
+ "types": "./dist/package_meta.d.ts"
299
+ },
297
300
  "./package.gen.js": {
298
301
  "default": "./dist/package.gen.js",
299
302
  "types": "./dist/package.gen.d.ts"