@funhub/platform 0.1.53 → 0.1.56
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 +13 -0
- package/bin/index.mjs +323 -0
- package/dist/assets/images/user/default_avatar.mjs +2 -0
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +1 -1
- package/dist/components/biz/business/banner-carousel/material.d.mts +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +7 -7
- package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-search/material.d.mts +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +1 -1
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/material.d.mts +2 -2
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +2 -2
- package/dist/components/biz/business/marquee/schema.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/material.d.mts +2 -2
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/material.d.mts +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +1 -1
- package/dist/components/biz/business/search-history/schema.d.mts +1 -1
- package/dist/components/biz/business/search-history/server.mjs +1 -1
- package/dist/components/biz/business/search-input/client.d.mts +2 -0
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-input/material.d.mts +1 -4
- package/dist/components/biz/business/search-input/schema.d.mts +1 -3
- package/dist/components/biz/business/search-input/schema.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +1 -1
- package/dist/components/biz/business/tab-bar/material.d.mts +2 -2
- package/dist/components/biz/business/tab-bar/schema.d.mts +2 -2
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/text-recommend/schema.d.mts +1 -1
- package/dist/components/biz/business/video-horizontal-list/client.d.mts +2 -1
- package/dist/components/biz/business/video-horizontal-list/client.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +7 -7
- package/dist/components/biz/business/video-horizontal-list/material.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/schema.d.mts +7 -7
- package/dist/components/biz/business/video-horizontal-list/schema.mjs +1 -1
- package/dist/components/biz/example/button/material.d.mts +1 -1
- package/dist/components/biz/example/button/material.mjs +1 -1
- package/dist/components/common/list/post-list/post-list.mjs +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list.d.mts +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list.mjs +1 -1
- package/dist/components/common/list/video-list/video-list.mjs +1 -1
- package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
- package/dist/components/pages/login/password.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/reset-password.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video.mjs +1 -1
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/i18n/locales/en.mjs +2 -2
- package/dist/i18n/locales/zh-CN.mjs +2 -2
- package/dist/service/batch-get-video-detail.d.mts +21 -0
- package/dist/service/batch-get-video-detail.mjs +2 -0
- package/dist/service/get-popular-video-list-post.d.mts +8 -0
- package/dist/service/get-popular-video-list-post.mjs +2 -0
- package/dist/service.d.mts +3 -1
- package/dist/service.mjs +1 -1
- package/dist/utils/password-validator.d.mts +28 -0
- package/dist/utils/password-validator.mjs +2 -0
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/material.d.mts +7 -9
- package/dist/utils/schema/utils.d.mts +13 -3
- package/dist/utils/schema/utils.mjs +1 -1
- package/dist/utils.d.mts +3 -2
- package/dist/utils.mjs +1 -1
- package/package.json +7 -2
- package/templates/base/_meta.json +4 -0
- package/templates/base/template/README.md.template +32 -0
- package/templates/base/template/__dot__gitignore +6 -0
- package/templates/base/template/app/[locale]/layout.tsx.template +36 -0
- package/templates/base/template/app/[locale]/page.tsx.template +24 -0
- package/templates/base/template/app/globals.css +26 -0
- package/templates/base/template/app/layout.tsx.template +38 -0
- package/templates/base/template/eslint.config.mjs.template +68 -0
- package/templates/base/template/i18n/request.ts.template +3 -0
- package/templates/base/template/next-env.d.ts.template +4 -0
- package/templates/base/template/next.config.ts.template +21 -0
- package/templates/base/template/package.json.template +37 -0
- package/templates/base/template/postcss.config.js.template +18 -0
- package/templates/base/template/proxy.ts.template +18 -0
- package/templates/base/template/tailwind.config.cjs.template +13 -0
- package/templates/base/template/tsconfig.json.template +43 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { antfu } from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
export function react(options = {}) {
|
|
4
|
+
return antfu({
|
|
5
|
+
react: true,
|
|
6
|
+
ignores: [
|
|
7
|
+
'**/*.md',
|
|
8
|
+
'.next/**',
|
|
9
|
+
'out/**',
|
|
10
|
+
'build/**',
|
|
11
|
+
'public',
|
|
12
|
+
'next-env.d.ts',
|
|
13
|
+
...(options.ignores || []),
|
|
14
|
+
],
|
|
15
|
+
rules: {
|
|
16
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
17
|
+
'eslint-comments/no-unlimited-disable': 'off',
|
|
18
|
+
'no-redeclare': 'off',
|
|
19
|
+
'jsdoc/require-returns-description': 'off',
|
|
20
|
+
'@typescript-eslint/no-redeclare': 'off',
|
|
21
|
+
'style/quotes': ['warn', 'single'],
|
|
22
|
+
'style/jsx-quotes': ['warn', 'prefer-single'],
|
|
23
|
+
'node/prefer-global/process': 'off',
|
|
24
|
+
'style/semi': ['warn', 'always'],
|
|
25
|
+
'package-json/valid-package-def': 'off',
|
|
26
|
+
'@eslint-react/no-missing-key': 'warn',
|
|
27
|
+
'no-restricted-syntax': 'off',
|
|
28
|
+
'react-hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
|
29
|
+
'import/no-anonymous-default-export': 'off',
|
|
30
|
+
'eqeqeq': 'warn',
|
|
31
|
+
'ts/no-use-before-define': ['warn', { functions: false, variables: false }],
|
|
32
|
+
'no-use-before-define': ['warn', { functions: false, variables: false }],
|
|
33
|
+
'no-console': 'warn',
|
|
34
|
+
'unicorn/prefer-math-trunc': 'off',
|
|
35
|
+
'unicorn/prefer-dom-node-remove': 'off',
|
|
36
|
+
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
37
|
+
'no-empty': 'off',
|
|
38
|
+
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
39
|
+
'unicorn/prefer-query-selector': 0,
|
|
40
|
+
'regexp/no-super-linear-backtracking': 0,
|
|
41
|
+
'regexp/no-useless-assertions': 0,
|
|
42
|
+
'unicorn/no-new-array': 0,
|
|
43
|
+
'@typescript-eslint/method-signature-style': 0,
|
|
44
|
+
'unicorn/prefer-code-point': 'warn',
|
|
45
|
+
'unicorn/no-object-as-default-parameter': 'warn',
|
|
46
|
+
'unused-imports/no-unused-vars': 'warn',
|
|
47
|
+
'@eslint-react/no-unstable-default-props': 'warn',
|
|
48
|
+
'unicorn/prefer-regexp-test': 'warn',
|
|
49
|
+
'no-unsafe-optional-chaining': 'warn',
|
|
50
|
+
'unicorn/prefer-logical-operator-over-ternary': 'warn',
|
|
51
|
+
'arrow-body-style': 0,
|
|
52
|
+
'unicorn/no-array-callback-reference': 0,
|
|
53
|
+
'prefer-regex-literals': 0,
|
|
54
|
+
'regexp/optimal-quantifier-concatenation': 'warn',
|
|
55
|
+
'unicorn/prefer-string-slice': 0,
|
|
56
|
+
'array-callback-return': 0,
|
|
57
|
+
'regexp/no-unused-capturing-group': 1,
|
|
58
|
+
'unicorn/no-anonymous-default-export': 0,
|
|
59
|
+
'unicorn/no-magic-array-flat-depth': 1,
|
|
60
|
+
'react-refresh/only-export-components': 0,
|
|
61
|
+
'react/no-array-index-key': 0,
|
|
62
|
+
'package-json/valid-name': 0,
|
|
63
|
+
...(options.rules || {}),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default react();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NextConfig } from 'next';
|
|
2
|
+
import createNextIntlPlugin from 'next-intl/plugin';
|
|
3
|
+
|
|
4
|
+
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Starter 应用的 Next 配置。
|
|
8
|
+
*/
|
|
9
|
+
const nextConfig: NextConfig = {
|
|
10
|
+
transpilePackages: ['@funhub/platform'],
|
|
11
|
+
images: {
|
|
12
|
+
remotePatterns: [
|
|
13
|
+
{
|
|
14
|
+
protocol: 'https',
|
|
15
|
+
hostname: '*',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default withNextIntl(nextConfig);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PACKAGE_NAME}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"fix": "eslint . --fix",
|
|
11
|
+
"typecheck": "tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@funhub/platform": "{{PLATFORM_VERSION}}",
|
|
15
|
+
"@tanstack/react-query": "^5.90.16",
|
|
16
|
+
"next": "16.1.6",
|
|
17
|
+
"next-intl": "^4.8.2",
|
|
18
|
+
"react": "19.2.0",
|
|
19
|
+
"react-dom": "19.2.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@antfu/eslint-config": "^7.4.3",
|
|
23
|
+
"@eslint-react/eslint-plugin": "^2.12.4",
|
|
24
|
+
"@types/node": "^20.19.17",
|
|
25
|
+
"@types/react": "^19.2.2",
|
|
26
|
+
"@types/react-dom": "^19.2.2",
|
|
27
|
+
"autoprefixer": "^10.4.23",
|
|
28
|
+
"eslint": "^10.0.0",
|
|
29
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
30
|
+
"eslint-plugin-react-refresh": "^0.5.0",
|
|
31
|
+
"postcss": "^8.5.6",
|
|
32
|
+
"postcss-nesting": "^13.0.2",
|
|
33
|
+
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
|
34
|
+
"tailwindcss": "^3.4.19",
|
|
35
|
+
"typescript": "^5.9.2"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: {
|
|
3
|
+
'postcss-nesting': {},
|
|
4
|
+
'tailwindcss': {},
|
|
5
|
+
'autoprefixer': {},
|
|
6
|
+
'postcss-px-to-viewport-8-plugin': {
|
|
7
|
+
unitToConvert: 'px',
|
|
8
|
+
viewportUnit: 'vw',
|
|
9
|
+
unitPrecision: 6,
|
|
10
|
+
fontViewportUnit: 'vw',
|
|
11
|
+
selectorBlackList: [],
|
|
12
|
+
minPixelValue: 1,
|
|
13
|
+
mediaQuery: false,
|
|
14
|
+
replace: true,
|
|
15
|
+
viewportWidth: 430,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
import { routing } from '@funhub/platform/i18n';
|
|
3
|
+
import createMiddleware from 'next-intl/middleware';
|
|
4
|
+
|
|
5
|
+
const handleI18nRouting = createMiddleware(routing);
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 处理 Starter 应用的国际化路由。
|
|
9
|
+
* @param {NextRequest} request
|
|
10
|
+
*/
|
|
11
|
+
export default async function middleware(request: NextRequest) {
|
|
12
|
+
const response = handleI18nRouting(request);
|
|
13
|
+
return response;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const config = {
|
|
17
|
+
matcher: '/((?!api|trpc|_next|_vercel|.*\\..*).*)',
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
const {
|
|
3
|
+
platformTailwindPreset,
|
|
4
|
+
withPlatformTailwindContent,
|
|
5
|
+
} = require('@funhub/platform/config/tailwind');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
content: withPlatformTailwindContent([
|
|
9
|
+
'./app/**/*.{js,ts,jsx,tsx}',
|
|
10
|
+
'./components/**/*.{js,ts,jsx,tsx}',
|
|
11
|
+
]),
|
|
12
|
+
presets: [platformTailwindPreset],
|
|
13
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": true,
|
|
4
|
+
"target": "ES2017",
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"lib": [
|
|
7
|
+
"dom",
|
|
8
|
+
"dom.iterable",
|
|
9
|
+
"esnext"
|
|
10
|
+
],
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": [
|
|
15
|
+
"./*"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"isolatedModules": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"plugins": [
|
|
27
|
+
{
|
|
28
|
+
"name": "next"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"next-env.d.ts",
|
|
34
|
+
"**/*.ts",
|
|
35
|
+
"**/*.tsx",
|
|
36
|
+
".next/types/**/*.ts",
|
|
37
|
+
".next/dev/types/**/*.ts",
|
|
38
|
+
"**/*.mts"
|
|
39
|
+
],
|
|
40
|
+
"exclude": [
|
|
41
|
+
"node_modules"
|
|
42
|
+
]
|
|
43
|
+
}
|