nuxt-skill-hub 0.0.2 → 0.0.3

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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-skill-hub",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "configKey": "skillHub",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.3.0"
package/dist/module.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { promises, existsSync, lstatSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { join, basename, resolve, dirname, relative, isAbsolute } from 'pathe';
3
3
  import { useLogger, defineNuxtModule } from '@nuxt/kit';
4
+ import { isCI, isTest } from 'std-env';
4
5
  import { createConsola } from 'consola';
5
6
  import { colorize } from 'consola/utils';
6
7
  import { detectInstalledAgents, expandPath, detectCurrentAgent, getAgentIds, getAgentConfig } from 'unagent/env';
@@ -12,7 +13,7 @@ import { fileURLToPath } from 'mlly';
12
13
  import { downloadTemplate } from 'giget';
13
14
  import { ofetch } from 'ofetch';
14
15
 
15
- const version = "0.0.2";
16
+ const version = "0.0.3";
16
17
  const packageJson = {
17
18
  version: version};
18
19
 
@@ -1737,6 +1738,10 @@ const module$1 = defineNuxtModule({
1737
1738
  },
1738
1739
  async setup(options, nuxt) {
1739
1740
  const logger = useLogger("nuxt-skill-hub");
1741
+ if (isCI && !isTest) {
1742
+ logger.info("Skipping skill generation in CI");
1743
+ return;
1744
+ }
1740
1745
  const configuredSkillName = options.skillName?.trim();
1741
1746
  let resolvedSkillName;
1742
1747
  if (configuredSkillName && isValidSkillName(configuredSkillName)) {
@@ -1794,13 +1799,11 @@ const module$1 = defineNuxtModule({
1794
1799
  const remoteContributions = [];
1795
1800
  const remoteCacheRoot = join(nuxt.options.rootDir, ".nuxt", "skill-hub-cache");
1796
1801
  await emptyDir(remoteCacheRoot);
1797
- for (const pkg of installedPackages) {
1798
- if (pkg.packageName === "nuxt-skill-hub") {
1799
- continue;
1800
- }
1801
- if (distResolvedPackages.has(pkg.packageName)) {
1802
- continue;
1803
- }
1802
+ const packagesToResolve = installedPackages.filter((pkg) => pkg.packageName !== "nuxt-skill-hub" && !distResolvedPackages.has(pkg.packageName));
1803
+ const totalToResolve = packagesToResolve.length;
1804
+ for (let i = 0; i < packagesToResolve.length; i++) {
1805
+ const pkg = packagesToResolve[i];
1806
+ logger.start(`[${i + 1}/${totalToResolve}] Resolving skills for ${pkg.packageName}...`);
1804
1807
  const remote = await resolveRemoteContributionsForPackage(pkg, {
1805
1808
  cacheRoot: remoteCacheRoot,
1806
1809
  githubLookupTimeoutMs: GITHUB_LOOKUP_TIMEOUT_MS,
@@ -1853,7 +1856,8 @@ const module$1 = defineNuxtModule({
1853
1856
  logger.warn(formatConflictWarning(conflict));
1854
1857
  }
1855
1858
  const nuxtMetadata = await loadNuxtMetadata();
1856
- for (const target of targets) {
1859
+ for (let targetIdx = 0; targetIdx < targets.length; targetIdx++) {
1860
+ const target = targets[targetIdx];
1857
1861
  const { skillRoot } = getTargetSkillRoot(exportRoot, target, resolvedSkillName);
1858
1862
  const referencesRoot = join(skillRoot, "references");
1859
1863
  const nuxtRoot = join(referencesRoot, "nuxt");
@@ -1871,6 +1875,8 @@ const module$1 = defineNuxtModule({
1871
1875
  const nuxtIndexTemplate = await pathExists(nuxtIndexTemplatePath) ? await promises.readFile(nuxtIndexTemplatePath, "utf8") : "";
1872
1876
  const nuxtIndexContent = await renderAutomdTemplate(nuxtIndexTemplate, nuxtRoot);
1873
1877
  await writeFileIfChanged(join(nuxtRoot, "index.md"), nuxtIndexContent);
1878
+ if (targetIdx === 0)
1879
+ logger.start("Fetching Vue best-practices content...");
1874
1880
  const vueTemplateFiles = await buildVueTemplateFiles(vueRoot, remoteCacheRoot);
1875
1881
  for (const file of vueTemplateFiles) {
1876
1882
  await writeFileIfChanged(file.path, file.contents);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-skill-hub",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Teach your AI agent the Nuxt way with best practices and module guidance.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,6 +30,7 @@
30
30
  "pathe": "^2.0.0",
31
31
  "pkg-types": "^2.3.0",
32
32
  "mlly": "^1.8.1",
33
+ "std-env": "^4.0.0",
33
34
  "unagent": "^0.0.8"
34
35
  },
35
36
  "devDependencies": {