Skip to content

Commit e661edd

Browse files
authored
Enforce code quality standards and update dependencies (#25)
* 🔧 chore(dependencies): Upgrade development dependencies - Update @localazy/eslint-config to ^1.3.0 - Update @localazy/prettier-config to ^1.2.0 - Update @localazy/tsconfig to ^1.1.1 - Update eslint to ^9.34.0 - Update fetch-mock to ^12.5.4 - Update @types/node to ^22.18.0 - Update unplugin-replace to ^0.6.1 - Update vite to ^7.1.3 Includes additions to `package-lock.json` with new optional dependencies and specific platform builds. * 💄 style(prettier): Fix code formatting * 🔧 chore: Replace imports with type-only imports, add `assertNotNull` utility, and adjust related files * 🔧 chore: Add Node.js test matrix script and update workflows - Add `node-test-matrix.sh` to test under Node.js versions 20, 22, and 24. - Update `qa.yml` GitHub workflow to run jobs across the Node.js version matrix. - Specify supported Node.js engines (`>=20`) in `package.json`. * 🔧 chore: Enforce `.js` extensions in imports and update ESLint config for path alias and extension rules * 🔧 chore(dependencies): Update development dependencies and enforce `.js` extensions in imports - Upgrade multiple dependencies, such as `vue`, `vitepress`, `sass`, `postcss`, and others for alignment with the latest versions. - Replace imports with `.js` extensions to support ESM compatibility. - Adjust `tsconfig.json` to use `ESNext` modules and `bundler` resolution for compatibility with updated dependencies. - Use type-only imports where applicable.
1 parent 2f33ceb commit e661edd

File tree

73 files changed

+4270
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4270
-719
lines changed

.github/workflows/qa.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,40 @@ on:
66
- main
77

88
jobs:
9-
lint:
10-
name: Code Quality
9+
qa:
10+
name: Code Quality Node ${{ matrix.node }}
1111
runs-on: [self-hosted, Linux]
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
node: [20, 22, 24]
1216
steps:
1317
- name: Checkout repository
1418
uses: actions/checkout@v4
1519

16-
- name: Setup Node
20+
- name: Setup Node ${{ matrix.node }}
1721
uses: actions/setup-node@v4
1822
with:
19-
node-version-file: .nvmrc
23+
node-version: ${{ matrix.node }}
2024

2125
- name: Install dependencies
2226
run: npm ci
2327

24-
- name: Lint source files
25-
run: npm run lint
26-
2728
- name: Run Prettier
2829
run: npm run prettier
2930

31+
- name: Lint source files
32+
run: npm run lint
33+
3034
- name: Check types
3135
run: npm run typecheck
3236

33-
- name: Run tests
34-
run: npm run test:coverage
35-
3637
- name: Build package
3738
run: npm run build
3839

40+
- name: Run tests with coverage
41+
run: npm run test:coverage
42+
3943
- name: 'Report Coverage'
40-
if: always()
44+
if: matrix.node == 22 && always()
4145
uses: davelosert/vitest-coverage-report-action@v2

.prettierrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/.vitepress/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { defineConfig } from 'vitepress';
2-
import { head } from './config/en/head';
3-
import { nav } from './config/en/nav';
4-
import { sidebar } from './config/en/sidebar';
5-
import { markdown } from './config/markdown';
2+
import { head } from './config/en/head.js';
3+
import { nav } from './config/en/nav.js';
4+
import { sidebar } from './config/en/sidebar.js';
5+
import { markdown } from './config/markdown.js';
66

77
export default defineConfig({
88
title: 'CDN Client',

docs/.vitepress/config/en/nav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DefaultTheme } from 'vitepress/theme';
1+
import type { DefaultTheme } from 'vitepress/theme';
22
import { version } from '../../../../package.json';
33

44
export const nav = (): DefaultTheme.NavItem[] => [

docs/.vitepress/theme/components/FooterLinks.vue

Lines changed: 148 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,43 @@
66
<div class="footer-links__nav">
77
<div class="footer-links__col">
88
<div class="footer-links__col-header">
9-
<a href="https://localazy.com" target="_blank" class="logo-link">
10-
<img src="/theme/localazy-logo-white.svg" alt="Localazy" width="150" />
9+
<a
10+
href="https://localazy.com"
11+
target="_blank"
12+
class="logo-link"
13+
>
14+
<img
15+
src="/theme/localazy-logo-white.svg"
16+
alt="Localazy"
17+
width="150"
18+
/>
1119
</a>
1220
</div>
1321
<ul>
14-
<li><a href="https://localazy.com" target="_blank">Why Localazy?</a></li>
15-
<li><a href="https://localazy.com/book-demo" target="_blank">Book a demo</a></li>
16-
<li><a href="https://localazy.com/my/dashboard" target="_blank">Go to your Dashboard</a></li>
22+
<li>
23+
<a
24+
href="https://localazy.com"
25+
target="_blank"
26+
>
27+
Why Localazy?
28+
</a>
29+
</li>
30+
<li>
31+
<a
32+
href="https://localazy.com/book-demo"
33+
target="_blank"
34+
>
35+
Book a demo
36+
</a>
37+
</li>
38+
<li>
39+
<a
40+
href="https://localazy.com/my/dashboard"
41+
target="_blank"
42+
>
43+
Go to your Dashboard
44+
</a>
45+
</li>
1746
</ul>
1847
</div>
1948

@@ -22,8 +51,22 @@
2251
<strong>Resources</strong>
2352
</div>
2453
<ul>
25-
<li><a href="https://localazy.com/docs/cdn/cdn-introduction" target="_blank">CDN documentation</a></li>
26-
<li><a href="https://localazy.com/tags/cdn" target="_blank">CDN blog posts</a></li>
54+
<li>
55+
<a
56+
href="https://localazy.com/docs/cdn/cdn-introduction"
57+
target="_blank"
58+
>
59+
CDN documentation
60+
</a>
61+
</li>
62+
<li>
63+
<a
64+
href="https://localazy.com/tags/cdn"
65+
target="_blank"
66+
>
67+
CDN blog posts
68+
</a>
69+
</li>
2770
</ul>
2871
</div>
2972

@@ -32,10 +75,38 @@
3275
<strong>Support</strong>
3376
</div>
3477
<ul>
35-
<li><a href="https://localazy.com" target="_blank">Intercom chat</a></li>
36-
<li><a href="https://github.com/localazy/cdn-client/issues" target="_blank">GitHub issues</a></li>
37-
<li><a href="https://discuss.localazy.com" target="_blank">Discussion forum</a></li>
38-
<li><a href="mailto:[email protected]" target="_blank">[email protected]</a></li>
78+
<li>
79+
<a
80+
href="https://localazy.com"
81+
target="_blank"
82+
>
83+
Intercom chat
84+
</a>
85+
</li>
86+
<li>
87+
<a
88+
href="https://github.com/localazy/cdn-client/issues"
89+
target="_blank"
90+
>
91+
GitHub issues
92+
</a>
93+
</li>
94+
<li>
95+
<a
96+
href="https://discuss.localazy.com"
97+
target="_blank"
98+
>
99+
Discussion forum
100+
</a>
101+
</li>
102+
<li>
103+
<a
104+
href="mailto:[email protected]"
105+
target="_blank"
106+
>
107+
108+
</a>
109+
</li>
39110
</ul>
40111
</div>
41112

@@ -44,18 +115,43 @@
44115
<strong>NPM packages</strong>
45116
</div>
46117
<ul>
47-
<li><a href="https://www.npmjs.com/package/@localazy/cli" target="_blank">@localazy/cli</a></li>
48118
<li>
49-
<a href="https://www.npmjs.com/package/@localazy/api-client" target="_blank">@localazy/api-client</a>
119+
<a
120+
href="https://www.npmjs.com/package/@localazy/cli"
121+
target="_blank"
122+
>
123+
@localazy/cli
124+
</a>
125+
</li>
126+
<li>
127+
<a
128+
href="https://www.npmjs.com/package/@localazy/api-client"
129+
target="_blank"
130+
>
131+
@localazy/api-client
132+
</a>
50133
</li>
51-
<li><a href="https://www.npmjs.com/package/@localazy/languages" target="_blank">@localazy/languages</a></li>
52134
<li>
53-
<a href="https://www.npmjs.com/package/@localazy/strapi-plugin" target="_blank">
135+
<a
136+
href="https://www.npmjs.com/package/@localazy/languages"
137+
target="_blank"
138+
>
139+
@localazy/languages
140+
</a>
141+
</li>
142+
<li>
143+
<a
144+
href="https://www.npmjs.com/package/@localazy/strapi-plugin"
145+
target="_blank"
146+
>
54147
@localazy/strapi-plugin
55148
</a>
56149
</li>
57150
<li>
58-
<a href="https://www.npmjs.com/package/@localazy/directus-extension-localazy" target="_blank">
151+
<a
152+
href="https://www.npmjs.com/package/@localazy/directus-extension-localazy"
153+
target="_blank"
154+
>
59155
@localazy/directus-extension-localazy
60156
</a>
61157
</li>
@@ -64,29 +160,58 @@
64160
</div>
65161

66162
<div class="footer-links__social">
67-
<a href="https://localazy.com/feed.xml" target="_blank" class="social-link">
163+
<a
164+
href="https://localazy.com/feed.xml"
165+
target="_blank"
166+
class="social-link"
167+
>
68168
<span class="vpi-social-rss" />
69169
</a>
70-
<a href="https://www.facebook.com/localazy/" target="_blank" class="social-link">
170+
<a
171+
href="https://www.facebook.com/localazy/"
172+
target="_blank"
173+
class="social-link"
174+
>
71175
<span class="vpi-social-facebook" />
72176
</a>
73-
<a href="https://github.com/localazy" target="_blank" class="social-link">
177+
<a
178+
href="https://github.com/localazy"
179+
target="_blank"
180+
class="social-link"
181+
>
74182
<span class="vpi-social-github" />
75183
</a>
76-
<a href="https://twitter.com/localazy" target="_blank" class="social-link">
184+
<a
185+
href="https://twitter.com/localazy"
186+
target="_blank"
187+
class="social-link"
188+
>
77189
<span class="vpi-social-twitter" />
78190
</a>
79-
<a href="https://www.linkedin.com/company/37836599/" target="_blank" class="social-link">
191+
<a
192+
href="https://www.linkedin.com/company/37836599/"
193+
target="_blank"
194+
class="social-link"
195+
>
80196
<span class="vpi-social-linkedin" />
81197
</a>
82-
<a href="https://discuss.localazy.com/" target="_blank" class="social-link">
198+
<a
199+
href="https://discuss.localazy.com/"
200+
target="_blank"
201+
class="social-link"
202+
>
83203
<span class="vpi-social-discuss" />
84204
</a>
85205
</div>
86206

87207
<div class="footer-links__licence">
88208
© {{ new Date().getFullYear() }} Localazy. Released under the
89-
<a href="https://github.com/localazy/cdn-client/blob/main/LICENSE" target="_blank">MIT license</a>
209+
<a
210+
href="https://github.com/localazy/cdn-client/blob/main/LICENSE"
211+
target="_blank"
212+
>
213+
MIT license
214+
</a>
90215
.
91216
</div>
92217
</div>

docs/.vitepress/theme/components/LocSandpack.vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import {
66
SandpackProvider,
77
type SandpackFiles,
88
} from 'sandpack-vue3';
9-
import { getCustomSetupFromProps, getSandpackFiles, getSandpackOptions, sandboxProps } from 'vitepress-plugin-sandpack';
9+
import {
10+
getCustomSetupFromProps,
11+
getSandpackFiles,
12+
getSandpackOptions,
13+
sandboxProps,
14+
} from 'vitepress-plugin-sandpack';
1015
import { computed, nextTick, onBeforeMount, onMounted, ref, useSlots, watch } from 'vue';
1116
import { githubDark, githubLight } from './github-themes';
1217
@@ -65,8 +70,12 @@ const previewHeight = computed(() =>
6570
const previewHeightStyle = computed(() =>
6671
previewHeight.value ? `${previewHeight.value}px` : 'var(--sp-layout-height)',
6772
);
68-
const coderHeight = computed(() => (isNaN(Number(getOpt('coderHeight'))) ? undefined : Number(getOpt('coderHeight'))));
69-
const coderHeightStyle = computed(() => (coderHeight.value ? `${coderHeight.value}px` : 'var(--sp-layout-height)'));
73+
const coderHeight = computed(() =>
74+
isNaN(Number(getOpt('coderHeight'))) ? undefined : Number(getOpt('coderHeight')),
75+
);
76+
const coderHeightStyle = computed(() =>
77+
coderHeight.value ? `${coderHeight.value}px` : 'var(--sp-layout-height)',
78+
);
7079
7180
/* options */
7281
@@ -88,11 +97,17 @@ const customSetup = computed(() => {
8897
:custom-setup="customSetup"
8998
>
9099
<SandpackLayout>
91-
<SandpackCodeEditor showLineNumbers initMode="user-visible" />
100+
<SandpackCodeEditor
101+
showLineNumbers
102+
initMode="user-visible"
103+
/>
92104
</SandpackLayout>
93105
<br />
94106
<SandpackLayout>
95-
<SandpackPreview showNavigator :showRestartButton="false" />
107+
<SandpackPreview
108+
showNavigator
109+
:showRestartButton="false"
110+
/>
96111
</SandpackLayout>
97112
</SandpackProvider>
98113
</template>

docs/.vitepress/theme/components/LocZoomImg.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ onMounted(() => {
1919
</script>
2020

2121
<template>
22-
<img ref="imgRef" :src="withBase(src)" :alt="alt" />
22+
<img
23+
ref="imgRef"
24+
:src="withBase(src)"
25+
:alt="alt"
26+
/>
2327
</template>
2428

2529
<style>

docs/.vitepress/theme/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { EnhanceAppContext } from 'vitepress';
1+
import type { EnhanceAppContext } from 'vitepress';
22
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client';
3-
import DefaultTheme from 'vitepress/theme';
3+
import { default as DefaultTheme } from 'vitepress/theme';
44
import { h } from 'vue';
55
import FooterLinks from './components/FooterLinks.vue';
66
import LocSandbox from './components/LocSandbox.vue';

docs/.vitepress/theme/vitepress-theme.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@
9797
/* Override: Typography */
9898

9999
--vp-font-family-base:
100-
Roboto, 'Chinese Quotes', 'Inter var', 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
101-
'Segoe UI', 'Helvetica Neue', Helvetica, Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
102-
'Segoe UI Symbol', 'Noto Color Emoji';
100+
Roboto, 'Chinese Quotes', 'Inter var', 'Inter', ui-sans-serif, system-ui, -apple-system,
101+
BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, 'Noto Sans', sans-serif,
102+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
103103
--vp-font-family-mono:
104-
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
104+
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono',
105+
'Courier New', monospace;
105106

106107
/* Override: Home */
107108

0 commit comments

Comments
 (0)