@vyriy/dist 0.8.13 → 0.8.14

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/assets.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { PackageJson } from './types.js';
2
2
  export declare const copyReadme: (packageDirectory: string) => Promise<void>;
3
+ export declare const copyCommonJsAssets: (packageDirectory: string) => Promise<void>;
3
4
  export declare const resolveSourceAgentsPath: (packageAgentsPath: string, sharedAgentsPath: string, rootAgentsPath: string) => Promise<string>;
4
5
  export declare const copyAgents: (packageDirectory: string, rootPackageJson: PackageJson) => Promise<boolean>;
5
6
  export declare const copyLicense: (packageDirectory: string) => Promise<void>;
package/assets.js CHANGED
@@ -1,4 +1,4 @@
1
- import { copyFile } from 'node:fs/promises';
1
+ import { copyFile, readdir } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { AGENTS_FILE, LICENSE_FILE, PACKAGES_DIR, README_FILE } from './constants.js';
4
4
  import { hasFile } from './file.js';
@@ -9,6 +9,16 @@ export const copyReadme = async (packageDirectory) => {
9
9
  await copyFile(sourceReadmePath, path.join(packageDirectory, README_FILE));
10
10
  }
11
11
  };
12
+ export const copyCommonJsAssets = async (packageDirectory) => {
13
+ const packageName = path.basename(packageDirectory);
14
+ const sourceDirectory = path.join(PACKAGES_DIR, packageName);
15
+ const entries = await readdir(sourceDirectory, { withFileTypes: true });
16
+ for (const entry of entries) {
17
+ if (entry.isFile() && entry.name.endsWith('.cjs')) {
18
+ await copyFile(path.join(sourceDirectory, entry.name), path.join(packageDirectory, entry.name));
19
+ }
20
+ }
21
+ };
12
22
  export const resolveSourceAgentsPath = async (packageAgentsPath, sharedAgentsPath, rootAgentsPath) => {
13
23
  if (await hasFile(packageAgentsPath)) {
14
24
  return packageAgentsPath;
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import { copyAgents, copyLicense, copyReadme } from './assets.js';
2
+ import { copyAgents, copyCommonJsAssets, copyLicense, copyReadme } from './assets.js';
3
3
  import { makePackageBinsExecutable, removePackageBinDeclarationFiles } from './bin.js';
4
4
  import { AGENTS_FILE, PACKAGES_DIR } from './constants.js';
5
5
  import { removeEmptyJavaScriptFiles } from './cleanup.js';
@@ -33,6 +33,7 @@ export const distPackage = async (packageJsonPath, rootPackageJson) => {
33
33
  const javaScriptFiles = await getJavaScriptFiles(packageDirectory);
34
34
  await copyLicense(packageDirectory);
35
35
  await copyReadme(packageDirectory);
36
+ await copyCommonJsAssets(packageDirectory);
36
37
  const hasAgents = await copyAgents(packageDirectory, rootPackageJson);
37
38
  delete packageJson.private;
38
39
  if (hasAgents && rootPackageJson.agents) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/dist",
3
- "version": "0.8.13",
3
+ "version": "0.8.14",
4
4
  "description": "Vyriy distribution build CLI.",
5
5
  "homepage": "https://vyriy.dev/docs/dist/",
6
6
  "type": "module",