@uxfront/layer-docs 0.4.1 → 0.5.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.
Files changed (99) hide show
  1. package/README.md +31 -220
  2. package/app/app.config.ts +8 -92
  3. package/app/components/content/FrameworkSwitcher.vue +66 -40
  4. package/app/components/docs/DocsAsideLeftTop.vue +9 -15
  5. package/app/components/docs/DocsFrameworkSelect.vue +4 -7
  6. package/app/composables/useFramework.ts +30 -38
  7. package/nuxt.config.ts +14 -170
  8. package/package.json +10 -77
  9. package/CHANGELOG.md +0 -192
  10. package/LICENSE +0 -21
  11. package/app/app.vue +0 -138
  12. package/app/assets/css/main.css +0 -15
  13. package/app/components/IconMenuToggle.vue +0 -92
  14. package/app/components/LanguageSelect.vue +0 -73
  15. package/app/components/MorphingGradientBackground.vue +0 -261
  16. package/app/components/OgImage/OgImageDocs.satori.vue +0 -40
  17. package/app/components/OgImage/OgImageLanding.satori.vue +0 -41
  18. package/app/components/app/AppFooter.vue +0 -13
  19. package/app/components/app/AppFooterCenter.vue +0 -17
  20. package/app/components/app/AppFooterLeft.vue +0 -21
  21. package/app/components/app/AppFooterRight.vue +0 -33
  22. package/app/components/app/AppHeader.vue +0 -123
  23. package/app/components/app/AppHeaderAttribution.vue +0 -45
  24. package/app/components/app/AppHeaderBody.vue +0 -14
  25. package/app/components/app/AppHeaderCTA.vue +0 -31
  26. package/app/components/app/AppHeaderCenter.vue +0 -10
  27. package/app/components/app/AppHeaderLogo.vue +0 -16
  28. package/app/components/app/AppOgDecoration.vue +0 -27
  29. package/app/components/app/AppOgLogo.vue +0 -19
  30. package/app/components/app/AppSearch.vue +0 -59
  31. package/app/components/app/AppSubHeader.vue +0 -21
  32. package/app/components/content/BrowserFrame.vue +0 -28
  33. package/app/components/content/GradientPageHero.vue +0 -35
  34. package/app/components/content/StorybookEmbed.vue +0 -160
  35. package/app/components/content/Video.vue +0 -103
  36. package/app/components/docs/DocsAsideLeftBody.vue +0 -20
  37. package/app/components/docs/DocsAsideRightBottom.vue +0 -15
  38. package/app/components/docs/DocsPageHeaderLinks.vue +0 -75
  39. package/app/composables/useDocsSections.ts +0 -57
  40. package/app/composables/useDocusI18n.ts +0 -49
  41. package/app/constants/sections.ts +0 -25
  42. package/app/error.vue +0 -140
  43. package/app/layouts/default.vue +0 -24
  44. package/app/pages/[[lang]]/[...slug].vue +0 -58
  45. package/app/pages/[[lang]]/docs/[section]/[...slug].vue +0 -180
  46. package/app/plugins/i18n.ts +0 -21
  47. package/app/plugins/posthog.client.ts +0 -56
  48. package/app/types/non-route-categories.ts +0 -12
  49. package/app/utils/flattenNavigation.ts +0 -22
  50. package/app/utils/foldNonRouteCategories.ts +0 -47
  51. package/app/utils/prerender.ts +0 -9
  52. package/app/utils/storybookEmbed.test.ts +0 -98
  53. package/app/utils/storybookEmbed.ts +0 -93
  54. package/i18n/locales/ar.json +0 -24
  55. package/i18n/locales/be.json +0 -24
  56. package/i18n/locales/bn.json +0 -24
  57. package/i18n/locales/ca.json +0 -24
  58. package/i18n/locales/ckb.json +0 -24
  59. package/i18n/locales/cs.json +0 -24
  60. package/i18n/locales/da.json +0 -24
  61. package/i18n/locales/de.json +0 -24
  62. package/i18n/locales/el.json +0 -24
  63. package/i18n/locales/en.json +0 -24
  64. package/i18n/locales/et.json +0 -24
  65. package/i18n/locales/fr.json +0 -24
  66. package/i18n/locales/he.json +0 -24
  67. package/i18n/locales/hi.json +0 -24
  68. package/i18n/locales/hy.json +0 -24
  69. package/i18n/locales/it.json +0 -24
  70. package/i18n/locales/ja.json +0 -24
  71. package/i18n/locales/kk.json +0 -24
  72. package/i18n/locales/km.json +0 -24
  73. package/i18n/locales/ko.json +0 -24
  74. package/i18n/locales/ky.json +0 -24
  75. package/i18n/locales/lb.json +0 -24
  76. package/i18n/locales/ms.json +0 -24
  77. package/i18n/locales/nb.json +0 -24
  78. package/i18n/locales/pl.json +0 -24
  79. package/i18n/locales/ru.json +0 -24
  80. package/i18n/locales/sl.json +0 -24
  81. package/i18n/locales/sv.json +0 -24
  82. package/i18n/locales/uk.json +0 -24
  83. package/i18n/locales/ur.json +0 -24
  84. package/i18n/locales/vi.json +0 -24
  85. package/modules/config.ts +0 -144
  86. package/modules/optimizeDeps.ts +0 -45
  87. package/modules/routing.ts +0 -20
  88. package/nuxt.schema.ts +0 -374
  89. package/server/plugins/llms-redirect.ts +0 -60
  90. package/server/routes/raw/[...slug].md.get.ts +0 -74
  91. package/storybook/index.test.ts +0 -110
  92. package/storybook/index.ts +0 -362
  93. package/test/brand-palette.ts +0 -235
  94. package/test/no-brand-leakage.test.ts +0 -124
  95. package/tsconfig.json +0 -17
  96. package/utils/accent.ts +0 -80
  97. package/utils/content.ts +0 -193
  98. package/utils/git.ts +0 -114
  99. package/utils/meta.ts +0 -28
