Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a9a8ea4
feat: Add TDI2 Interactive Playground application
claude Nov 17, 2025
e60da45
.
Nov 17, 2025
ec35f1a
fix: Use actual FunctionalDIEnhancedTransformer instead of demo code
claude Nov 17, 2025
fa397c0
fix: Make transformer truly browser-compatible by avoiding Node.js de…
claude Nov 17, 2025
fef7c32
finally browser only but most likely issues in rest of implemtation
Nov 17, 2025
27ff3e3
fix some issues
Nov 17, 2025
52d7b9f
.
Nov 19, 2025
8e82424
Merge remote-tracking branch 'origin/main' into claude/create-di-core…
Nov 19, 2025
a6a6f7a
fix: Add verbose property and make playground fully browser-compatible
claude Nov 19, 2025
fde0b9f
refactor: Remove verbose flag entirely from all plugins
claude Nov 19, 2025
8c33b83
refactor: Replace verbose flag with consoleFor logging in all plugins
claude Nov 19, 2025
f60eadd
fix: Add ConfigManager export and excludePatterns to fix vite-plugin …
claude Nov 19, 2025
39ef1a7
wip: Restructure playground with multi-file examples
claude Nov 19, 2025
f2d0797
feat: Add multi-file playground UI with file tree and before/after views
claude Nov 19, 2025
704f772
minor changes to run all tests
Nov 20, 2025
b71e9f6
.
Nov 20, 2025
691c717
minor changes
Nov 20, 2025
764a7c6
fix: Use correct Inject<T> props pattern in all playground examples
claude Nov 20, 2025
dfbc583
update gh pages
Nov 20, 2025
cee0521
fix: Replace @di-inject marker detection with Inject<T> type analysis
claude Nov 20, 2025
c699ed4
fix: Use correct dependency extraction methods and add vitest
claude Nov 20, 2025
13edec6
feat: Add Sandpack live preview to playground
claude Nov 20, 2025
94d8512
fix: Use correct dependency extraction methods and add vitest
claude Nov 21, 2025
7586f7b
fix: Add .ts extensions to imports for Vite compatibility
claude Nov 21, 2025
d134d79
fix: Update Vite aliases to include .ts extensions and add ImportManager
claude Nov 21, 2025
5533a3d
feat: Add editable editor, before/after toggle, and URL sharing
claude Nov 21, 2025
f7c9725
fix: Replace || with ?? to avoid mixing operators without parens
claude Nov 21, 2025
1a8b090
feat: Add generated DI_CONFIG file in after view
claude Nov 21, 2025
42e3ce4
fix: Prevent infinite transformation loop with proper debouncing
claude Nov 21, 2025
df3778a
fix: Generate real DI_CONFIG structure using InterfaceResolver
claude Nov 21, 2025
51dd9b2
fix: Prevent transformation stacking and Monaco editor state bleed
claude Nov 21, 2025
8f9c36e
fix: Pass project instance to InterfaceResolver to find services
claude Nov 21, 2025
be95e33
fix: Manually scan in-memory source files instead of using scanProject()
claude Nov 21, 2025
e19b849
fix: Use correct property name 'interfaces' instead of 'interfaceToIm…
claude Nov 21, 2025
fd7b998
feat: Filter DI_CONFIG to only show services used in current example
claude Nov 21, 2025
d4de876
fix: Add proper syntax highlighting for TSX files
claude Nov 21, 2025
fcc13a5
fix: Enable proper syntax highlighting for TSX files
claude Nov 21, 2025
3705baf
.
Nov 21, 2025
76e4e9c
fix: Add sanitizedKey to interface mappings for proper service token …
claude Nov 21, 2025
1787b5f
fix: Use actual generated DI_CONFIG in Sandpack preview
claude Nov 21, 2025
af2cf62
fix: Send ORIGINAL source code to Sandpack with Vite plugin (not tran…
claude Nov 21, 2025
17dc6a2
fix: Use browser-transformed code in preview instead of Vite plugin
claude Nov 21, 2025
27b75cf
fix: Correct import paths in generated DI_CONFIG for Sandpack
claude Nov 21, 2025
4c25344
fix: Make preview use full area without sidebars or empty space
claude Nov 21, 2025
4963977
fix: Update virtual files and re-scan interfaces before transformation
claude Nov 21, 2025
c3811b5
.
Nov 21, 2025
6e1399c
fix: Cache used services BEFORE transformation to prevent lag
claude Nov 21, 2025
ba2407b
fix: Correct virtual file paths in transform() and open preview by de…
claude Nov 21, 2025
e672ade
fix: Wait for transformedFiles before showing preview
claude Nov 21, 2025
f981513
fix: Resolve stale closure causing preview to lag one update behind
claude Nov 21, 2025
128c3bf
fix: Resolve preview lag and unnecessary reloads
claude Nov 21, 2025
bfd0a18
fix: Register all discovered services in playground DI_CONFIG
claude Nov 21, 2025
819fb80
fix: Restore service filtering and add detailed debug logging
claude Nov 21, 2025
3f1c18e
fix: Remove pre-created common services from BrowserTransformer
claude Nov 21, 2025
66742c1
fix: Resolve preview lag and unnecessary reloads
claude Nov 21, 2025
6ee712c
fix: Prevent preview from loading before transformation completes
claude Nov 21, 2025
2532a06
debug: Add comprehensive logging to diagnose timing issue
claude Nov 21, 2025
064829b
fix: Ensure transformAllFiles runs after transformer initializes
claude Nov 21, 2025
910a8f5
fix: Resolve 'can't access lexical declaration before initialization'…
claude Nov 21, 2025
06a23b0
fix: Clear virtual filesystem before loading new example files
claude Nov 21, 2025
9d22555
refactor: Remove redundant useInMemoryFileSystem option
claude Nov 21, 2025
e13cd61
revert uneccessary changes
Nov 21, 2025
fcb3d3e
revert unneccessary changes
Nov 21, 2025
465aaea
remove slop
Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
bun install
bun run build

- name: Build playground
run: |
cd monorepo/apps/di-playground
bun install
bun run build

- name: Upload test harness for Pages
uses: actions/upload-artifact@v4
with:
Expand All @@ -64,6 +70,12 @@ jobs:
name: docs-dist
path: monorepo/apps/docs-starlight/dist/

- name: Upload playground for Pages
uses: actions/upload-artifact@v4
with:
name: playground-dist
path: monorepo/apps/di-playground/dist/

# Deploy to GitHub Pages
deploy-pages:
name: Deploy to GitHub Pages
Expand All @@ -89,6 +101,12 @@ jobs:
name: test-harness-dist
path: ./pages-site/test-harness

- name: Download playground build
uses: actions/download-artifact@v4
with:
name: playground-dist
path: ./pages-site/playground

- name: Create root index page
run: |
cat > ./pages-site/index.html << 'EOF'
Expand Down Expand Up @@ -130,7 +148,7 @@ jobs:
}
.links {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-top: 2rem;
}
Expand Down Expand Up @@ -184,6 +202,10 @@ jobs:
<h2>🧪 Interactive Examples</h2>
<p>Live demos and transformations you can try right now</p>
</a>
<a href="./playground/" class="link-card">
<h2>🎮 Playground</h2>
<p>Interactive code editor with live transformation preview</p>
</a>
</div>

