@open-mercato/ui 0.5.1-develop.2683.4878a05b8e → 0.5.1-develop.2691.d8a0934b37

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.
@@ -1,3 +1,3 @@
1
1
  Generated lucide registry with 134 icons -> /home/runner/work/open-mercato/open-mercato/packages/ui/src/backend/icons/lucideRegistry.generated.tsx
2
- Found 264 entry points
3
- ui built successfully
2
+ [build:ui] found 264 entry points
3
+ [build:ui] built successfully
package/build.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import * as esbuild from 'esbuild'
2
1
  import { glob } from 'glob'
3
- import { readFileSync, writeFileSync, existsSync } from 'node:fs'
2
+ import { readFileSync, writeFileSync } from 'node:fs'
4
3
  import { dirname, join } from 'node:path'
5
4
  import { fileURLToPath } from 'node:url'
5
+ import { buildPackage } from '../../scripts/build-package.mjs'
6
6
 
7
- const __dirname = dirname(fileURLToPath(import.meta.url))
7
+ const packageDir = dirname(fileURLToPath(import.meta.url))
8
8
 
9
9
  function normalizeKebabIconName(input) {
10
10
  const trimmed = input.trim()
@@ -35,7 +35,7 @@ function kebabToLucideExportName(kebab) {
35
35
  }
36
36
 
37
37
  async function generateLucideRegistry() {
38
- const repoRoot = join(__dirname, '..', '..')
38
+ const repoRoot = join(packageDir, '..', '..')
39
39
  const candidateFiles = await glob(['apps/**/*.{ts,tsx}', 'packages/**/*.{ts,tsx}'], {
40
40
  cwd: repoRoot,
41
41
  absolute: true,
@@ -97,7 +97,7 @@ async function generateLucideRegistry() {
97
97
 
98
98
  const registryEntries = resolved.map((r) => ` '${r.kebab}': ${r.exportName},`).join('\n')
99
99
 
100
- const outPath = join(__dirname, 'src/backend/icons/lucideRegistry.generated.tsx')
100
+ const outPath = join(packageDir, 'src/backend/icons/lucideRegistry.generated.tsx')
101
101
  const file = `/* eslint-disable */
102
102
  // AUTO-GENERATED by @open-mercato/ui build. Do not edit by hand.
103
103
  // Generated from discovered icon string usages across the repo.
@@ -146,71 +146,7 @@ export function resolveRegisteredLucideIconNode(
146
146
  console.log(`Generated lucide registry with ${resolved.length} icons -> ${outPath}`)
147
147
  }
148
148
 
149
- await generateLucideRegistry()
150
-
151
- const entryPoints = await glob('src/**/*.{ts,tsx}', {
152
- cwd: __dirname,
153
- ignore: ['**/__tests__/**', '**/*.test.ts', '**/*.test.tsx'],
154
- absolute: true,
149
+ await buildPackage(packageDir, {
150
+ name: 'ui',
151
+ beforeBuild: generateLucideRegistry,
155
152
  })
156
-
157
- if (entryPoints.length === 0) {
158
- console.error('No entry points found!')
159
- process.exit(1)
160
- }
161
-
162
- console.log(`Found ${entryPoints.length} entry points`)
163
-
164
- // Plugin to add .js extension to relative imports
165
- const addJsExtension = {
166
- name: 'add-js-extension',
167
- setup(build) {
168
- build.onEnd(async (result) => {
169
- if (result.errors.length > 0) return
170
- const outputFiles = await glob('dist/**/*.js', { cwd: __dirname, absolute: true })
171
- for (const file of outputFiles) {
172
- const fileDir = dirname(file)
173
- let content = readFileSync(file, 'utf-8')
174
- // Add .js to relative imports that don't have an extension
175
- content = content.replace(
176
- /from\s+["'](\.[^"']+)["']/g,
177
- (match, path) => {
178
- if (path.endsWith('.js') || path.endsWith('.json')) return match
179
- // Check if it's a directory with index.js
180
- const resolvedPath = join(fileDir, path)
181
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
182
- return `from "${path}/index.js"`
183
- }
184
- return `from "${path}.js"`
185
- }
186
- )
187
- content = content.replace(
188
- /import\s*\(\s*["'](\.[^"']+)["']\s*\)/g,
189
- (match, path) => {
190
- if (path.endsWith('.js') || path.endsWith('.json')) return match
191
- // Check if it's a directory with index.js
192
- const resolvedPath = join(fileDir, path)
193
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
194
- return `import("${path}/index.js")`
195
- }
196
- return `import("${path}.js")`
197
- }
198
- )
199
- writeFileSync(file, content)
200
- }
201
- })
202
- }
203
- }
204
-
205
- await esbuild.build({
206
- entryPoints,
207
- outdir: 'dist',
208
- format: 'esm',
209
- platform: 'node',
210
- target: 'node18',
211
- sourcemap: true,
212
- jsx: 'automatic',
213
- plugins: [addJsExtension],
214
- })
215
-
216
- console.log('ui built successfully')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/ui",
3
- "version": "0.5.1-develop.2683.4878a05b8e",
3
+ "version": "0.5.1-develop.2691.d8a0934b37",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -132,12 +132,12 @@
132
132
  "recharts": "^3.8.1"
133
133
  },
134
134
  "peerDependencies": {
135
- "@open-mercato/shared": "0.5.1-develop.2683.4878a05b8e",
135
+ "@open-mercato/shared": "0.5.1-develop.2691.d8a0934b37",
136
136
  "react": ">=18.0.0",
137
137
  "react-dom": ">=18.0.0"
138
138
  },
139
139
  "devDependencies": {
140
- "@open-mercato/shared": "0.5.1-develop.2683.4878a05b8e",
140
+ "@open-mercato/shared": "0.5.1-develop.2691.d8a0934b37",
141
141
  "@testing-library/dom": "^10.4.1",
142
142
  "@testing-library/jest-dom": "^6.9.1",
143
143
  "@testing-library/react": "^16.3.1",