@oneplatformdev/utils 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,11 @@
1
+ # @oneplatformdev/utils
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ```bush
6
+ npm instsall @oneplatformdev/utils clsx tailwind-merge
7
+ ```
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test utils` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,11 @@
1
+ # @oneplatformdev/utils
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ```bush
6
+ npm instsall @oneplatformdev/utils clsx tailwind-merge
7
+ ```
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test utils` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,4 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ export declare function cn(...inputs: ClassValue[]): string;
4
+ export default cn;
@@ -0,0 +1,9 @@
1
+ import { clsx as t } from "clsx";
2
+ import { twMerge as o } from "tailwind-merge";
3
+ function m(...r) {
4
+ return o(t(r));
5
+ }
6
+ export {
7
+ m as cn,
8
+ m as default
9
+ };
@@ -0,0 +1 @@
1
+ export { default, cn } from './cn';
@@ -0,0 +1,5 @@
1
+ import { cn as e, cn as f } from "./cn.mjs";
2
+ export {
3
+ e as cn,
4
+ f as default
5
+ };
@@ -0,0 +1 @@
1
+ export * from './cn';
@@ -0,0 +1,4 @@
1
+ import { cn as c } from "./cn/cn.mjs";
2
+ export {
3
+ c as cn
4
+ };
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@oneplatformdev/utils",
3
+ "version": "0.0.1",
4
+ "description": "Utility functions for React components.",
5
+ "author": "One Platform Development Team",
6
+ "keywords": [
7
+ "clsx",
8
+ "cn",
9
+ "oneplatform",
10
+ "utils"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/oneplatformdev/core.git",
15
+ "directory": "packages/utils"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/oneplatformdev/core/issues"
19
+ },
20
+ "homepage": "private package",
21
+ "main": "./index.mjs",
22
+ "types": "./index.d.ts",
23
+ "type": "module",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./index.d.ts",
27
+ "import": "./index.mjs",
28
+ "default": "./index.mjs"
29
+ },
30
+ "./cn": {
31
+ "types": "./cn/index.d.ts",
32
+ "import": "./cn/index.mjs",
33
+ "default": "./cn/index.mjs"
34
+ }
35
+ },
36
+ "license": "MIT",
37
+ "private": false,
38
+ "publishConfig": {
39
+ "directory": "build"
40
+ },
41
+ "sideEffects": false,
42
+ "engines": {
43
+ "node": ">=20"
44
+ },
45
+ "scripts": {
46
+ "release": "pnpm publish",
47
+ "build": "vite build"
48
+ },
49
+ "peerDependencies": {
50
+ "clsx": "^2.1.1",
51
+ "tailwind-merge": "^2.6.0"
52
+ }
53
+ }
@@ -0,0 +1,12 @@
1
+ const nx = require('@nx/eslint-plugin');
2
+ const baseConfig = require('../../eslint.config.cjs');
3
+
4
+ module.exports = [
5
+ ...baseConfig,
6
+ ...nx.configs['flat/react'],
7
+ {
8
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
9
+ // Override or add rules here
10
+ rules: {},
11
+ },
12
+ ];
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@oneplatformdev/utils",
3
+ "version": "0.0.1",
4
+ "description": "Utility functions for React components.",
5
+ "author": "One Platform Development Team",
6
+ "keywords": [
7
+ "clsx",
8
+ "cn",
9
+ "oneplatform",
10
+ "utils"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/oneplatformdev/core.git",
15
+ "directory": "packages/utils"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/oneplatformdev/core/issues"
19
+ },
20
+ "homepage": "private package",
21
+ "main": "./index.mjs",
22
+ "types": "./index.d.ts",
23
+ "type": "module",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./index.d.ts",
27
+ "import": "./index.mjs",
28
+ "default": "./index.mjs"
29
+ },
30
+ "./cn": {
31
+ "types": "./cn/index.d.ts",
32
+ "import": "./cn/index.mjs",
33
+ "default": "./cn/index.mjs"
34
+ }
35
+ },
36
+ "license": "MIT",
37
+ "private": false,
38
+ "publishConfig": {
39
+ "directory": "build"
40
+ },
41
+ "sideEffects": false,
42
+ "engines": {
43
+ "node": ">=20"
44
+ },
45
+ "scripts": {
46
+ "release": "pnpm publish",
47
+ "build": "vite build"
48
+ },
49
+ "peerDependencies": {
50
+ "clsx": "^2.1.1",
51
+ "tailwind-merge": "^2.6.0"
52
+ }
53
+ }
package/project.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "utils",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/utils/src",
5
+ "projectType": "library",
6
+ "tags": [],
7
+ "// targets": "to see all targets run: nx show project utils --web",
8
+ "targets": {}
9
+ }
package/src/cn/cn.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
7
+ export default cn
@@ -0,0 +1 @@
1
+ export { default, cn } from './cn';
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './cn';
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react-jsx",
4
+ "allowJs": false,
5
+ "esModuleInterop": false,
6
+ "allowSyntheticDefaultImports": true,
7
+ "strict": true,
8
+ "types": ["vite/client"]
9
+ },
10
+ "files": [],
11
+ "include": [],
12
+ "references": [
13
+ {
14
+ "path": "./tsconfig.lib.json"
15
+ }
16
+ ],
17
+ "extends": "../../tsconfig.base.json"
18
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts",
9
+ "vite/client"
10
+ ]
11
+ },
12
+ "exclude": [
13
+ "**/*.spec.ts",
14
+ "**/*.test.ts",
15
+ "**/*.spec.tsx",
16
+ "**/*.test.tsx",
17
+ "**/*.spec.js",
18
+ "**/*.test.js",
19
+ "**/*.spec.jsx",
20
+ "**/*.test.jsx"
21
+ ],
22
+ "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
23
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,56 @@
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 { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7
+ import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
8
+
9
+ const entry = {
10
+ index: path.resolve(__dirname, 'src/index.ts'),
11
+ "cn/index": path.resolve(__dirname, 'src/cn/index.ts'),
12
+ "cn/cn": path.resolve(__dirname, 'src/cn/cn.ts'),
13
+ }
14
+
15
+ export default defineConfig({
16
+ root: __dirname,
17
+ cacheDir: '../../node_modules/.vite/packages/utils',
18
+ plugins: [
19
+ react(),
20
+ nxViteTsPaths(),
21
+ nxCopyAssetsPlugin(['*.md']),
22
+ dts({
23
+ entryRoot: 'src',
24
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
25
+ }),
26
+ ],
27
+ // Configuration for building your library.
28
+ // See: https://vitejs.dev/guide/build.html#library-mode
29
+ build: {
30
+ outDir: './build',
31
+ emptyOutDir: true,
32
+ reportCompressedSize: true,
33
+ commonjsOptions: {
34
+ transformMixedEsModules: true,
35
+ },
36
+ lib: {
37
+ entry,
38
+ name: 'utils',
39
+ formats: ['es'],
40
+ fileName: (format, entryName) => {
41
+ return format === 'es'
42
+ ? `${entryName}.mjs`
43
+ : `${entryName}.${format}`
44
+ },
45
+ },
46
+ rollupOptions: {
47
+ external: ['clsx', 'tailwind-merge'],
48
+ output: {
49
+ exports: 'named',
50
+ globals: {
51
+ clsx: "clsx",
52
+ },
53
+ },
54
+ },
55
+ },
56
+ });