<div class="github-link">
Expand Down
165 changes: 92 additions & 73 deletions Backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,26 @@

## ordered log (for production release)

### console log in di-core and vite-plugin
### fix interface collision & test case

### remove magic strings
two interface of the same name and in different files are resolved inproperly

see `.includes('` `*.*js*,*.md,*.test.ts`
`should fail with current implementation - interface name collision`

Magic strings that will cause plugin failures for users and need to be made configurable:
### [✅] playground

#### 🔴 HIGH PRIORITY - Will break plugin functionality:
> ✅ use vite plugin in playground application similarly to https://typia.io/playground/ or others

**1. File path filtering (affects all users):**
- ✅ fix all builds
- ✅ fix all tests
- ✅ add playground delpoyment to github pages
- ✅ add build and ALL tests to CI
- ✅ dicore unit & e2e
- ✅ cross package
- ✅ e2e

- `shouldSkipFile` / `shouldProcessFile` in multiple locations:
- [functional-di-enhanced-transformer.ts:468-471](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/functional-di-enhanced-transformer.ts#L468-L471) - `'generated'`, `'node_modules'`, `'.d.ts'`, `'.tdi2'`
- [utils.ts:10-15](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/utils.ts#L10-L15) - `'generated'`, `'node_modules'`, `'.d.ts'`, `'.tdi2'`, `'.test.'`, `'.spec.'`
- [integrated-interface-resolver.ts:346-349](monorepo/packages/di-core/tools/interface-resolver/integrated-interface-resolver.ts#L346-L349) - Same patterns
- [enhanced-di-transformer.ts:314-317](monorepo/packages/di-core/tools/enhanced-di-transformer.ts#L314-L317) - Same patterns
- [plugin-core/config.ts:127,132](monorepo/packages/plugin-core/src/config.ts#L127,132) - `'node_modules'`, `'.tdi2'`, `'/generated/'`

**Issue**: Users with custom output directories or non-standard project structures will have their files incorrectly filtered
**Solution**: Add `excludePatterns?: string[]` to plugin options

**2. DI pattern detection (affects pattern matching):**

- [pattern-detection.ts:36-82](monorepo/packages/plugin-core/src/pattern-detection.ts#L36-L82):
- Service patterns: `'@Service'`, `'Inject<'`, `'@Inject'`, `'implements'`, `'Interface'`
- File naming: `'.service.'`, `'/services/'`, `'\\services\\'`, `'.component.'`, `'/components/'`, `'\\components\\'`

**Issue**: Users with different naming conventions won't be detected
**Solution**: Make pattern detection configurable via plugin options (already partially done via `advanced.diPatterns`)

**3. Marker detection hardcoded strings:**

- [utils.ts:41,88](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/utils.ts#L41,88) - `'Inject<'`, `'InjectOptional<'`
- [debug-file-generator.ts:144-170](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/debug-file-generator.ts#L144-L170) - `'useService('`, `'useOptionalService('`, `'import'`, `'const {'`, `'} = props'`, etc.

**Issue**: Users with custom DI markers won't be detected
**Solution**: Already configurable via `advanced.diPatterns.interfaceMarker`

#### 🟡 MEDIUM PRIORITY - May affect some users:

**4. Vite plugin-specific patterns:**

- [vite-plugin-di/plugin.ts:405,494](monorepo/packages/vite-plugin-di/src/plugin.ts#L405,494) - `'.tdi2'` for HMR filtering

**Issue**: Users with custom outputDir won't get proper HMR
**Solution**: Use `options.outputDir` instead of hardcoded `.tdi2`

**5. HMR message detection:**

- [vite-plugin-di/e2e/helpers.ts:198,217-218](monorepo/packages/vite-plugin-di/e2e/helpers.ts#L198,217-218) - `'[vite] hmr update'`, `'[vite] hot updated'`, `'[vite] page reload'`, `'full-reload'`

**Issue**: Tests only - false positive

#### ACTION ITEMS:

1. **Add to plugin options**:

```typescript
export interface DIPluginOptions {
// ... existing options
excludePatterns?: string[]; // Default: ['node_modules', '.d.ts', '.test.', '.spec.']
excludeDirs?: string[]; // Default: ['node_modules']
// Note: outputDir already configurable, should be used instead of hardcoded '.tdi2'
}
```

2. **Files to update**:
- Replace hardcoded `'.tdi2'` checks with `options.outputDir` in vite-plugin HMR code
- Replace hardcoded exclude patterns with `options.excludePatterns` in all `shouldSkipFile` functions
- Document that `advanced.diPatterns` is available for custom marker detection

3. **Testing**:
- Add tests for custom `outputDir` with HMR
- Add tests for custom `excludePatterns`

### [❌] playground

> use vite plugin in playground application similarly to https://typia.io/playground/ or others
✅ fix preview
✅ fix comments in PR

### [❌] write state ownership docs section

Expand Down Expand Up @@ -756,6 +697,84 @@ evaluate scenarios

## Done

### ✅ console log in di-core and vite-plugin

improve logging with DEBUG and LOG_LEVEL

### ✅ remove magic strings

see `.includes('` `*.*js*,*.md,*.test.ts`

Magic strings that will cause plugin failures for users and need to be made configurable:

#### 🔴 HIGH PRIORITY - Will break plugin functionality:

**1. File path filtering (affects all users):**

- `shouldSkipFile` / `shouldProcessFile` in multiple locations:
- [functional-di-enhanced-transformer.ts:468-471](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/functional-di-enhanced-transformer.ts#L468-L471) - `'generated'`, `'node_modules'`, `'.d.ts'`, `'.tdi2'`
- [utils.ts:10-15](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/utils.ts#L10-L15) - `'generated'`, `'node_modules'`, `'.d.ts'`, `'.tdi2'`, `'.test.'`, `'.spec.'`
- [integrated-interface-resolver.ts:346-349](monorepo/packages/di-core/tools/interface-resolver/integrated-interface-resolver.ts#L346-L349) - Same patterns
- [enhanced-di-transformer.ts:314-317](monorepo/packages/di-core/tools/enhanced-di-transformer.ts#L314-L317) - Same patterns
- [plugin-core/config.ts:127,132](monorepo/packages/plugin-core/src/config.ts#L127,132) - `'node_modules'`, `'.tdi2'`, `'/generated/'`

**Issue**: Users with custom output directories or non-standard project structures will have their files incorrectly filtered
**Solution**: Add `excludePatterns?: string[]` to plugin options

**2. DI pattern detection (affects pattern matching):**

- [pattern-detection.ts:36-82](monorepo/packages/plugin-core/src/pattern-detection.ts#L36-L82):
- Service patterns: `'@Service'`, `'Inject<'`, `'@Inject'`, `'implements'`, `'Interface'`
- File naming: `'.service.'`, `'/services/'`, `'\\services\\'`, `'.component.'`, `'/components/'`, `'\\components\\'`

**Issue**: Users with different naming conventions won't be detected
**Solution**: Make pattern detection configurable via plugin options (already partially done via `advanced.diPatterns`)

**3. Marker detection hardcoded strings:**

- [utils.ts:41,88](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/utils.ts#L41,88) - `'Inject<'`, `'InjectOptional<'`
- [debug-file-generator.ts:144-170](monorepo/packages/di-core/tools/functional-di-enhanced-transformer/debug-file-generator.ts#L144-L170) - `'useService('`, `'useOptionalService('`, `'import'`, `'const {'`, `'} = props'`, etc.

**Issue**: Users with custom DI markers won't be detected
**Solution**: Already configurable via `advanced.diPatterns.interfaceMarker`

#### 🟡 MEDIUM PRIORITY - May affect some users:

**4. Vite plugin-specific patterns:**

- [vite-plugin-di/plugin.ts:405,494](monorepo/packages/vite-plugin-di/src/plugin.ts#L405,494) - `'.tdi2'` for HMR filtering

**Issue**: Users with custom outputDir won't get proper HMR
**Solution**: Use `options.outputDir` instead of hardcoded `.tdi2`

**5. HMR message detection:**

- [vite-plugin-di/e2e/helpers.ts:198,217-218](monorepo/packages/vite-plugin-di/e2e/helpers.ts#L198,217-218) - `'[vite] hmr update'`, `'[vite] hot updated'`, `'[vite] page reload'`, `'full-reload'`

**Issue**: Tests only - false positive

#### ACTION ITEMS:

1. **Add to plugin options**:

```typescript
export interface DIPluginOptions {
// ... existing options
excludePatterns?: string[]; // Default: ['node_modules', '.d.ts', '.test.', '.spec.']
excludeDirs?: string[]; // Default: ['node_modules']
// Note: outputDir already configurable, should be used instead of hardcoded '.tdi2'
}
```

2. **Files to update**:
- Replace hardcoded `'.tdi2'` checks with `options.outputDir` in vite-plugin HMR code
- Replace hardcoded exclude patterns with `options.excludePatterns` in all `shouldSkipFile` functions
- Document that `advanced.diPatterns` is available for custom marker detection

3. **Testing**:
- Add tests for custom `outputDir` with HMR
- Add tests for custom `excludePatterns`

### ✅ hot reload fixes added path issue

see `src/generated` to src/.tdi2
Expand Down
Loading
Loading