Add initial core package structure with TypeScript support#15
Draft
ColemanSWE wants to merge 3 commits into
Draft
Add initial core package structure with TypeScript support#15ColemanSWE wants to merge 3 commits into
ColemanSWE wants to merge 3 commits into
Conversation
- Created package.json, README.md, and .gitignore for the core library. - Added TypeScript configuration files for CommonJS and ESM modules. - Implemented core types and container functions for Docker image generation. - Included build and Dockerfile generation logic for ComfyUI space management.
ColemanSWE
marked this pull request as draft
February 13, 2026 13:34
imprsnst
self-requested a review
February 13, 2026 13:36
- Added Vitest for testing with new test scripts in package.json. - Introduced postcss.config.mjs for future CSS processing. - Created generator.ts for Dockerfile generation logic, replacing the previous dockerfile.ts. - Implemented comprehensive tests for Dockerfile generation in generator.test.ts. - Updated README.md for local development instructions. - Refactored build.ts to utilize the new generator module.
Author
|
@ashish-aesthisia Added more info, tests, etc! As noted in the description, this doesn't change any functionality in the codebase itself yet, just adds the package (which is not published to NPM either yet). I can also go through and test using this in the app itself if you'd like, but I thought I'd stop and let you review the progress so far first before I continue! Let me know what you think. 😸 |
…ocess - Introduced integration-test.mjs to validate Dockerfile generation and building. - Updated build.ts, generator.ts, and related test files to support ESM imports. - Refactored postcss.config.mjs and vitest.config.ts for improved configuration. - Enhanced type imports in various files for consistency and clarity.
Author
|
Howdy! Checking in on this. 😸 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add @comfy-spaces/core NPM Package
Purpose
This PR introduces
@comfy-spaces/core, a reusable NPM package that extracts the containerization functionality from Comfy-Spaces into a standalone library. This enables other projects to programmatically generate Dockerfiles and build Docker images for ComfyUI spaces without requiring the full Comfy-Spaces application.Scope
This initial release focuses exclusively on containerization:
Future iterations may include additional functionality like space management, workflow exports, or other utilities.
What's Included
Package Structure
packages/core/@comfy-spaces/coreExports
Main Entry (
@comfy-spaces/core)Type definitions matching the app's
space.jsonformat:Container Subpath (
@comfy-spaces/core/container)Containerization functions and types:
Core Features
generateDockerfile(config, options?)SpaceConfigextra_model_paths.yamlbuildImage(config, options?)Testing
generateDockerfile, 9 forbuildImage)child_process.spawnto avoid requiring DockerDocumentation
packages/core/README.mdTesting Instructions
Prerequisites
cd packages/core npm install1. Run Unit Tests
npm testAll 31 tests should pass.
2. Verify Build
This compiles TypeScript to both ESM (
dist/esm/) and CJS (dist/cjs/) formats with type declarations (dist/types/).3. Test Dockerfile Generation (No Docker Required)
node integration-test.mjs --cpu # or node integration-test.mjs --gpuThis generates and validates a Dockerfile without requiring Docker. Output is written to
test-output-Dockerfilefor inspection.4. Test Full Docker Build (Requires Docker)
If you have Docker installed and running:
This will actually build a Docker image to verify end-to-end functionality.
5. Manual Testing
Create a
test.mjsfile:Run:
node test.mjsChanges Summary
New Files (17 files, 2,441+ lines)
packages/core/package.json- Package configurationpackages/core/README.md- Documentationpackages/core/.gitignore- Git ignore rulespackages/core/tsconfig.json- Base TypeScript configpackages/core/tsconfig.esm.json- ESM build configpackages/core/tsconfig.cjs.json- CJS build configpackages/core/vitest.config.ts- Test configurationpackages/core/postcss.config.mjs- PostCSS config (prevents parent config issues)packages/core/src/types.ts- Core type definitionspackages/core/src/index.ts- Main entry pointpackages/core/src/container/types.ts- Container typespackages/core/src/container/generator.ts- Dockerfile generation logicpackages/core/src/container/build.ts- Docker build logicpackages/core/src/container/index.ts- Container subpath entrypackages/core/src/container/generator.test.ts- Generator tests (22 tests)packages/core/src/container/build.test.ts- Build tests (9 tests)packages/core/integration-test.mjs- Manual integration test scriptTechnical Highlights
.jsextensions for proper ESM module resolutionFuture Work
This package currently handles containerization only. Potential future additions:
Notes
space.jsonformat used by the application