@dxtmisha/scripts 0.9.0 → 0.10.0
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/CHANGELOG.md +30 -0
- package/package.json +2 -1
- package/src/classes/Ai/AiClaudeAgent.ts +16 -0
- package/src/classes/Ai/AiClaudeAgentLite.ts +86 -0
- package/src/classes/Ai/AiClaudeCliLite.ts +29 -65
- package/src/classes/Ai/AiClaudeLite.ts +19 -7
- package/src/classes/Ai/AiGoogleCliLite.ts +27 -64
- package/src/classes/Ai/AiOpenAi.ts +26 -0
- package/src/classes/Ai/AiOpenAiLite.ts +107 -0
- package/src/classes/Ai/AiZAi.ts +17 -0
- package/src/classes/Ai/AiZAiLite.ts +26 -0
- package/src/classes/Ai/ApiTmp.ts +43 -0
- package/src/classes/Build/BuildPackages.ts +33 -7
- package/src/classes/Design/DesignComponent.ts +1 -1
- package/src/classes/Library/LibraryAiPromptItem.ts +36 -2
- package/src/composables/useAi.ts +15 -0
- package/src/config.ts +2 -0
- package/src/demo/ai.ts +10 -0
- package/src/library-ai.ts +4 -4
- package/src/library.ts +67 -54
- package/src/media/templates/componentDoc/materials/README.md +8 -0
- package/src/media/templates/componentDoc/materials/prompt.txt +28 -0
- package/src/media/templates/componentDoc/wiki/prompt.txt +21 -0
- package/src/media/templates/componentDoc/wiki/run.ts +2 -1
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.txt +19 -0
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.txt +21 -0
- package/src/media/templates/prompts/componentPrompt.en.txt +71 -16
- package/src/media/templates/prompts/componentPrompt.ru.txt +71 -16
- package/src/types/configTypes.ts +9 -2
- package/src/classes/Component/__tests__/ComponentCreator.test.ts +0 -71
- package/src/classes/Component/__tests__/ComponentItem.test.ts +0 -71
- package/src/classes/Git/__tests__/GitRead.test.ts +0 -70
- package/src/composables/__tests__/useAi.test.ts +0 -75
- package/src/functions/__tests__/getComponentPaths.test.ts +0 -19
- package/src/functions/__tests__/getConfigAi.test.ts +0 -26
- package/src/functions/__tests__/getConstructorProperties.test.ts +0 -51
- package/src/functions/__tests__/getDirname.test.ts +0 -31
- package/src/functions/__tests__/getNameDirByPaths.test.ts +0 -40
- package/src/functions/__tests__/getPackageJson.test.ts +0 -34
- package/src/functions/__tests__/hasNativeDirname.test.ts +0 -18
- package/src/functions/__tests__/toPathStandardSep.test.ts +0 -31
- package/src/media/templates/componentDoc/figma/run-figma.ts +0 -26
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi, beforeEach } from 'vitest'
|
|
2
|
-
import { toPathStandardSep } from '../toPathStandardSep'
|
|
3
|
-
import requirePath from 'path'
|
|
4
|
-
|
|
5
|
-
vi.mock('path', async (importOriginal) => {
|
|
6
|
-
const actual = await importOriginal<typeof import('path')>()
|
|
7
|
-
return {
|
|
8
|
-
...actual,
|
|
9
|
-
default: {
|
|
10
|
-
...actual,
|
|
11
|
-
sep: '/'
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
describe('toPathStandardSep', () => {
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
vi.clearAllMocks()
|
|
19
|
-
vi.mocked(requirePath).sep = '/'
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('should replace all forward slashes with the platform-specific separator', () => {
|
|
23
|
-
vi.mocked(requirePath).sep = '\\'
|
|
24
|
-
expect(toPathStandardSep('src/components/button')).toBe('src\\components\\button')
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('should not change the path if it already uses the correct separator (unix)', () => {
|
|
28
|
-
vi.mocked(requirePath).sep = '/'
|
|
29
|
-
expect(toPathStandardSep('src/components/button')).toBe('src/components/button')
|
|
30
|
-
})
|
|
31
|
-
})
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env vite-node
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
|
|
4
|
-
import { spawn } from 'node:child_process'
|
|
5
|
-
|
|
6
|
-
;(async () => {
|
|
7
|
-
try {
|
|
8
|
-
// Figma file key. Can be found in the URL of your Figma file:
|
|
9
|
-
// figma.com/design/FILE_KEY/...
|
|
10
|
-
const fileKey = ''
|
|
11
|
-
|
|
12
|
-
// Node ID in Figma file. Select an element and find 'node-id=...' in the URL
|
|
13
|
-
// or use "Copy link to selection" to see it in the URL.
|
|
14
|
-
const nodeId = ''
|
|
15
|
-
|
|
16
|
-
const child = spawn(
|
|
17
|
-
'npx',
|
|
18
|
-
['dxt-figma-layout', fileKey, nodeId],
|
|
19
|
-
{ stdio: 'inherit' }
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
child.on('exit', code => console.log('End:', code))
|
|
23
|
-
} catch (error) {
|
|
24
|
-
console.error('Error:', error)
|
|
25
|
-
}
|
|
26
|
-
})()
|