@open-mercato/enterprise 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,2 +1,2 @@
1
- Found 292 entry points
2
- enterprise package built successfully
1
+ [build:enterprise] found 292 entry points
2
+ [build:enterprise] built successfully
package/build.mjs CHANGED
@@ -1,88 +1,10 @@
1
- import * as esbuild from 'esbuild'
2
- import { glob } from 'glob'
3
- import { readFileSync, writeFileSync, existsSync, mkdirSync, copyFileSync } from 'node:fs'
4
- import { dirname, join, relative } from 'node:path'
1
+ import { dirname } from 'node:path'
5
2
  import { fileURLToPath } from 'node:url'
3
+ import { buildPackage } from '../../scripts/build-package.mjs'
6
4
 
7
- const __dirname = dirname(fileURLToPath(import.meta.url))
5
+ const packageDir = dirname(fileURLToPath(import.meta.url))
8
6
 
9
- const entryPoints = await glob('src/**/*.{ts,tsx}', {
10
- cwd: __dirname,
11
- ignore: ['**/__tests__/**', '**/*.test.ts', '**/*.test.tsx'],
12
- absolute: true,
7
+ await buildPackage(packageDir, {
8
+ name: 'enterprise',
9
+ copyJson: true,
13
10
  })
14
-
15
- if (entryPoints.length === 0) {
16
- console.error('No entry points found!')
17
- process.exit(1)
18
- }
19
-
20
- console.log(`Found ${entryPoints.length} entry points`)
21
-
22
- const addJsExtension = {
23
- name: 'add-js-extension',
24
- setup(build) {
25
- build.onEnd(async (result) => {
26
- if (result.errors.length > 0) return
27
- const outputFiles = await glob('dist/**/*.js', { cwd: __dirname, absolute: true })
28
- for (const file of outputFiles) {
29
- const fileDir = dirname(file)
30
- let content = readFileSync(file, 'utf-8')
31
- content = content.replace(/from\s+["'](\.[^"']+)["']/g, (match, path) => {
32
- if (path.endsWith('.js') || path.endsWith('.json')) return match
33
- const resolvedPath = join(fileDir, path)
34
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
35
- return `from "${path}/index.js"`
36
- }
37
- return `from "${path}.js"`
38
- })
39
- content = content.replace(/import\s*\(\s*["'](\.[^"']+)["']\s*\)/g, (match, path) => {
40
- if (path.endsWith('.js') || path.endsWith('.json')) return match
41
- const resolvedPath = join(fileDir, path)
42
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
43
- return `import("${path}/index.js")`
44
- }
45
- return `import("${path}.js")`
46
- })
47
- content = content.replace(/import\s+["'](\.[^"']+)["'];/g, (match, path) => {
48
- if (path.endsWith('.js') || path.endsWith('.json')) return match
49
- const resolvedPath = join(fileDir, path)
50
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
51
- return `import "${path}/index.js";`
52
- }
53
- return `import "${path}.js";`
54
- })
55
- writeFileSync(file, content)
56
- }
57
- })
58
- },
59
- }
60
-
61
- const outdir = join(__dirname, 'dist')
62
-
63
- await esbuild.build({
64
- entryPoints,
65
- outdir,
66
- outbase: join(__dirname, 'src'),
67
- format: 'esm',
68
- platform: 'node',
69
- target: 'node18',
70
- sourcemap: true,
71
- jsx: 'automatic',
72
- plugins: [addJsExtension],
73
- })
74
-
75
- // Copy JSON files from src to dist (esbuild doesn't handle non-entry JSON files)
76
- const jsonFiles = await glob('src/**/*.json', {
77
- cwd: __dirname,
78
- ignore: ['**/node_modules/**'],
79
- absolute: true,
80
- })
81
- for (const jsonFile of jsonFiles) {
82
- const relativePath = relative(join(__dirname, 'src'), jsonFile)
83
- const destPath = join(outdir, relativePath)
84
- mkdirSync(dirname(destPath), { recursive: true })
85
- copyFileSync(jsonFile, destPath)
86
- }
87
-
88
- console.log('enterprise package built successfully')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/enterprise",
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": {
@@ -64,8 +64,8 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
- "@open-mercato/core": "0.5.1-develop.2683.4878a05b8e",
68
- "@open-mercato/ui": "0.5.1-develop.2683.4878a05b8e",
67
+ "@open-mercato/core": "0.5.1-develop.2691.d8a0934b37",
68
+ "@open-mercato/ui": "0.5.1-develop.2691.d8a0934b37",
69
69
  "@simplewebauthn/browser": "^13.3.0",
70
70
  "@simplewebauthn/server": "^13.3.0",
71
71
  "@simplewebauthn/types": "^12.0.0",
@@ -75,10 +75,10 @@
75
75
  "qrcode": "^1.5.4"
76
76
  },
77
77
  "peerDependencies": {
78
- "@open-mercato/shared": "0.5.1-develop.2683.4878a05b8e"
78
+ "@open-mercato/shared": "0.5.1-develop.2691.d8a0934b37"
79
79
  },
80
80
  "devDependencies": {
81
- "@open-mercato/shared": "0.5.1-develop.2683.4878a05b8e",
81
+ "@open-mercato/shared": "0.5.1-develop.2691.d8a0934b37",
82
82
  "@types/jest": "^30.0.0",
83
83
  "jest": "^30.3.0",
84
84
  "ts-jest": "^29.4.9"