@oneplatformdev/utils 0.1.1-2 → 0.1.1-4

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.
@@ -0,0 +1,23 @@
1
+ import baseConfig from "../../eslint.config.mjs";
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ "files": [
7
+ "**/*.json"
8
+ ],
9
+ "rules": {
10
+ "@nx/dependency-checks": [
11
+ "error",
12
+ {
13
+ "ignoredFiles": [
14
+ "{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}"
15
+ ]
16
+ }
17
+ ]
18
+ },
19
+ "languageOptions": {
20
+ "parser": (await import('jsonc-eslint-parser'))
21
+ }
22
+ }
23
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/utils",
3
- "version": "0.1.1-2",
3
+ "version": "0.1.1-4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -9,19 +9,22 @@
9
9
  "./package.json": "./package.json",
10
10
  ".": {
11
11
  "@oneplatformdev/source": "./src/index.ts",
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "default": "./dist/index.js"
12
+ "types": "./index.d.ts",
13
+ "import": "./index.js",
14
+ "default": "./index.js"
15
15
  },
16
16
  "./*": {
17
17
  "@oneplatformdev/source": "./src/*.ts",
18
- "types": "./dist/*.d.ts",
19
- "import": "./dist/*.js",
20
- "default": "./dist/*.js"
18
+ "types": "./*.d.ts",
19
+ "import": "./*.js",
20
+ "default": "./*.js"
21
21
  }
22
22
  },
23
23
  "files": [
24
24
  "dist",
25
+ "*",
26
+ "src",
27
+ "lib",
25
28
  "!**/*.tsbuildinfo"
26
29
  ],
27
30
  "dependencies": {
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';
@@ -0,0 +1,12 @@
1
+ import type { Ref, RefCallback } from "react";
2
+
3
+ export function composeRefs<T>(...refs: Array<Ref<T> | undefined | null>) {
4
+ return (node: T | null) => {
5
+ for (const ref of refs) {
6
+ if (!ref) continue;
7
+ if (typeof ref === "function") (ref as RefCallback<T>)(node);
8
+ else (ref as { current: T | null }).current = node;
9
+ }
10
+ };
11
+ }
12
+ export default composeRefs;
@@ -0,0 +1 @@
1
+ export { default, composeRefs } from './composeRefs';
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './cn';
2
+ export * from './composeRefs';
3
+ export type * from './types';
@@ -0,0 +1 @@
1
+ export type PartialOne<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
@@ -0,0 +1 @@
1
+ export type * from './PartialOne'
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "./tsconfig.lib.json"
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "rootDir": "src",
6
+ "outDir": "dist",
7
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
8
+ "emitDeclarationOnly": false,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "types": ["node"]
11
+ },
12
+ "include": ["src/**/*.ts"],
13
+ "references": []
14
+ }