Skip to content

Commit

Permalink
chore: update deps and maintenance (#2067)
Browse files Browse the repository at this point in the history
* chore: update deps

* style: update markdown

* style: apply prettier@v3

* fix: revert component dts

* chore: update deps

* chore: replace ts plugin

* chore: fix tests
  • Loading branch information
Mister-Hope authored Aug 29, 2023
1 parent d65d6ef commit a44a7eb
Show file tree
Hide file tree
Showing 152 changed files with 4,506 additions and 5,926 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
branch: gh-pages
folder: docs/src/.vuepress/dist
ssh-key: ${{ secrets.SSH_TOKEN }}
repository-name: walinejs/walinejs.github.io
repository-name: walinejs/walinejs.github.io
20 changes: 15 additions & 5 deletions .github/workflows/release-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile && pnpm --filter ./packages/client run build

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build Client
run: pnpm client:build

- name: Publish NPM
uses: JS-DevTools/npm-publish@v2
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/release-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ jobs:
old-version: ${{ steps.publish-server.outputs.old-version }}
version: ${{ steps.publish-server.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- id: publish-server
name: 'publish @waline/vercel'
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
build-test:
strategy:
matrix:
node-version: [16]
node-version:
- 16
- 18
- 20
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -45,10 +48,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 18
cache: pnpm

- name: Install Dependencies
Expand All @@ -57,5 +60,5 @@ jobs:
- name: Linter test
run: pnpm lint

# - name: Unit test
# run: pnpm test
- name: Unit test
run: pnpm test
20 changes: 10 additions & 10 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"dev": "vuepress dev src"
},
"devDependencies": {
"@fancyapps/ui": "5.0.19",
"@vuepress/client": "2.0.0-beta.62",
"@vuepress/plugin-docsearch": "2.0.0-beta.62",
"@vuepress/utils": "2.0.0-beta.62",
"marked": "5.0.3",
"@fancyapps/ui": "5.0.22",
"@vuepress/client": "2.0.0-beta.66",
"@vuepress/plugin-docsearch": "2.0.0-beta.66",
"@vuepress/utils": "2.0.0-beta.66",
"marked": "4.3.0",
"vue": "3.3.4",
"vuepress": "2.0.0-beta.62",
"vuepress-plugin-redirect": "2.0.0-beta.215",
"vuepress-plugin-remove-pwa": "2.0.0-beta.215",
"vuepress-shared": "2.0.0-beta.215",
"vuepress-theme-hope": "2.0.0-beta.215"
"vuepress": "2.0.0-beta.66",
"vuepress-plugin-redirect": "2.0.0-beta.235",
"vuepress-plugin-remove-pwa": "2.0.0-beta.235",
"vuepress-shared": "2.0.0-beta.235",
"vuepress-theme-hope": "2.0.0-beta.235"
}
}
4 changes: 2 additions & 2 deletions docs/src/.vuepress/components/HomePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default defineComponent({
h(
h(resolveComponent('CommentService'), {
darkmode: isDarkmode.value,
})
}),
),
],
}
},
);
},
});
2 changes: 1 addition & 1 deletion docs/src/.vuepress/components/MigrationTool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const click = (event: FormDataEvent) => {
source.value = JSON.parse(source.value);
} else {
source.value = JSON.parse(
`{"results":[ ${source.value.split(/[\r\n]+/).join(',')} ]}`
`{"results":[ ${source.value.split(/[\r\n]+/).join(',')} ]}`,
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/src/.vuepress/components/NormalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
const tocEnable = computed(
() =>
frontmatter.value.toc ||
(frontmatter.value.toc !== false && themeLocale.value.toc !== false)
(frontmatter.value.toc !== false && themeLocale.value.toc !== false),
);

return (): VNode =>
Expand All @@ -61,7 +61,7 @@ export default defineComponent({
{
before: () => slots['tocBefore']?.(),
after: () => slots['tocAfter']?.(),
}
},
)
: null,
slots['contentBefore']?.(),
Expand All @@ -76,8 +76,8 @@ export default defineComponent({
})
: null,
slots['bottom']?.(),
]
)
],
),
);
},
});
2 changes: 1 addition & 1 deletion docs/src/.vuepress/components/WalineTips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
h('div', {
class: 'waline-tips',
innerHTML: text.value,
})
}),
);
},
});
4 changes: 2 additions & 2 deletions docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ export default defineUserConfig({
'@MigrationTool': path.resolve(__dirname, './components/MigrationTool.vue'),
'@theme-hope/components/HomePage': path.resolve(
__dirname,
'./components/HomePage'
'./components/HomePage',
),
'@theme-hope/components/NormalPage': path.resolve(
__dirname,
'./components/NormalPage'
'./components/NormalPage',
),
},

Expand Down
2 changes: 1 addition & 1 deletion docs/src/.vuepress/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ export default hopeTheme(
},
},
},
{ custom: true }
{ custom: true },
);
4 changes: 2 additions & 2 deletions docs/src/.vuepress/utils/exportRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const fakeClick = (element: HTMLElement): void => {
false,
false,
0,
null
null,
);

