blume 0.1.2 → 0.1.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/cli/index.js CHANGED
@@ -5112,9 +5112,23 @@ var FRAMEWORK_BY_EXT2 = {
5112
5112
  vue: "vue"
5113
5113
  };
5114
5114
  var EXAMPLE_FILE = /\.(?<ext>astro|jsx|svelte|tsx|vue)$/u;
5115
- var discoverExamples = async (root, subdir = "examples") => {
5116
- const dir = join10(root, subdir);
5117
- const matches = await glob2(["**/*.{astro,jsx,svelte,tsx,vue}"], {
5115
+ var DEFAULT_EXAMPLE_GLOB = "**/*.{astro,jsx,svelte,tsx,vue}";
5116
+ var GLOB_MAGIC = /[!*?[\]{}]/u;
5117
+ var splitGlobBase = (pattern) => {
5118
+ const segments = pattern.split("/");
5119
+ const firstMagic = segments.findIndex((segment) => GLOB_MAGIC.test(segment));
5120
+ if (firstMagic === -1) {
5121
+ return { base: pattern, rest: "" };
5122
+ }
5123
+ return {
5124
+ base: segments.slice(0, firstMagic).join("/"),
5125
+ rest: segments.slice(firstMagic).join("/")
5126
+ };
5127
+ };
5128
+ var discoverExamples = async (root, pattern = "examples") => {
5129
+ const { base, rest } = GLOB_MAGIC.test(pattern) ? splitGlobBase(pattern) : { base: pattern, rest: DEFAULT_EXAMPLE_GLOB };
5130
+ const dir = join10(root, base);
5131
+ const matches = await glob2([rest], {
5118
5132
  absolute: true,
5119
5133
  cwd: dir,
5120
5134
  onlyFiles: true
@@ -5700,7 +5714,7 @@ var generateRuntime = async (project) => {
5700
5714
  ...exampleDiscovery.warnings
5701
5715
  ];
5702
5716
  for (const dep of searchProviderMeta(config.search.provider).runtimeDeps) {
5703
- if (!canResolveFrom(context.root, dep)) {
5717
+ if (!(canResolveFrom(context.root, dep) || canResolveFrom(packageRoot(), dep))) {
5704
5718
  warnings.push(`Search provider "${config.search.provider}" needs "${dep}", which isn't installed. Run \`npm install ${dep}\` (or your package manager's equivalent).`);
5705
5719
  }
5706
5720
  }
@@ -10064,7 +10078,7 @@ var eject = async (root) => {
10064
10078
  context.themeFile ? readFile14(context.themeFile, "utf-8") : Promise.resolve(""),
10065
10079
  buildRawMarkdown(project),
10066
10080
  discoverIslands(root),
10067
- discoverExamples(root)
10081
+ discoverExamples(root, config.examples)
10068
10082
  ]);
10069
10083
  const frameworks = new Set([
10070
10084
  ...islands.islands.map((island) => island.framework),
@@ -12725,5 +12739,5 @@ var main = defineCommand11({
12725
12739
  });
12726
12740
  runMain(main);
12727
12741
 
12728
- //# debugId=C5E764B7F3B6157B64756E2164756E21
12742
+ //# debugId=55EFB0DA63E08C3864756E2164756E21
12729
12743
  //# sourceMappingURL=index.js.map