nuxt-skill-hub 0.0.2 → 0.0.4

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.4",
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.4";
16
17
  const packageJson = {
17
18
  version: version};
18
19
 
@@ -1737,6 +1738,13 @@ 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
+ }
1745
+ if (nuxt.options._prepare) {
1746
+ return;
1747
+ }
1740
1748
  const configuredSkillName = options.skillName?.trim();
1741
1749
  let resolvedSkillName;
1742
1750
  if (configuredSkillName && isValidSkillName(configuredSkillName)) {
@@ -1794,13 +1802,11 @@ const module$1 = defineNuxtModule({
1794
1802
  const remoteContributions = [];
1795
1803
  const remoteCacheRoot = join(nuxt.options.rootDir, ".nuxt", "skill-hub-cache");
1796
1804
  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
- }
1805
+ const packagesToResolve = installedPackages.filter((pkg) => pkg.packageName !== "nuxt-skill-hub" && !distResolvedPackages.has(pkg.packageName));
1806
+ const totalToResolve = packagesToResolve.length;
1807
+ for (let i = 0; i < packagesToResolve.length; i++) {
1808
+ const pkg = packagesToResolve[i];
1809
+ logger.start(`[${i + 1}/${totalToResolve}] Resolving skills for ${pkg.packageName}...`);
1804
1810
  const remote = await resolveRemoteContributionsForPackage(pkg, {
1805
1811
  cacheRoot: remoteCacheRoot,
1806
1812
  githubLookupTimeoutMs: GITHUB_LOOKUP_TIMEOUT_MS,
@@ -1853,7 +1859,8 @@ const module$1 = defineNuxtModule({
1853
1859
  logger.warn(formatConflictWarning(conflict));
1854
1860
  }
1855
1861
  const nuxtMetadata = await loadNuxtMetadata();
1856
- for (const target of targets) {
1862
+ for (let targetIdx = 0; targetIdx < targets.length; targetIdx++) {
1863
+ const target = targets[targetIdx];
1857
1864
  const { skillRoot } = getTargetSkillRoot(exportRoot, target, resolvedSkillName);
1858
1865
  const referencesRoot = join(skillRoot, "references");
1859
1866
  const nuxtRoot = join(referencesRoot, "nuxt");
@@ -1871,6 +1878,8 @@ const module$1 = defineNuxtModule({
1871
1878
  const nuxtIndexTemplate = await pathExists(nuxtIndexTemplatePath) ? await promises.readFile(nuxtIndexTemplatePath, "utf8") : "";
1872
1879
  const nuxtIndexContent = await renderAutomdTemplate(nuxtIndexTemplate, nuxtRoot);
1873
1880
  await writeFileIfChanged(join(nuxtRoot, "index.md"), nuxtIndexContent);
1881
+ if (targetIdx === 0)
1882
+ logger.start("Fetching Vue best-practices content...");
1874
1883
  const vueTemplateFiles = await buildVueTemplateFiles(vueRoot, remoteCacheRoot);
1875
1884
  for (const file of vueTemplateFiles) {
1876
1885
  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.4",
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": {