@stacksjs/actions 0.75.405 → 0.75.407
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/library/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{mkdir,rm}from"node:fs/promises";import{dirname,relative,resolve}from"node:path";import{transpilePackage,validateDeclarations,validateRuntimeExports}from"@stacksjs/build";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{buildComponentLibrary}from"@stacksjs/stx";import{functionEntryData}from"./entries";import{ambientGlobalsUsed,stxAmbientGlobals}from"./globals";import{libraryManifest,serializeManifest}from"./manifest";import{configuredLibrary,LibraryConfigError,resolveLibraryPackages}from"./packages";export async function buildLibraryPackages(options={}){const config=options.config??await configuredLibrary(),kinds=options.kinds,compile=options.compile??!0,all=await resolveLibraryPackages(config,{onUnmatched:options.allowEmpty?"skip":"error"}),packages=kinds?all.filter((pkg)=>kinds.includes(pkg.kind)):all;if(!packages.length){if(options.allowEmpty){log.info("No library packages are configured. Nothing to build.");return[]}throw new LibraryConfigError(kinds?`No ${kinds.join("/")} packages are configured. Add one to \`packages\` in config/library.ts.`:"No library packages are configured. Add one to `packages` in config/library.ts.")}const version=await projectVersion(),reports=[];for(const pkg of packages){const verb=compile?"Building":"Generating";log.info(`${verb} ${pkg.name} (${pkg.kind}, ${pkg.sources.length} source${pkg.sources.length===1?"":"s"})...`);if(compile)await rm(resolve(pkg.dir,"dist"),{recursive:!0,force:!0});await mkdir(pkg.dir,{recursive:!0});if(pkg.kind==="functions")await buildFunctionPackage(pkg,config,version,compile);else await buildComponentPackage(pkg,config,version,compile);reports.push({name:pkg.name,kind:pkg.kind,dir:pkg.dir,sources:pkg.sources.length});if(compile)log.success(`Built ${pkg.name} \u2192 ${relative(projectPath(),pkg.dir)}/dist`)}return reports}export async function generateLibraryPackages(options={}){return buildLibraryPackages({...options,compile:!1})}async function buildFunctionPackage(pkg,config,version,compile){await assertPublishable(pkg);const srcDir=resolve(pkg.dir,"src");await rm(srcDir,{recursive:!0,force:!0});const staged=[];for(const source of pkg.sources){const destination=resolve(srcDir,relative(pkg.sourceDir,source));await mkdir(dirname(destination),{recursive:!0});await Bun.write(destination,await Bun.file(source).text());staged.push(destination)}const entry=resolve(srcDir,"index.ts");if(staged.includes(entry))throw new LibraryConfigError(`Package "${pkg.name}" claims resources/functions/index.ts, which collides with the generated barrel. Rename it or exclude it.`);await Bun.write(entry,functionEntryData(pkg,staged));await writeManifest(pkg,config,version);if(!compile)return;await transpilePackage({dir:pkg.dir,pkgName:pkg.name,external:["@stacksjs/*","bun",...Object.keys(pkg.dependencies),...Object.keys(pkg.peerDependencies)]});await validateDeclarations(pkg.dir);await validateRuntimeExports(pkg.dir)}async function buildComponentPackage(pkg,config,version,compile){if(!compile){await writeManifest(pkg,config,version);return}const result=await buildComponentLibrary({inputDir:pkg.sourceDir,outputDir:resolve(pkg.dir,"dist"),prefix:pkg.prefix,components:pkg.sources.map((source)=>{const file=relative(pkg.sourceDir,source),stem=file.replace(/\.stx$/,"").split("/").at(-1);return pkg.names[stem]?{file,name:pkg.names[stem]}:{file}}),progressive:!0,manifest:!0,declarations:!0,css:!0,bundle:!0,minify:!0,sourcemap:pkg.sourcemap?"external":!1});log.debug(`${pkg.name}: compiled ${result.components.length} components (${result.totalBytes} bytes)`);await writeManifest(pkg,config,version);await validateDeclarations(pkg.dir);await validateRuntimeExports(pkg.dir)}async function assertPublishable(pkg){if(pkg.runtime==="stx")return;const globals=await stxAmbientGlobals();if(!globals.size)return;const offenders=[];for(const source of pkg.sources){const used=ambientGlobalsUsed(await Bun.file(source).text(),globals);if(used.length)offenders.push(` ${relative(projectPath(),source)} \u2192 ${used.join(", ")}`)}if(!offenders.length)return;throw new LibraryConfigError(`Package "${pkg.name}" uses stx's ambient globals, which no module exports:
|
|
1
|
+
import{mkdir,rm}from"node:fs/promises";import{dirname,relative,resolve}from"node:path";import{transpilePackage,validateDeclarations,validateRuntimeExports}from"@stacksjs/build";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{buildComponentLibrary}from"@stacksjs/stx";import{functionEntryData}from"./entries";import{ambientGlobalsUsed,stxAmbientGlobals}from"./globals";import{generatedReadme,libraryManifest,serializeManifest}from"./manifest";import{configuredLibrary,LibraryConfigError,resolveLibraryPackages}from"./packages";export async function buildLibraryPackages(options={}){const config=options.config??await configuredLibrary(),kinds=options.kinds,compile=options.compile??!0,all=await resolveLibraryPackages(config,{onUnmatched:options.allowEmpty?"skip":"error"}),packages=kinds?all.filter((pkg)=>kinds.includes(pkg.kind)):all;if(!packages.length){if(options.allowEmpty){log.info("No library packages are configured. Nothing to build.");return[]}throw new LibraryConfigError(kinds?`No ${kinds.join("/")} packages are configured. Add one to \`packages\` in config/library.ts.`:"No library packages are configured. Add one to `packages` in config/library.ts.")}const version=await projectVersion(),reports=[];for(const pkg of packages){const verb=compile?"Building":"Generating";log.info(`${verb} ${pkg.name} (${pkg.kind}, ${pkg.sources.length} source${pkg.sources.length===1?"":"s"})...`);if(compile)await rm(resolve(pkg.dir,"dist"),{recursive:!0,force:!0});await mkdir(pkg.dir,{recursive:!0});if(pkg.kind==="functions")await buildFunctionPackage(pkg,config,version,compile);else await buildComponentPackage(pkg,config,version,compile);reports.push({name:pkg.name,kind:pkg.kind,dir:pkg.dir,sources:pkg.sources.length});if(compile)log.success(`Built ${pkg.name} \u2192 ${relative(projectPath(),pkg.dir)}/dist`)}return reports}export async function generateLibraryPackages(options={}){return buildLibraryPackages({...options,compile:!1})}async function buildFunctionPackage(pkg,config,version,compile){await assertPublishable(pkg);const srcDir=resolve(pkg.dir,"src");await rm(srcDir,{recursive:!0,force:!0});const staged=[];for(const source of pkg.sources){const destination=resolve(srcDir,relative(pkg.sourceDir,source));await mkdir(dirname(destination),{recursive:!0});await Bun.write(destination,await Bun.file(source).text());staged.push(destination)}const entry=resolve(srcDir,"index.ts");if(staged.includes(entry))throw new LibraryConfigError(`Package "${pkg.name}" claims resources/functions/index.ts, which collides with the generated barrel. Rename it or exclude it.`);await Bun.write(entry,functionEntryData(pkg,staged));await writeManifest(pkg,config,version);if(!compile)return;await transpilePackage({dir:pkg.dir,pkgName:pkg.name,external:["@stacksjs/*","bun",...Object.keys(pkg.dependencies),...Object.keys(pkg.peerDependencies)]});await validateDeclarations(pkg.dir);await validateRuntimeExports(pkg.dir)}async function buildComponentPackage(pkg,config,version,compile){if(!compile){await writeManifest(pkg,config,version);return}const result=await buildComponentLibrary({inputDir:pkg.sourceDir,outputDir:resolve(pkg.dir,"dist"),prefix:pkg.prefix,components:pkg.sources.map((source)=>{const file=relative(pkg.sourceDir,source),stem=file.replace(/\.stx$/,"").split("/").at(-1);return pkg.names[stem]?{file,name:pkg.names[stem]}:{file}}),progressive:!0,manifest:!0,declarations:!0,css:!0,bundle:!0,minify:!0,sourcemap:pkg.sourcemap?"external":!1});log.debug(`${pkg.name}: compiled ${result.components.length} components (${result.totalBytes} bytes)`);await writeManifest(pkg,config,version);await validateDeclarations(pkg.dir);await validateRuntimeExports(pkg.dir)}async function assertPublishable(pkg){if(pkg.runtime==="stx")return;const globals=await stxAmbientGlobals();if(!globals.size)return;const offenders=[];for(const source of pkg.sources){const used=ambientGlobalsUsed(await Bun.file(source).text(),globals);if(used.length)offenders.push(` ${relative(projectPath(),source)} \u2192 ${used.join(", ")}`)}if(!offenders.length)return;throw new LibraryConfigError(`Package "${pkg.name}" uses stx's ambient globals, which no module exports:
|
|
2
2
|
${offenders.join(`
|
|
3
3
|
`)}
|
|
4
4
|
|
|
5
|
-
A consumer importing the published package would hit a ReferenceError. Either import those names explicitly in the source, or set \`runtime: 'stx'\` on the package in config/library.ts to declare that it is only ever consumed from inside an stx app.`)}async function writeManifest(pkg,config,version){const manifest=libraryManifest(pkg,config,version,pkg.sources.map((source)=>relative(projectPath(),source)));await Bun.write(resolve(pkg.dir,"package.json"),serializeManifest(withRuntime(manifest,pkg)))}function withRuntime(manifest,pkg){if(pkg.runtime!=="stx")return manifest;return{...manifest,stacks:{...manifest.stacks,runtime:"stx"}}}export async function projectVersion(){return(await Bun.file(projectPath("package.json")).json()).version??"0.0.0"}
|
|
5
|
+
A consumer importing the published package would hit a ReferenceError. Either import those names explicitly in the source, or set \`runtime: 'stx'\` on the package in config/library.ts to declare that it is only ever consumed from inside an stx app.`)}async function writeManifest(pkg,config,version){const manifest=libraryManifest(pkg,config,version,pkg.sources.map((source)=>relative(projectPath(),source)));await Bun.write(resolve(pkg.dir,"package.json"),serializeManifest(withRuntime(manifest,pkg)));await Bun.write(resolve(pkg.dir,"README.md"),await readme(pkg,config))}async function readme(pkg,config){if(!pkg.readme)return generatedReadme(pkg,config);const file=Bun.file(projectPath(pkg.readme));if(!await file.exists())throw new LibraryConfigError(`Package "${pkg.name}" names readme "${pkg.readme}", which does not exist.`);return file.text()}function withRuntime(manifest,pkg){if(pkg.runtime!=="stx")return manifest;return{...manifest,stacks:{...manifest.stacks,runtime:"stx"}}}export async function projectVersion(){return(await Bun.file(projectPath("package.json")).json()).version??"0.0.0"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { LibraryConfig } from '@stacksjs/types';
|
|
2
2
|
import type { ResolvedLibraryPackage } from './packages';
|
|
3
|
+
/**
|
|
4
|
+
* The README a package publishes when its config names none. The manifest
|
|
5
|
+
* always lists README.md in `files`, so without this every package went to
|
|
6
|
+
* the registry with an empty page.
|
|
7
|
+
*/
|
|
8
|
+
export declare function generatedReadme(pkg: ResolvedLibraryPackage, config: LibraryConfig | undefined): string;
|
|
3
9
|
/**
|
|
4
10
|
* Build the package.json a library package publishes.
|
|
5
11
|
*
|
package/dist/library/manifest.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function generatedReadme(pkg,config){const lines=[`# ${pkg.name}`,"",pkg.description,"","## Install","","```sh",`bun add ${pkg.name}`,"```",""],license=pkg.license??config?.license;if(config?.repository)lines.push(`Source: https://github.com/${config.repository}`,"");if(license)lines.push(`License: ${license}`,"");return lines.join(`
|
|
2
|
+
`)}export function libraryManifest(pkg,config,version,sourcesRelativeToProject){const cfg=config??{},repository=cfg.repository,manifest={name:pkg.name,type:"module",version:pkg.version??version,description:pkg.description,author:cfg.author,contributors:cfg.contributors,license:pkg.license??cfg.license,homepage:repository?`https://github.com/${repository}#readme`:void 0,repository:repository?{type:"git",url:`git+https://github.com/${repository}.git`}:void 0,bugs:repository?{url:`https://github.com/${repository}/issues`}:void 0,keywords:pkg.keywords.length?pkg.keywords:void 0,exports:{".":{types:"./dist/index.d.ts",import:pkg.kind==="web-components"?"./dist/bundle.js":"./dist/index.js",default:pkg.kind==="web-components"?"./dist/bundle.js":"./dist/index.js"},"./*":{types:"./dist/*.d.ts",import:"./dist/*.js",default:"./dist/*.js"}},module:pkg.kind==="web-components"?"dist/bundle.js":"dist/index.js",types:"dist/index.d.ts",files:["README.md","dist"],dependencies:Object.keys(pkg.dependencies).length?pkg.dependencies:void 0,peerDependencies:Object.keys(pkg.peerDependencies).length?pkg.peerDependencies:void 0,stacks:{kind:pkg.kind,sources:sourcesRelativeToProject}};if(pkg.private)manifest.private=!0;else manifest.publishConfig={access:pkg.access};if(pkg.kind!=="functions"){manifest.exports["./style.css"]="./dist/bundle.css";manifest.exports["./custom-elements.json"]="./dist/custom-elements.json"}return manifest}export function serializeManifest(manifest){return`${JSON.stringify(manifest,(_key,value)=>value===void 0?void 0:value,2)}
|
|
2
3
|
`}
|
package/dist/library/packages.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync}from"node:fs";import{relative,resolve}from"node:path";import process from"node:process";import{awaitConfig,library}from"@stacksjs/config";import{componentsPath,functionsPath,libraryPackagePath}from"@stacksjs/path";export async function configuredLibrary(){await awaitConfig();return library}export class LibraryConfigError extends Error{name="LibraryConfigError"}const DEFAULT_FUNCTION_INCLUDE=["**/*.ts"],DEFAULT_FUNCTION_EXCLUDE=["**/*.test.ts","**/*.spec.ts","**/*.d.ts","**/_*.ts"],DEFAULT_COMPONENT_INCLUDE=["**/*.stx"],DEFAULT_COMPONENT_EXCLUDE=[];export function libraryPackageSourceDir(kind){return kind==="functions"?functionsPath():componentsPath()}export function unscopedName(name){return name.split("/").at(-1)??name}function includeFromFilesEntry(entry){const[file,alias]=Array.isArray(entry)?entry:[entry,void 0],stem=file.replace(/\.ts$/,""),include=stem==="*"?"*.ts":`${stem}.ts`;return alias?{include,alias:[stem,alias]}:{include}}function toDefinition(option,fallback){const name=option.name?.trim();if(!name)throw new LibraryConfigError(`library.packages[${fallback.index}] has no name. Every package needs the name it is published under.`);if(name.startsWith(".")||name.includes("\\")||name.split("/").length>2)throw new LibraryConfigError(`library.packages[${fallback.index}] has an invalid npm name: "${name}".`);const kind=option.kind??"functions";if(kind!=="functions"&&kind!=="components"&&kind!=="web-components")throw new LibraryConfigError(`Package "${name}" has an unknown kind "${kind}". Expected 'functions', 'components' or 'web-components'.`);const slug=(option.dir??unscopedName(name)).replace(/^@/,"");if(!/^[\w.-]+$/.test(slug))throw new LibraryConfigError(`Package "${name}" resolves to the directory "${slug}", which is not a single safe path segment. Set \`dir\` explicitly.`);const aliases={},includeFromFiles=[];for(const entry of option.files??[]){const{include,alias}=includeFromFilesEntry(entry);includeFromFiles.push(include);if(alias)aliases[alias[0]]=alias[1]}const names={};for(const tag of option.tags??[])if(Array.isArray(tag.name))names[tag.name[0]]=tag.name[1];const defaultInclude=kind==="functions"?DEFAULT_FUNCTION_INCLUDE:DEFAULT_COMPONENT_INCLUDE,defaultExclude=kind==="functions"?DEFAULT_FUNCTION_EXCLUDE:DEFAULT_COMPONENT_EXCLUDE,includeFromTags=option.tags?.length&&!option.include?.length?option.tags.map((tag)=>`${Array.isArray(tag.name)?tag.name[0]:tag.name}.stx`):[],include=option.include?.length?option.include:includeFromFiles.length?includeFromFiles:includeFromTags.length?includeFromTags:defaultInclude;return{name,kind,slug,description:option.description??`The ${name} library.`,keywords:option.keywords??[],license:option.license??fallback.license,version:option.version,private:option.private??!1,access:option.access??"public",registry:option.registry??"pantry",runtime:option.runtime??"standalone",sourcemap:option.shouldGenerateSourcemap??!1,include,exclude:option.exclude??defaultExclude,prefix:option.prefix??unscopedName(name).replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase(),dependencies:option.dependencies??{},peerDependencies:option.peerDependencies??{},aliases,names}}export function normalizeLibraryPackages(config){const cfg=config??{},options=[];if(cfg.packages?.length)options.push(...cfg.packages);else{if(cfg.functions?.name)options.push({...cfg.functions,kind:"functions"});if(cfg.webComponents?.name)options.push({...cfg.webComponents,kind:"web-components"})}const definitions=options.map((option,index)=>toDefinition(option,{license:cfg.license,index})),byName=new Map,bySlug=new Map;for(const definition of definitions){if(byName.has(definition.name))throw new LibraryConfigError(`Two packages are both named "${definition.name}". npm names must be unique.`);byName.set(definition.name,1);const owner=bySlug.get(definition.slug);if(owner)throw new LibraryConfigError(`"${owner}" and "${definition.name}" both build in storage/framework/libs/packages/${definition.slug}. Give one of them a \`dir\`.`);bySlug.set(definition.slug,definition.name)}return definitions}export async function resolveLibraryPackages(config,options={}){const definitions=normalizeLibraryPackages(config),resolved=[];for(const definition of definitions){const sourceDir=libraryPackageSourceDir(definition.kind),sources=await matchSources(sourceDir,definition.include,definition.exclude);if(!sources.length){if(options.onUnmatched==="skip")continue;throw new LibraryConfigError(`Package "${definition.name}" matched no files in ${relative(process.cwd(),sourceDir)} (include: ${definition.include.join(", ")}${definition.exclude.length?`; exclude: ${definition.exclude.join(", ")}`:""}).`)}resolved.push({...definition,sourceDir,sources,dir:libraryPackagePath(definition.slug),entry:libraryPackagePath(definition.slug,"src/index.ts")})}return resolved}export async function matchSources(sourceDir,include,exclude){if(!existsSync(sourceDir))return[];const expand=async(patterns)=>{const files=new Set;for(const pattern of patterns)for await(const file of new Bun.Glob(pattern).scan({cwd:sourceDir,absolute:!0,onlyFiles:!0}))files.add(resolve(file));return files},included=await expand(include),excluded=exclude.length?await expand(exclude):new Set;return[...included].filter((file)=>!excluded.has(file)).sort()}export function entrySpecifier(entry,source){const path=relative(resolve(entry,".."),source).replace(/\.ts$/,"");return path.startsWith(".")?path:`./${path}`}
|
|
1
|
+
import{existsSync}from"node:fs";import{relative,resolve}from"node:path";import process from"node:process";import{awaitConfig,library}from"@stacksjs/config";import{componentsPath,functionsPath,libraryPackagePath}from"@stacksjs/path";export async function configuredLibrary(){await awaitConfig();return library}export class LibraryConfigError extends Error{name="LibraryConfigError"}const DEFAULT_FUNCTION_INCLUDE=["**/*.ts"],DEFAULT_FUNCTION_EXCLUDE=["**/*.test.ts","**/*.spec.ts","**/*.d.ts","**/_*.ts"],DEFAULT_COMPONENT_INCLUDE=["**/*.stx"],DEFAULT_COMPONENT_EXCLUDE=[];export function libraryPackageSourceDir(kind){return kind==="functions"?functionsPath():componentsPath()}export function unscopedName(name){return name.split("/").at(-1)??name}function includeFromFilesEntry(entry){const[file,alias]=Array.isArray(entry)?entry:[entry,void 0],stem=file.replace(/\.ts$/,""),include=stem==="*"?"*.ts":`${stem}.ts`;return alias?{include,alias:[stem,alias]}:{include}}function toDefinition(option,fallback){const name=option.name?.trim();if(!name)throw new LibraryConfigError(`library.packages[${fallback.index}] has no name. Every package needs the name it is published under.`);if(name.startsWith(".")||name.includes("\\")||name.split("/").length>2)throw new LibraryConfigError(`library.packages[${fallback.index}] has an invalid npm name: "${name}".`);const kind=option.kind??"functions";if(kind!=="functions"&&kind!=="components"&&kind!=="web-components")throw new LibraryConfigError(`Package "${name}" has an unknown kind "${kind}". Expected 'functions', 'components' or 'web-components'.`);const slug=(option.dir??unscopedName(name)).replace(/^@/,"");if(!/^[\w.-]+$/.test(slug))throw new LibraryConfigError(`Package "${name}" resolves to the directory "${slug}", which is not a single safe path segment. Set \`dir\` explicitly.`);const aliases={},includeFromFiles=[];for(const entry of option.files??[]){const{include,alias}=includeFromFilesEntry(entry);includeFromFiles.push(include);if(alias)aliases[alias[0]]=alias[1]}const names={};for(const tag of option.tags??[])if(Array.isArray(tag.name))names[tag.name[0]]=tag.name[1];const defaultInclude=kind==="functions"?DEFAULT_FUNCTION_INCLUDE:DEFAULT_COMPONENT_INCLUDE,defaultExclude=kind==="functions"?DEFAULT_FUNCTION_EXCLUDE:DEFAULT_COMPONENT_EXCLUDE,includeFromTags=option.tags?.length&&!option.include?.length?option.tags.map((tag)=>`${Array.isArray(tag.name)?tag.name[0]:tag.name}.stx`):[],include=option.include?.length?option.include:includeFromFiles.length?includeFromFiles:includeFromTags.length?includeFromTags:defaultInclude;return{name,kind,slug,description:option.description??`The ${name} library.`,keywords:option.keywords??[],license:option.license??fallback.license,version:option.version,private:option.private??!1,access:option.access??"public",registry:option.registry??"pantry",readme:option.readme,runtime:option.runtime??"standalone",sourcemap:option.shouldGenerateSourcemap??!1,include,exclude:option.exclude??defaultExclude,prefix:option.prefix??unscopedName(name).replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase(),dependencies:option.dependencies??{},peerDependencies:option.peerDependencies??{},aliases,names}}export function normalizeLibraryPackages(config){const cfg=config??{},options=[];if(cfg.packages?.length)options.push(...cfg.packages);else{if(cfg.functions?.name)options.push({...cfg.functions,kind:"functions"});if(cfg.webComponents?.name)options.push({...cfg.webComponents,kind:"web-components"})}const definitions=options.map((option,index)=>toDefinition(option,{license:cfg.license,index})),byName=new Map,bySlug=new Map;for(const definition of definitions){if(byName.has(definition.name))throw new LibraryConfigError(`Two packages are both named "${definition.name}". npm names must be unique.`);byName.set(definition.name,1);const owner=bySlug.get(definition.slug);if(owner)throw new LibraryConfigError(`"${owner}" and "${definition.name}" both build in storage/framework/libs/packages/${definition.slug}. Give one of them a \`dir\`.`);bySlug.set(definition.slug,definition.name)}return definitions}export async function resolveLibraryPackages(config,options={}){const definitions=normalizeLibraryPackages(config),resolved=[];for(const definition of definitions){const sourceDir=libraryPackageSourceDir(definition.kind),sources=await matchSources(sourceDir,definition.include,definition.exclude);if(!sources.length){if(options.onUnmatched==="skip")continue;throw new LibraryConfigError(`Package "${definition.name}" matched no files in ${relative(process.cwd(),sourceDir)} (include: ${definition.include.join(", ")}${definition.exclude.length?`; exclude: ${definition.exclude.join(", ")}`:""}).`)}resolved.push({...definition,sourceDir,sources,dir:libraryPackagePath(definition.slug),entry:libraryPackagePath(definition.slug,"src/index.ts")})}return resolved}export async function matchSources(sourceDir,include,exclude){if(!existsSync(sourceDir))return[];const expand=async(patterns)=>{const files=new Set;for(const pattern of patterns)for await(const file of new Bun.Glob(pattern).scan({cwd:sourceDir,absolute:!0,onlyFiles:!0}))files.add(resolve(file));return files},included=await expand(include),excluded=exclude.length?await expand(exclude):new Set;return[...included].filter((file)=>!excluded.has(file)).sort()}export function entrySpecifier(entry,source){const path=relative(resolve(entry,".."),source).replace(/\.ts$/,"");return path.startsWith(".")?path:`./${path}`}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.407",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -66,54 +66,54 @@
|
|
|
66
66
|
"prepublishOnly": "bun run build"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@stacksjs/action-runner": "0.75.
|
|
70
|
-
"@stacksjs/ai": "0.75.
|
|
71
|
-
"@stacksjs/analytics": "0.75.
|
|
72
|
-
"@stacksjs/api": "0.75.
|
|
73
|
-
"@stacksjs/auth": "0.75.
|
|
74
|
-
"@stacksjs/build": "0.75.
|
|
69
|
+
"@stacksjs/action-runner": "0.75.407",
|
|
70
|
+
"@stacksjs/ai": "0.75.407",
|
|
71
|
+
"@stacksjs/analytics": "0.75.407",
|
|
72
|
+
"@stacksjs/api": "0.75.407",
|
|
73
|
+
"@stacksjs/auth": "0.75.407",
|
|
74
|
+
"@stacksjs/build": "0.75.407",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.26",
|
|
76
76
|
"@stacksjs/bunpress": "^0.2.15",
|
|
77
|
-
"@stacksjs/cli": "0.75.
|
|
78
|
-
"@stacksjs/cloud": "0.75.
|
|
79
|
-
"@stacksjs/cms": "0.75.
|
|
77
|
+
"@stacksjs/cli": "0.75.407",
|
|
78
|
+
"@stacksjs/cloud": "0.75.407",
|
|
79
|
+
"@stacksjs/cms": "0.75.407",
|
|
80
80
|
"@stacksjs/components": "0.2.779",
|
|
81
|
-
"@stacksjs/config": "0.75.
|
|
82
|
-
"@stacksjs/database": "0.75.
|
|
83
|
-
"@stacksjs/desktop-build": "0.75.
|
|
84
|
-
"@stacksjs/dns": "0.75.
|
|
85
|
-
"@stacksjs/enums": "0.75.
|
|
86
|
-
"@stacksjs/env": "0.75.
|
|
87
|
-
"@stacksjs/error-handling": "0.75.
|
|
88
|
-
"@stacksjs/github": "0.75.
|
|
81
|
+
"@stacksjs/config": "0.75.407",
|
|
82
|
+
"@stacksjs/database": "0.75.407",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.407",
|
|
84
|
+
"@stacksjs/dns": "0.75.407",
|
|
85
|
+
"@stacksjs/enums": "0.75.407",
|
|
86
|
+
"@stacksjs/env": "0.75.407",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.407",
|
|
88
|
+
"@stacksjs/github": "0.75.407",
|
|
89
89
|
"@stacksjs/gitit": "^0.2.5",
|
|
90
|
-
"@stacksjs/i18n": "0.75.
|
|
91
|
-
"@stacksjs/image": "0.75.
|
|
92
|
-
"@stacksjs/logging": "0.75.
|
|
90
|
+
"@stacksjs/i18n": "0.75.407",
|
|
91
|
+
"@stacksjs/image": "0.75.407",
|
|
92
|
+
"@stacksjs/logging": "0.75.407",
|
|
93
93
|
"@stacksjs/logsmith": "^0.2.11",
|
|
94
|
-
"@stacksjs/mobile": "0.75.
|
|
95
|
-
"@stacksjs/orm": "0.75.
|
|
96
|
-
"@stacksjs/path": "0.75.
|
|
97
|
-
"@stacksjs/payments": "0.75.
|
|
98
|
-
"@stacksjs/queue": "0.75.
|
|
99
|
-
"@stacksjs/registry": "0.75.
|
|
100
|
-
"@stacksjs/router": "0.75.
|
|
94
|
+
"@stacksjs/mobile": "0.75.407",
|
|
95
|
+
"@stacksjs/orm": "0.75.407",
|
|
96
|
+
"@stacksjs/path": "0.75.407",
|
|
97
|
+
"@stacksjs/payments": "0.75.407",
|
|
98
|
+
"@stacksjs/queue": "0.75.407",
|
|
99
|
+
"@stacksjs/registry": "0.75.407",
|
|
100
|
+
"@stacksjs/router": "0.75.407",
|
|
101
101
|
"@stacksjs/rpx": "^0.11.54",
|
|
102
|
-
"@stacksjs/scheduler": "0.75.
|
|
103
|
-
"@stacksjs/search-engine": "0.75.
|
|
104
|
-
"@stacksjs/security": "0.75.
|
|
105
|
-
"@stacksjs/server": "0.75.
|
|
106
|
-
"@stacksjs/sites": "0.75.
|
|
107
|
-
"@stacksjs/storage": "0.75.
|
|
108
|
-
"@stacksjs/strings": "0.75.
|
|
102
|
+
"@stacksjs/scheduler": "0.75.407",
|
|
103
|
+
"@stacksjs/search-engine": "0.75.407",
|
|
104
|
+
"@stacksjs/security": "0.75.407",
|
|
105
|
+
"@stacksjs/server": "0.75.407",
|
|
106
|
+
"@stacksjs/sites": "0.75.407",
|
|
107
|
+
"@stacksjs/storage": "0.75.407",
|
|
108
|
+
"@stacksjs/strings": "0.75.407",
|
|
109
109
|
"@stacksjs/stx": "0.2.779",
|
|
110
110
|
"@stacksjs/tlsx": "^0.13.19",
|
|
111
111
|
"@stacksjs/ts-cloud": "^0.16.91",
|
|
112
112
|
"@stacksjs/ts-md": "^0.1.1",
|
|
113
|
-
"@stacksjs/tunnel": "0.75.
|
|
114
|
-
"@stacksjs/types": "0.75.
|
|
115
|
-
"@stacksjs/utils": "0.75.
|
|
116
|
-
"@stacksjs/whois": "0.75.
|
|
113
|
+
"@stacksjs/tunnel": "0.75.407",
|
|
114
|
+
"@stacksjs/types": "0.75.407",
|
|
115
|
+
"@stacksjs/utils": "0.75.407",
|
|
116
|
+
"@stacksjs/whois": "0.75.407",
|
|
117
117
|
"bun-plugin-stx": "0.2.779"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@stacksjs/validation": "0.75.
|
|
132
|
+
"@stacksjs/validation": "0.75.407",
|
|
133
133
|
"better-dx": "^0.2.24"
|
|
134
134
|
}
|
|
135
135
|
}
|