element.dispatchEvent(ev);
Expand All @@ -27,7 +27,7 @@ export const exportRaw = (name: string, data: BlobPart): void => {
const export_blob = new Blob([data]);
const saveAnchor = document.createElementNS(
'http://www.w3.org/1999/xhtml',
'a'
'a',
) as HTMLAnchorElement;

saveAnchor.href = urlObject.createObjectURL(export_blob);
Expand Down
25 changes: 22 additions & 3 deletions docs/src/.vuepress/utils/transform/artalk2lc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,27 @@ export const artalk2lc = (input) => {

return {
results: input.map(
({ content, date, created_at, email, id, ip, link, nick, page_key, rid, ua, is_pinned, is_pending, vote_down, vote_up }) => {
const time = date||created_at ? new Date((date||created_at).replace(/-/g, '/')).toISOString() : '';
({
content,
date,
created_at,
email,
id,
ip,
link,
nick,
page_key,
rid,
ua,
is_pinned,
is_pending,
vote_down,
vote_up,
}) => {
const time =
date || created_at
? new Date((date || created_at).replace(/-/g, '/')).toISOString()
: '';
const url = parseKey(page_key);
return {
objectId: id,
Expand All @@ -58,7 +77,7 @@ export const artalk2lc = (input) => {
sticky: is_pinned === 'true',
like: vote_up && vote_down ? vote_up - vote_down : 0,
};
}
},
),
};
};
4 changes: 2 additions & 2 deletions docs/src/.vuepress/utils/transform/commento2lc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const commento2lc = (input: string) => {
rid: rootHexMaps[commentHex] ? rootHexMaps[commentHex] : '',
status: state === 'approved' ? 'approved' : 'waiting',
},
commenter
commenter,
);
}
},
),
};
};
4 changes: 2 additions & 2 deletions docs/src/.vuepress/utils/transform/disqus2lc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const disqus2lc = (input: string) => {
.textContent!.toLowerCase();

return isDeleted === 'false';
}
},
);
const threads = Array.from(dom.querySelectorAll('disqus > thread'));

Expand Down Expand Up @@ -58,7 +58,7 @@ export const disqus2lc = (input: string) => {
const objectId = postEl.getAttribute('dsq:id')!;
const comment = postEl.querySelector('message')!.textContent;
const insertedAt = new Date(
postEl.querySelector('createdAt')!.textContent!
postEl.querySelector('createdAt')!.textContent!,
).toISOString();
const nick = postEl.querySelector('author name')!.textContent;
const threadId = postEl.querySelector('thread')!.getAttribute('dsq:id')!;
Expand Down
70 changes: 36 additions & 34 deletions docs/src/.vuepress/utils/transform/tk2lc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const tk2lc = (input: string) => {
let arr: any[];
try {
arr = JSON.parse(input);
} catch(e) {
} catch (e) {
// compat old twikoo output json format
arr = input
.trim()
Expand All @@ -14,39 +14,41 @@ export const tk2lc = (input: string) => {
.map((text) => JSON.parse(text));
}

const data = arr.map(({
_id,
comment,
created,
updated,
ip,
link,
mail,
nick,
ua,
url,
pid,
rid,
isSpam,
}) => ({
objectId: typeof _id === 'string' ? _id : _id.$oid,
comment: comment,
insertedAt: {
__type: 'Date',
iso: new Date(created).toISOString(),
},
createdAt: new Date(created).toISOString(),
updatedAt: new Date(updated).toISOString(),
ip,
link,
mail,
nick,
ua,
url,
pid,
rid,
status: isSpam ? 'spam' : 'approved',
}));
const data = arr.map(
({
_id,
comment,
created,
updated,
ip,
link,
mail,
nick,
ua,
url,
pid,
rid,
isSpam,
}) => ({
objectId: typeof _id === 'string' ? _id : _id.$oid,
comment: comment,
insertedAt: {
__type: 'Date',
iso: new Date(created).toISOString(),
},
createdAt: new Date(created).toISOString(),
updatedAt: new Date(updated).toISOString(),
ip,
link,
mail,
nick,
ua,
url,
pid,
rid,
status: isSpam ? 'spam' : 'approved',
}),
);

return {
results: data,
Expand Down
Loading

0 comments on commit a44a7eb

Please sign in to comment.