oneworks 0.1.0-alpha.0 → 0.1.0-alpha.2

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,5 +1,7 @@
1
1
  import { describe, expect, it, vi } from 'vitest'
2
2
 
3
+ import bootstrapPackageJson from '../package.json'
4
+ import { getBootstrapVersion } from '../src/package-config'
3
5
  import { createBootstrapCli, routeBootstrapCommand } from '../src/program'
4
6
 
5
7
  describe('bootstrap cli', () => {
@@ -76,6 +78,10 @@ describe('bootstrap cli', () => {
76
78
  })
77
79
  })
78
80
 
81
+ it('reads the current bootstrap package version', () => {
82
+ expect(getBootstrapVersion()).toBe(bootstrapPackageJson.version)
83
+ })
84
+
79
85
  it('dispatches the desktop launcher for app', async () => {
80
86
  const launchDesktopApp = vi.fn(async () => {})
81
87
  const launchInstalledPackage = vi.fn(async () => 0)
@@ -0,0 +1,27 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ import { describe, expect, it } from 'vitest'
6
+
7
+ const repoRoot = path.resolve(
8
+ path.dirname(fileURLToPath(import.meta.url)),
9
+ '../../..'
10
+ )
11
+
12
+ const redirectPackages = ['onework', 'oneork', 'oneorks']
13
+
14
+ const readJson = (filePath: string) => JSON.parse(readFileSync(filePath, 'utf8'))
15
+
16
+ describe('bootstrap publish aliases', () => {
17
+ it('declares typo packages as same-source publish aliases', () => {
18
+ const bootstrapPackageJson = readJson(path.join(repoRoot, 'apps/bootstrap/package.json'))
19
+
20
+ expect(bootstrapPackageJson.oneworks.publishAliases).toEqual(redirectPackages)
21
+ expect(bootstrapPackageJson.bin).toEqual({
22
+ oneworks: './cli.js',
23
+ ow: './cli.js',
24
+ owo: './cli.js'
25
+ })
26
+ })
27
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneworks",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/oneworks-ai/app.git",
@@ -8,7 +8,12 @@
8
8
  },
9
9
  "description": "One Works bootstrap launcher",
10
10
  "oneworks": {
11
- "runtimeTranspile": true
11
+ "runtimeTranspile": true,
12
+ "publishAliases": [
13
+ "onework",
14
+ "oneork",
15
+ "oneorks"
16
+ ]
12
17
  },
13
18
  "exports": {
14
19
  "./package.json": "./package.json"
@@ -4,7 +4,7 @@ const getPackageJson = () => {
4
4
  if (!packageJson) {
5
5
  try {
6
6
  // eslint-disable-next-line ts/no-require-imports
7
- packageJson = require('oneworks/package.json') as Record<string, unknown>
7
+ packageJson = require('../package.json') as Record<string, unknown>
8
8
  } catch {
9
9
  packageJson = {}
10
10
  }