@open-mercato/queue 0.5.1-develop.2683.4878a05b8e → 0.5.1-develop.2694.732417c5ec

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 7 entry points
2
- queue built successfully
1
+ [build:queue] found 7 entry points
2
+ [build:queue] built successfully
package/build.mjs CHANGED
@@ -1,73 +1,10 @@
1
- import * as esbuild from 'esbuild'
2
- import { glob } from 'glob'
3
- import { readFileSync, writeFileSync, existsSync } from 'node:fs'
4
- import { dirname, join } 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', {
10
- cwd: __dirname,
11
- ignore: ['**/__tests__/**', '**/*.test.ts'],
12
- absolute: true,
7
+ await buildPackage(packageDir, {
8
+ name: 'queue',
9
+ entryPoints: 'src/**/*.ts',
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
- // Plugin to add .js extension to relative imports
23
- const addJsExtension = {
24
- name: 'add-js-extension',
25
- setup(build) {
26
- build.onEnd(async (result) => {
27
- if (result.errors.length > 0) return
28
- const outputFiles = await glob('dist/**/*.js', { cwd: __dirname, absolute: true })
29
- for (const file of outputFiles) {
30
- const fileDir = dirname(file)
31
- let content = readFileSync(file, 'utf-8')
32
- // Add .js to relative imports that don't have an extension
33
- content = content.replace(
34
- /from\s+["'](\.[^"']+)["']/g,
35
- (match, path) => {
36
- if (path.endsWith('.js') || path.endsWith('.json')) return match
37
- // Check if it's a directory with index.js
38
- const resolvedPath = join(fileDir, path)
39
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
40
- return `from "${path}/index.js"`
41
- }
42
- return `from "${path}.js"`
43
- }
44
- )
45
- content = content.replace(
46
- /import\s*\(\s*["'](\.[^"']+)["']\s*\)/g,
47
- (match, path) => {
48
- if (path.endsWith('.js') || path.endsWith('.json')) return match
49
- // Check if it's a directory with index.js
50
- const resolvedPath = join(fileDir, path)
51
- if (existsSync(resolvedPath) && existsSync(join(resolvedPath, 'index.js'))) {
52
- return `import("${path}/index.js")`
53
- }
54
- return `import("${path}.js")`
55
- }
56
- )
57
- writeFileSync(file, content)
58
- }
59
- })
60
- }
61
- }
62
-
63
- await esbuild.build({
64
- entryPoints,
65
- outdir: 'dist',
66
- format: 'esm',
67
- platform: 'node',
68
- target: 'node18',
69
- sourcemap: true,
70
- plugins: [addJsExtension],
71
- })
72
-
73
- console.log('queue built successfully')
package/jest.config.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  /** @type {import('jest').Config} */
2
2
  module.exports = {
3
- preset: 'ts-jest',
4
3
  testEnvironment: 'node',
5
4
  watchman: false,
6
5
  rootDir: '.',
7
6
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
8
7
  transform: {
9
8
  '^.+\\.(t|j)sx?$': [
10
- 'ts-jest',
9
+ '<rootDir>/../../scripts/jest-mikroorm-transformer.cjs',
11
10
  {
12
11
  tsconfig: {
13
12
  jsx: 'react-jsx',
@@ -15,6 +14,9 @@ module.exports = {
15
14
  },
16
15
  ],
17
16
  },
17
+ transformIgnorePatterns: [
18
+ 'node_modules/(?!(@mikro-orm)/)',
19
+ ],
18
20
  testMatch: ['<rootDir>/src/**/__tests__/**/*.test.(ts|tsx)'],
19
21
  passWithNoTests: true,
20
22
  moduleNameMapper: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/queue",
3
- "version": "0.5.1-develop.2683.4878a05b8e",
3
+ "version": "0.5.1-develop.2694.732417c5ec",
4
4
  "description": "Multi-strategy job queue with local and BullMQ support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@open-mercato/shared": "0.5.1-develop.2683.4878a05b8e"
53
+ "@open-mercato/shared": "0.5.1-develop.2694.732417c5ec"
54
54
  },
55
55
  "repository": {
56
56
  "type": "git",