Skip to content

Commit

Permalink
fix: fixes core and standalone packages; adds pre-publish script (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf authored Nov 24, 2023
1 parent 3a1441f commit 9dd7a96
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"version": "0.0.0",
"name": "idkit-monorepo",
"scripts": {
"dev": "turbo run dev",
"lint": "turbo run lint",
"build": "turbo run build",
"dev": "turbo run dev"
"prepublishOnly": "npm run build"
},
"devDependencies": {
"turbo": "^1.10.14"
Expand Down
5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
"README.md"
],
"scripts": {
"lint": "eslint src --ext .ts",
"build": "tsup",
"dev": "tsup --watch"
"dev": "tsup --watch",
"lint": "eslint src --ext .ts",
"prepublishOnly": "npm run build"
},
"keywords": [
"identity",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/hashing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from 'buffer/index'
import { Buffer } from 'buffer/index.js'
import type { IDKitConfig } from '@/types/config'
import type { AbiEncodedValue } from '@/types/config'
import { encodePacked, isBytes, isHex, keccak256 } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from 'buffer/index'
import { Buffer } from 'buffer/index.js'

export const buffer_encode = (buffer: ArrayBuffer): string => {
return Buffer.from(buffer).toString('base64')
Expand Down
1 change: 1 addition & 0 deletions packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default defineConfig({
outDir: 'build',
external: ['zustand', 'viem'],
entry: ['src/index.ts', 'src/lib/hashing.ts'],
define: { 'process.env.NODE_ENV': '"production"' },
})
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"scripts": {
"dev": "tsup --watch",
"lint": "eslint src --ext .ts",
"prepublishOnly": "npm run build",
"build": "npm run build:css && tsup",
"build:css": "npx tailwindcss -i ./src/styles/styles.css -o ./build/index.css --minify"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ export default defineConfig({
clean: true,
format: 'esm',
outDir: 'build',
loader: { '.css': 'text' },
entry: ['src/index.ts', 'src/internal.ts'],
define: {
'process.env.NODE_ENV': '"production"',
IDKitVersion: JSON.stringify(packageJson.version),
},
loader: {
'.css': 'text',
},
})
3 changes: 2 additions & 1 deletion packages/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"lint": "eslint src --ext .tsx"
"lint": "eslint src --ext .tsx",
"prepublishOnly": "npm run build"
},
"keywords": [
"identity",
Expand Down
1 change: 1 addition & 0 deletions packages/standalone/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export default defineConfig({
format: 'iife',
outDir: 'build',
entry: ['src/index.tsx'],
define: { 'process.env.NODE_ENV': '"production"' },
})

0 comments on commit 9dd7a96

Please sign in to comment.