@0xchain/iconfont 0.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/.babelrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@nx/react/babel",
5
+ {
6
+ "runtime": "automatic",
7
+ "useBuiltIns": "usage"
8
+ }
9
+ ]
10
+ ],
11
+ "plugins": []
12
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @0xchain/iconfont
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test @0xchain/iconfont` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,3 @@
1
+ declare const _default: import('react').FC<import('@ant-design/icons/lib/components/IconFont').IconFontProps<string>>;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAIA,wBAEG"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ import { createFromIconfontCN as o } from "@ant-design/icons";
3
+ const t = o({
4
+ scriptUrl: `${process.env.NEXT_PUBLIC_CDN_URL}/common/iconfont/20260128/iconfont.js`
5
+ // 在 iconfont.cn 上生成
6
+ });
7
+ export {
8
+ t as default
9
+ };
@@ -0,0 +1,6 @@
1
+
2
+ import baseConfig from '../../eslint.config.mjs';
3
+
4
+ export default [
5
+ ...baseConfig
6
+ ];
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@0xchain/iconfont",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "devDependencies": {
17
+ "rollup-plugin-preserve-use-client": "3.0.1"
18
+ },
19
+ "dependencies": {
20
+ "react": "19.1.1",
21
+ "react-dom": "19.1.1",
22
+ "@ant-design/icons": "6.1.0"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ }
27
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+
3
+ import { createFromIconfontCN } from '@ant-design/icons';
4
+
5
+ export default createFromIconfontCN({
6
+ scriptUrl: `${process.env.NEXT_PUBLIC_CDN_URL}/common/iconfont/20260128/iconfont.js`, // 在 iconfont.cn 上生成
7
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "files": [],
3
+ "include": [],
4
+ "references": [
5
+ {
6
+ "path": "./tsconfig.lib.json"
7
+ },
8
+ {
9
+ "path": "./tsconfig.spec.json"
10
+ }
11
+ ],
12
+ "extends": "../../tsconfig.base.json"
13
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts",
9
+ "vite/client"
10
+ ],
11
+ "rootDir": "src",
12
+ "jsx": "react-jsx",
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler",
15
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
16
+ },
17
+ "exclude": [
18
+ "out-tsc",
19
+ "dist",
20
+ "**/*.spec.ts",
21
+ "**/*.test.ts",
22
+ "**/*.spec.tsx",
23
+ "**/*.test.tsx",
24
+ "**/*.spec.js",
25
+ "**/*.test.js",
26
+ "**/*.spec.jsx",
27
+ "**/*.test.jsx",
28
+ "vite.config.ts",
29
+ "vite.config.mts",
30
+ "vitest.config.ts",
31
+ "vitest.config.mts",
32
+ "src/**/*.test.ts",
33
+ "src/**/*.spec.ts",
34
+ "src/**/*.test.tsx",
35
+ "src/**/*.spec.tsx",
36
+ "src/**/*.test.js",
37
+ "src/**/*.spec.js",
38
+ "src/**/*.test.jsx",
39
+ "src/**/*.spec.jsx",
40
+ "eslint.config.js",
41
+ "eslint.config.cjs",
42
+ "eslint.config.mjs"
43
+ ],
44
+ "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
45
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/vitest",
5
+ "types": [
6
+ "vitest/globals",
7
+ "vitest/importMeta",
8
+ "vite/client",
9
+ "node",
10
+ "vitest"
11
+ ],
12
+ "jsx": "react-jsx",
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler"
15
+ },
16
+ "include": [
17
+ "vite.config.ts",
18
+ "vite.config.mts",
19
+ "vitest.config.ts",
20
+ "vitest.config.mts",
21
+ "src/**/*.test.ts",
22
+ "src/**/*.spec.ts",
23
+ "src/**/*.test.tsx",
24
+ "src/**/*.spec.tsx",
25
+ "src/**/*.test.js",
26
+ "src/**/*.spec.js",
27
+ "src/**/*.test.jsx",
28
+ "src/**/*.spec.jsx",
29
+ "src/**/*.d.ts"
30
+ ],
31
+ "references": [
32
+ {
33
+ "path": "./tsconfig.lib.json"
34
+ }
35
+ ]
36
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,64 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import dts from 'vite-plugin-dts';
5
+ import * as path from 'path';
6
+ import preserveUseClientDirective from 'rollup-plugin-preserve-use-client';
7
+
8
+ export default defineConfig(() => ({
9
+ root: __dirname,
10
+ cacheDir: '../../node_modules/.vite/packages/iconfont',
11
+ plugins: [
12
+ react(),
13
+ preserveUseClientDirective(),
14
+ dts({
15
+ entryRoot: 'src',
16
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
17
+ }),
18
+ ],
19
+ // Uncomment this if you are using workers.
20
+ // worker: {
21
+ // plugins: [ nxViteTsPaths() ],
22
+ // },
23
+ // Configuration for building your library.
24
+ // See: https://vitejs.dev/guide/build.html#library-mode
25
+ build: {
26
+ outDir: './dist',
27
+ emptyOutDir: true,
28
+ reportCompressedSize: true,
29
+ commonjsOptions: {
30
+ transformMixedEsModules: true,
31
+ },
32
+ lib: {
33
+ // Could also be a dictionary or array of multiple entry points.
34
+ entry: 'src/index.tsx',
35
+ name: '@0xchain/iconfont',
36
+ fileName: 'index',
37
+ // Change this to the formats you want to support.
38
+ // Don't forget to update your package.json as well.
39
+ formats: ['es' as const],
40
+ },
41
+ rollupOptions: {
42
+ // External packages that should not be bundled into your library.
43
+ external: [
44
+ 'react',
45
+ 'react-dom',
46
+ 'react/jsx-runtime',
47
+ '@ant-design/icons',
48
+ '@0xchain/next-themes',
49
+ ],
50
+ },
51
+ },
52
+ test: {
53
+ name: '@0xchain/iconfont',
54
+ watch: false,
55
+ globals: true,
56
+ environment: 'jsdom',
57
+ include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
58
+ reporters: ['default'],
59
+ coverage: {
60
+ reportsDirectory: './test-output/vitest/coverage',
61
+ provider: 'v8' as const,
62
+ },
63
+ },
64
+ }));