@ankhorage/devtools 2.1.4 → 2.1.6

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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/devtools
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.1.4](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.1.6](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects
9
9
 
@@ -1,4 +1,4 @@
1
- import { type ManagedFileSyncResult } from '../tools/shared/managedFiles.js';
1
+ import { type ManagedFileSyncResult } from '../features/managed-files/managedFiles.js';
2
2
  import type { DevtoolsRepositoryCommandDefinition } from './commands.js';
3
3
  export interface DevtoolsRepositoryCommandContext {
4
4
  readonly cwd: string;
@@ -1,3 +1,4 @@
1
+ import { inspectManagedFiles, resolveManagedTargetDirectory, syncManagedFiles, } from '../features/managed-files/managedFiles.js';
1
2
  import { agentsManagedFiles } from '../tools/agents/index.js';
2
3
  import { eslintManagedFiles } from '../tools/eslint/managed.js';
3
4
  import { gitignoreManagedFiles } from '../tools/gitignore/index.js';
@@ -5,7 +6,6 @@ import { knipManagedFiles } from '../tools/knip/managed.js';
5
6
  import { inspectPackageManifest, readCurrentDevtoolsVersion, syncPackageManifest, } from '../tools/package/index.js';
6
7
  import { planBunDependencySync, syncBunDependencies, } from '../tools/package/syncBunDependencies.js';
7
8
  import { prettierManagedFiles } from '../tools/prettier/managed.js';
8
- import { inspectManagedFiles, resolveManagedTargetDirectory, syncManagedFiles, } from '../tools/shared/managedFiles.js';
9
9
  import { inspectManagedSkills, syncManagedSkills } from '../tools/skills/managed.js';
10
10
  import { vscodeManagedFiles } from '../tools/vscode/index.js';
11
11
  import { workflowManagedFiles } from '../tools/workflows/index.js';
@@ -1,4 +1,4 @@
1
- import type { ManagedFileStatus, ManagedFileSyncResult } from '../shared/managedFiles.js';
1
+ import type { ManagedFileStatus, ManagedFileSyncResult } from '../../features/managed-files/managedFiles.js';
2
2
  /*** Inspect whether the Devtools-owned package manifest contract is current. */
3
3
  export declare function inspectPackageManifest(targetDirectory: string, devtoolsVersion: string): Promise<ManagedFileStatus>;
4
4
  /*** Synchronize the Devtools-owned package manifest fields. */
@@ -1,3 +1,3 @@
1
- import type { ManagedFileSyncResult } from '../shared/managedFiles.js';
1
+ import type { ManagedFileSyncResult } from '../../features/managed-files/managedFiles.js';
2
2
  export declare function planBunDependencySync(targetDirectory: string): ManagedFileSyncResult;
3
3
  export declare function syncBunDependencies(targetDirectory: string): Promise<ManagedFileSyncResult>;
@@ -1,4 +1,4 @@
1
- import type { ManagedFileStatus, ManagedFileSyncResult } from '../shared/managedFiles.js';
1
+ import type { ManagedFileStatus, ManagedFileSyncResult } from '../../features/managed-files/managedFiles.js';
2
2
  export declare function inspectManagedSkills(targetDirectory: string, devtoolsVersion: string): Promise<readonly ManagedFileStatus[]>;
3
3
  export declare function syncManagedSkills(targetDirectory: string, devtoolsVersion: string, options: {
4
4
  readonly dryRun: boolean;
@@ -193,6 +193,8 @@ jobs:
193
193
  const pkg = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8'));
194
194
  const importConditions = new Set(['bun', 'default', 'import', 'node']);
195
195
  const requireConditions = new Set(['default', 'node', 'require']);
196
+ const platformConditions = new Set(['browser', 'react-native']);
197
+ const explicitServerConditions = new Set(['bun', 'node']);
196
198
  const supportsLoader = (target, conditions) => {
197
199
  if (typeof target === 'string') return true;
198
200
  if (Array.isArray(target)) return target.some((value) => supportsLoader(value, conditions));
@@ -202,7 +204,21 @@ jobs:
202
204
  conditions.has(condition) && supportsLoader(value, conditions),
203
205
  );
204
206
  };
207
+ const declaresCondition = (target, conditions) => {
208
+ if (Array.isArray(target)) {
209
+ return target.some((value) => declaresCondition(value, conditions));
210
+ }
211
+ if (!target || typeof target !== 'object') return false;
212
+ return Object.entries(target).some(
213
+ ([condition, value]) =>
214
+ conditions.has(condition) || declaresCondition(value, conditions),
215
+ );
216
+ };
217
+ const isPlatformOnlyRuntimeTarget = (target) =>
218
+ declaresCondition(target, platformConditions) &&
219
+ !declaresCondition(target, explicitServerConditions);
205
220
  const selectLoader = (target) => {
221
+ if (isPlatformOnlyRuntimeTarget(target)) return undefined;
206
222
  if (supportsLoader(target, importConditions)) return 'import';
207
223
  if (supportsLoader(target, requireConditions)) return 'require';
208
224
  return undefined;
@@ -1,2 +1,2 @@
1
- import type { ManagedFileDefinition } from '../shared/managedFiles.js';
1
+ import type { ManagedFileDefinition } from '../../features/managed-files/managedFiles.js';
2
2
  export declare const workflowManagedFiles: readonly ManagedFileDefinition[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ankhorage/devtools#readme",
@@ -118,11 +118,11 @@
118
118
  "changeset:status": "bun src/cli/bin/changeset.ts status --since=origin/main",
119
119
  "version-packages": "bun src/cli/bin/changeset.ts version",
120
120
  "check-types": "bun x tsc --noEmit -p tsconfig.test.json",
121
- "test:standalone": "bun test src/tools/agents/index.test.ts src/tools/shared/managedFiles.test.ts"
121
+ "test:standalone": "bun test src/tools/agents/index.test.ts src/features/managed-files/managedFiles.test.ts"
122
122
  },
123
123
  "dependencies": {
124
124
  "@ankhorage/apm": "^0.8.13",
125
- "@ankhorage/contracts": "^22.8.93",
125
+ "@ankhorage/contracts": "^22.8.99",
126
126
  "@ankhorage/project-detector": "^0.3.3",
127
127
  "@ankhorage/rules-repository": "^0.2.0",
128
128
  "@ankhorage/utility": "^0.5.5",
@@ -130,7 +130,7 @@
130
130
  "@eslint/compat": "^2.1.1",
131
131
  "@eslint/js": "^10.0.1",
132
132
  "@next/eslint-plugin-next": "^16.3.8",
133
- "eslint": "^10.11.0",
133
+ "eslint": "^10.12.0",
134
134
  "eslint-config-prettier": "^10.1.8",
135
135
  "eslint-plugin-import": "^2.32.0",
136
136
  "eslint-plugin-prettier": "^5.5.6",
@@ -146,9 +146,9 @@
146
146
  "typescript-eslint": "^8.71.0"
147
147
  },
148
148
  "devDependencies": {
149
- "@ankhorage/paradox": "^0.2.26",
150
- "@ankhorage/ankh": "^0.10.80",
151
- "@ankhorage/doctor": "0.12.0",
149
+ "@ankhorage/paradox": "^0.2.27",
150
+ "@ankhorage/ankh": "^0.10.84",
151
+ "@ankhorage/doctor": "0.12.6",
152
152
  "@techstark/opencv-js": "^5.0.0-release.1",
153
153
  "@types/bun": "^1.4.2",
154
154
  "@types/node": "^26.6.4",