@dephub/slug 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 CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  [![NPM version](https://img.shields.io/npm/v/@dephub/slug.svg?style=flat)](https://npmjs.org/package/@dephub/slug)
6
6
  [![ESM-only](https://img.shields.io/badge/ESM-only-brightgreen?style=flat)](https://nodejs.org/)
7
- [![Node.js version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
8
7
 
9
8
  ---
10
9
 
package/dist/cli.js CHANGED
@@ -1,33 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
  import { cli as a } from "@dephub/cli";
3
- import { log as l, error as n, success as c } from "@dephub/log";
4
- import { compare as p } from "./core/compare.js";
5
- import { slug as m } from "./core/slug.js";
6
- import { isSlug as g } from "./core/valid.js";
7
- import { name as u, version as f, description as d } from "./utils/pkg.js";
8
- a.name(u.split("/")[1] ?? "slug").version(f).description(d);
9
- a.command("generate", "Convert string to URL-friendly slug").argument("<input>", "Input string to convert").option("--separator", 'Separator character (default: "-")').flag("--no-lowercase", "Keep original case").option("--fallback", "Fallback text if result is empty").action(({ args: r, options: e, flags: o }) => {
10
- const [s] = r;
3
+ import { logger as e } from "@dephub/logger";
4
+ import { compare as c } from "./core/compare.js";
5
+ import { slug as l } from "./core/slug.js";
6
+ import { isSlug as p } from "./core/valid.js";
7
+ import { name as g, version as m, description as u } from "./utils/pkg.js";
8
+ a.name(g.split("/")[1] ?? "slug").version(m).description(u);
9
+ a.command("generate", "Convert string to URL-friendly slug").argument("<input>", "Input string to convert").option("--separator", 'Separator character (default: "-")').flag("--no-lowercase", "Keep original case").option("--fallback", "Fallback text if result is empty").action(({ args: o, options: r, flags: s }) => {
10
+ const [i] = o;
11
11
  try {
12
12
  const t = {
13
- fallback: e.fallback,
14
- lowercase: o.lowercase,
15
- separator: e.separator
16
- }, i = m(s, t);
17
- l(i);
13
+ fallback: r.fallback,
14
+ lowercase: s.lowercase,
15
+ separator: r.separator
16
+ }, n = l(i, t);
17
+ e.log(n);
18
18
  } catch (t) {
19
- n(t.message), process.exit(1);
19
+ e.error(t.message), process.exit(1);
20
20
  }
21
21
  });
22
- a.command("validate", "Check if string is valid slug format").argument("<input>", "String to validate").action(({ args: r }) => {
23
- const [e] = r;
24
- g(e) ? c("Valid slug format") : (n("Invalid slug format"), process.exit(1));
22
+ a.command("validate", "Check if string is valid slug format").argument("<input>", "String to validate").action(({ args: o }) => {
23
+ const [r] = o;
24
+ p(r) ? e.success("Valid slug format") : (e.error("Invalid slug format"), process.exit(1));
25
25
  });
26
- a.command("compare", "Compare two strings by slugified versions").argument("<first>", "First string to compare").argument("<second>", "Second string to compare").option("--separator", "Separator character").flag("--no-lowercase", "Keep original case").action(({ args: r, options: e, flags: o }) => {
27
- const [s, t] = r, i = {
28
- lowercase: o.lowercase,
29
- separator: e.separator
26
+ a.command("compare", "Compare two strings by slugified versions").argument("<first>", "First string to compare").argument("<second>", "Second string to compare").option("--separator", "Separator character").flag("--no-lowercase", "Keep original case").action(({ args: o, options: r, flags: s }) => {
27
+ const [i, t] = o, n = {
28
+ lowercase: s.lowercase,
29
+ separator: r.separator
30
30
  };
31
- p(s, t, i) ? c("Strings are equivalent when slugified") : (n("Strings are different when slugified"), process.exit(1));
31
+ c(i, t, n) ? e.success("Strings are equivalent when slugified") : (e.error("Strings are different when slugified"), process.exit(1));
32
32
  });
33
33
  await a.run();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export { compare } from './core/compare.js';
2
2
  export { slug, type SlugOptions } from './core/slug.js';
3
- export { slug as default } from './core/slug.js';
4
3
  export { isSlug } from './core/valid.js';
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { compare as e } from "./core/compare.js";
2
- import { slug as l, slug as m } from "./core/slug.js";
3
- import { isSlug as s } from "./core/valid.js";
2
+ import { slug as p } from "./core/slug.js";
3
+ import { isSlug as t } from "./core/valid.js";
4
4
  export {
5
5
  e as compare,
6
- l as default,
7
- s as isSlug,
8
- m as slug
6
+ t as isSlug,
7
+ p as slug
9
8
  };
@@ -1,4 +1,4 @@
1
- const n = "@dephub/slug", o = "1.0.0", s = "URL-friendly slug generator with semantic comparison and validation", t = {
1
+ const n = "@dephub/slug", o = "1.0.1", s = "URL-friendly slug generator with semantic comparison and validation", t = {
2
2
  name: n,
3
3
  version: o,
4
4
  description: s
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dephub/slug",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "URL-friendly slug generator with semantic comparison and validation",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",
@@ -34,21 +34,31 @@
34
34
  "dist"
35
35
  ],
36
36
  "license": "MIT",
37
- "homepage": "https://github.com/dephubjs/slug#readme",
37
+ "homepage": "https://github.com/estarlincito/dephub-slug#readme",
38
38
  "repository": {
39
39
  "type": "git",
40
- "url": "https://github.com/dephubjs/slug.git",
41
- "directory": "packages/slug"
40
+ "url": "https://github.com/estarlincito/dephub-slug.git"
42
41
  },
43
42
  "bugs": {
44
- "url": "https://github.com/dephubjs/slug/issues"
43
+ "url": "https://github.com/estarlincito/dephub-slug/issues"
45
44
  },
46
45
  "publishConfig": {
47
46
  "access": "public"
48
47
  },
49
48
  "dependencies": {
50
49
  "@dephub/cli": "^1.0.0",
51
- "@dephub/log": "^1.0.0"
50
+ "@dephub/logger": "^1.1.0"
51
+ },
52
+ "devDependencies": {
53
+ "@dephub/glob": "^1.0.0",
54
+ "@dephub/lint": "^1.0.0",
55
+ "@dephub/lint-ts": "^1.0.0",
56
+ "@dephub/path": "^1.0.0",
57
+ "@types/node": "^24.3.1",
58
+ "eslint": "^9.37.0",
59
+ "typescript": "^5.9.2",
60
+ "vite": "^7.1.4",
61
+ "vite-plugin-dts": "^4.5.4"
52
62
  },
53
63
  "scripts": {
54
64
  "release": "pnpm publish",