package/utils/git.ts DELETED
@@ -1,114 +0,0 @@
1
- import { execSync } from "node:child_process";
2
- import { readGitConfig } from "pkg-types";
3
- import gitUrlParse from "git-url-parse";
4
-
5
- export interface GitInfo {
6
- // Repository name
7
- name: string;
8
- // Repository owner/organization
9
- owner: string;
10
- // Repository URL
11
- url: string;
12
- }
13
-
14
- export function getGitBranch() {
15
- const envName =
16
- process.env.CF_PAGES_BRANCH ||
17
- process.env.CI_COMMIT_BRANCH ||
18
- process.env.VERCEL_GIT_COMMIT_REF ||
19
- process.env.BRANCH ||
20
- process.env.GITHUB_REF_NAME;
21
-
22
- if (envName && envName !== "HEAD") {
23
- return envName;
24
- }
25
- try {
26
- const branch = execSync("git rev-parse --abbrev-ref HEAD", {
27
- stdio: ["ignore", "pipe", "ignore"],
28
- })
29
- .toString()
30
- .trim();
31
- if (branch && branch !== "HEAD") {
32
- return branch;
33
- }
34
- } catch {
35
- // Ignore error
36
- }
37
-
38
- return "main";
39
- }
40
-
41
- export async function getLocalGitInfo(rootDir: string): Promise<GitInfo | undefined> {
42
- const remote = await getLocalGitRemote(rootDir);
43
- if (!remote) {
44
- return;
45
- }
46
-
47
- // https://www.npmjs.com/package/git-url-parse#clipboard-example
48
- const { name, owner, source } = gitUrlParse(remote);
49
- const url = `https://${source}/${owner}/${name}`;
50
-
51
- return {
52
- name,
53
- owner,
54
- url,
55
- };
56
- }
57
-
58
- async function getLocalGitRemote(dir: string): Promise<string | undefined> {
59
- try {
60
- const parsed = await readGitConfig(dir);
61
- if (!parsed) {
62
- return;
63
- }
64
- return parsed.remote?.["origin"]?.url;
65
- } catch {
66
- // Ignore error
67
- }
68
- }
69
-
70
- export function getGitEnv(): GitInfo {
71
- // https://github.com/unjs/std-env/issues/59
72
- const envInfo = {
73
- // Provider
74
- provider:
75
- process.env.VERCEL_GIT_PROVIDER || // vercel
76
- (process.env.GITHUB_SERVER_URL ? "github" : undefined) || // github
77
- "",
78
- // Owner
79
- owner:
80
- process.env.VERCEL_GIT_REPO_OWNER || // vercel
81
- process.env.GITHUB_REPOSITORY_OWNER || // github
82
- process.env.CI_PROJECT_PATH?.split("/").shift() || // gitlab
83
- "",
84
- // Name
85
- name:
86
- process.env.VERCEL_GIT_REPO_SLUG ||
87
- process.env.GITHUB_REPOSITORY?.split("/").pop() || // github
88
- process.env.CI_PROJECT_PATH?.split("/").splice(1).join("/") || // gitlab
89
- "",
90
- // Url
91
- url: process.env.REPOSITORY_URL || "", // netlify
92
- };
93
-
94
- if (!envInfo.url && envInfo.provider && envInfo.owner && envInfo.name) {
95
- envInfo.url = `https://${envInfo.provider}.com/${envInfo.owner}/${envInfo.name}`;
96
- }
97
-
98
- // If only url available (ex: Netlify)
99
- if (!envInfo.name && !envInfo.owner && envInfo.url) {
100
- try {
101
- const { name, owner } = gitUrlParse(envInfo.url);
102
- envInfo.name = name;
103
- envInfo.owner = owner;
104
- } catch {
105
- // Ignore error
106
- }
107
- }
108
-
109
- return {
110
- name: envInfo.name,
111
- owner: envInfo.owner,
112
- url: envInfo.url,
113
- };
114
- }
package/utils/meta.ts DELETED
@@ -1,28 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { resolve } from "node:path";
3
-
4
- export function inferSiteURL() {
5
- // https://github.com/unjs/std-env/issues/59
6
- return (
7
- process.env.NUXT_SITE_URL ||
8
- (process.env.NEXT_PUBLIC_VERCEL_URL && `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`) || // Vercel
9
- process.env.URL || // Netlify
10
- process.env.CI_PAGES_URL || // Gitlab Pages
11
- process.env.CF_PAGES_URL // Cloudflare Pages
12
- );
13
- }
14
-
15
- export async function getPackageJsonMetadata(dir: string) {
16
- try {
17
- const packageJson = await readFile(resolve(dir, "package.json"), "utf-8");
18
- const parsed = JSON.parse(packageJson);
19
- return {
20
- name: parsed.name,
21
- description: parsed.description,
22
- };
23
- } catch {
24
- return {
25
- name: "docs",
26
- };
27
- }
28
- }