@intlayer/chokidar 8.1.2 → 8.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/assets/installSkills/skills/angular.md +3 -0
- package/dist/assets/installSkills/skills/astro.md +3 -0
- package/dist/assets/installSkills/skills/cli.md +7 -4
- package/dist/assets/installSkills/skills/config.md +3 -0
- package/dist/assets/installSkills/skills/content.md +3 -0
- package/dist/assets/installSkills/skills/next_js.md +3 -0
- package/dist/assets/installSkills/skills/preact.md +3 -2
- package/dist/assets/installSkills/skills/react.md +3 -0
- package/dist/assets/installSkills/skills/solid.md +3 -0
- package/dist/assets/installSkills/skills/svelte.md +3 -0
- package/dist/assets/installSkills/skills/usage.md +2 -0
- package/dist/assets/installSkills/skills/vue.md +3 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
- package/dist/cjs/build.cjs +1 -51
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +1 -53
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/index.cjs +1 -6
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +1 -26
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +4 -78
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +4 -62
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -46
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +1 -50
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +1 -59
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/cleanOutputDir.cjs +1 -30
- package/dist/cjs/cleanOutputDir.cjs.map +1 -1
- package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -96
- package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
- package/dist/cjs/cli.cjs +1 -21
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -70
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +7 -41
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +1 -24
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +1 -24
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/index.cjs +1 -16
- package/dist/cjs/createType/createModuleAugmentation.cjs +9 -110
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/createType/createType.cjs +1 -29
- package/dist/cjs/createType/createType.cjs.map +1 -1
- package/dist/cjs/createType/index.cjs +1 -8
- package/dist/cjs/fetchDistantDictionaries.cjs +1 -50
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs +1 -49
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/formatDictionary.cjs +1 -49
- package/dist/cjs/formatDictionary.cjs.map +1 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +1 -39
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +1 -34
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileChange.cjs +1 -49
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileMoved.cjs +1 -24
- package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -37
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -131
- package/dist/cjs/init/index.cjs +1 -242
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs +1 -164
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
- package/dist/cjs/init/utils/fileSystem.cjs +1 -30
- package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
- package/dist/cjs/init/utils/index.cjs +1 -13
- package/dist/cjs/init/utils/jsonParser.cjs +3 -42
- package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
- package/dist/cjs/init/utils/tsConfig.cjs +1 -18
- package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
- package/dist/cjs/initConfig/index.cjs +1 -38
- package/dist/cjs/initConfig/index.cjs.map +1 -1
- package/dist/cjs/installSkills/index.cjs +1 -172
- package/dist/cjs/installSkills/index.cjs.map +1 -1
- package/dist/cjs/listDictionariesPath.cjs +1 -41
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +5 -95
- package/dist/cjs/listGitFiles.cjs.map +1 -1
- package/dist/cjs/listProjects.cjs +1 -47
- package/dist/cjs/listProjects.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -66
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/index.cjs +1 -12
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -72
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -125
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -28
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +1 -61
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +3 -135
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +1 -95
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs +1 -30
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +1 -12
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
- package/dist/cjs/transformFiles/extractDictionaryKey.cjs +1 -16
- package/dist/cjs/transformFiles/extractDictionaryKey.cjs.map +1 -1
- package/dist/cjs/transformFiles/index.cjs +1 -10
- package/dist/cjs/transformFiles/transformFiles.cjs +1 -251
- package/dist/cjs/transformFiles/transformFiles.cjs.map +1 -1
- package/dist/cjs/utils/autoDecorateContent.cjs +1 -87
- package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
- package/dist/cjs/utils/buildFilesList.cjs +1 -50
- package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
- package/dist/cjs/utils/chunkJSON.cjs +1 -336
- package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
- package/dist/cjs/utils/formatter.cjs +1 -16
- package/dist/cjs/utils/formatter.cjs.map +1 -1
- package/dist/cjs/utils/getChunk.cjs +1 -34
- package/dist/cjs/utils/getChunk.cjs.map +1 -1
- package/dist/cjs/utils/getComponentTransformPattern.cjs +1 -48
- package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
- package/dist/cjs/utils/getFileHash.cjs +1 -12
- package/dist/cjs/utils/getFileHash.cjs.map +1 -1
- package/dist/cjs/utils/getFormatFromExtension.cjs +1 -31
- package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -46
- package/dist/cjs/utils/pLimit.cjs +1 -128
- package/dist/cjs/utils/pLimit.cjs.map +1 -1
- package/dist/cjs/utils/parallelize.cjs +1 -11
- package/dist/cjs/utils/parallelize.cjs.map +1 -1
- package/dist/cjs/utils/parallelizeGlobal.cjs +1 -29
- package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
- package/dist/cjs/utils/reduceObjectFormat.cjs +1 -31
- package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
- package/dist/cjs/utils/resolveObjectPromises.cjs +1 -21
- package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
- package/dist/cjs/utils/runOnce.cjs +1 -95
- package/dist/cjs/utils/runOnce.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/bin.cjs +1 -54
- package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/bootstrap.cjs +1 -24
- package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/index.cjs +1 -110
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/pidTree.cjs +1 -145
- package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/ps.cjs +1 -49
- package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/runTask.cjs +1 -154
- package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnPosix.cjs +1 -59
- package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnWin32.cjs +1 -43
- package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/wmic.cjs +1 -52
- package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
- package/dist/cjs/utils/sortAlphabetically.cjs +1 -7
- package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
- package/dist/cjs/utils/splitTextByLine.cjs +1 -11
- package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +1 -60
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
- package/dist/cjs/watcher.cjs +1 -95
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeConfiguration/index.cjs +1 -34
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +1 -28
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs +1 -31
- package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/index.cjs +1 -12
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +1 -93
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +2 -1775
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +1 -77
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -123
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +1 -71
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/cjs/writeFileIfChanged.cjs +1 -12
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
- package/dist/cjs/writeJsonIfChanged.cjs +1 -17
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
- package/dist/esm/_virtual/_utils_asset.mjs +2 -97
- package/dist/esm/build.mjs +1 -24
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +1 -51
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/index.mjs +1 -4
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +1 -24
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +4 -75
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +4 -59
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -44
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +1 -48
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +1 -56
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
- package/dist/esm/cleanOutputDir.mjs +1 -28
- package/dist/esm/cleanOutputDir.mjs.map +1 -1
- package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -93
- package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
- package/dist/esm/cli.mjs +1 -8
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -68
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +7 -39
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +1 -21
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +1 -21
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/index.mjs +1 -9
- package/dist/esm/createType/createModuleAugmentation.mjs +9 -106
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/createType/createType.mjs +1 -26
- package/dist/esm/createType/createType.mjs.map +1 -1
- package/dist/esm/createType/index.mjs +1 -4
- package/dist/esm/fetchDistantDictionaries.mjs +1 -48
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs +1 -46
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/formatDictionary.mjs +1 -44
- package/dist/esm/formatDictionary.mjs.map +1 -1
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +1 -37
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +1 -32
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileChange.mjs +1 -47
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileMoved.mjs +1 -22
- package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -35
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -57
- package/dist/esm/init/index.mjs +1 -240
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/configManipulation.mjs +1 -161
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
- package/dist/esm/init/utils/fileSystem.mjs +1 -26
- package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
- package/dist/esm/init/utils/index.mjs +1 -6
- package/dist/esm/init/utils/jsonParser.mjs +3 -40
- package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
- package/dist/esm/init/utils/tsConfig.mjs +1 -16
- package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
- package/dist/esm/initConfig/index.mjs +1 -36
- package/dist/esm/initConfig/index.mjs.map +1 -1
- package/dist/esm/installSkills/index.mjs +1 -167
- package/dist/esm/installSkills/index.mjs.map +1 -1
- package/dist/esm/listDictionariesPath.mjs +1 -37
- package/dist/esm/listDictionariesPath.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +5 -90
- package/dist/esm/listGitFiles.mjs.map +1 -1
- package/dist/esm/listProjects.mjs +1 -43
- package/dist/esm/listProjects.mjs.map +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -65
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
- package/dist/esm/loadDictionaries/index.mjs +1 -6
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -69
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -123
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -26
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +1 -58
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/log.mjs +3 -132
- package/dist/esm/loadDictionaries/log.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +1 -92
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/applyMask.mjs +1 -28
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +1 -10
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
- package/dist/esm/transformFiles/extractDictionaryKey.mjs +1 -14
- package/dist/esm/transformFiles/extractDictionaryKey.mjs.map +1 -1
- package/dist/esm/transformFiles/index.mjs +1 -4
- package/dist/esm/transformFiles/transformFiles.mjs +1 -244
- package/dist/esm/transformFiles/transformFiles.mjs.map +1 -1
- package/dist/esm/utils/autoDecorateContent.mjs +1 -85
- package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
- package/dist/esm/utils/buildFilesList.mjs +1 -47
- package/dist/esm/utils/buildFilesList.mjs.map +1 -1
- package/dist/esm/utils/chunkJSON.mjs +1 -333
- package/dist/esm/utils/chunkJSON.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +1 -12
- package/dist/esm/utils/formatter.mjs.map +1 -1
- package/dist/esm/utils/getChunk.mjs +1 -33
- package/dist/esm/utils/getChunk.mjs.map +1 -1
- package/dist/esm/utils/getComponentTransformPattern.mjs +1 -44
- package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
- package/dist/esm/utils/getFileHash.mjs +1 -9
- package/dist/esm/utils/getFileHash.mjs.map +1 -1
- package/dist/esm/utils/getFormatFromExtension.mjs +1 -28
- package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -20
- package/dist/esm/utils/pLimit.mjs +1 -125
- package/dist/esm/utils/pLimit.mjs.map +1 -1
- package/dist/esm/utils/parallelize.mjs +1 -10
- package/dist/esm/utils/parallelize.mjs.map +1 -1
- package/dist/esm/utils/parallelizeGlobal.mjs +1 -26
- package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
- package/dist/esm/utils/reduceObjectFormat.mjs +1 -29
- package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
- package/dist/esm/utils/resolveObjectPromises.mjs +1 -19
- package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
- package/dist/esm/utils/runOnce.mjs +1 -92
- package/dist/esm/utils/runOnce.mjs.map +1 -1
- package/dist/esm/utils/runParallel/bin.mjs +1 -52
- package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
- package/dist/esm/utils/runParallel/bootstrap.mjs +1 -22
- package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
- package/dist/esm/utils/runParallel/index.mjs +1 -108
- package/dist/esm/utils/runParallel/index.mjs.map +1 -1
- package/dist/esm/utils/runParallel/pidTree.mjs +1 -142
- package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
- package/dist/esm/utils/runParallel/ps.mjs +1 -46
- package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
- package/dist/esm/utils/runParallel/runTask.mjs +1 -152
- package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
- package/dist/esm/utils/runParallel/spawnPosix.mjs +1 -57
- package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
- package/dist/esm/utils/runParallel/spawnWin32.mjs +1 -41
- package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
- package/dist/esm/utils/runParallel/wmic.mjs +1 -49
- package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
- package/dist/esm/utils/sortAlphabetically.mjs +1 -5
- package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
- package/dist/esm/utils/splitTextByLine.mjs +1 -9
- package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs +1 -58
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
- package/dist/esm/watcher.mjs +1 -92
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeConfiguration/index.mjs +1 -31
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +1 -26
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +1 -29
- package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/index.mjs +1 -7
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +1 -91
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +2 -1773
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +1 -75
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -121
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +1 -69
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/esm/writeFileIfChanged.mjs +1 -10
- package/dist/esm/writeFileIfChanged.mjs.map +1 -1
- package/dist/esm/writeJsonIfChanged.mjs +1 -16
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
- package/dist/types/build.d.ts +3 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/index.d.ts +16 -24
- package/dist/types/initConfig/index.d.ts +1 -1
- package/dist/types/initConfig/index.d.ts.map +1 -1
- package/dist/types/listGitFiles.d.ts.map +1 -1
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/transformFiles/transformFiles.d.ts +1 -1
- package/dist/types/transformFiles/transformFiles.d.ts.map +1 -1
- package/dist/types/utils/formatter.d.ts +1 -1
- package/dist/types/watcher.d.ts +1 -1
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
- package/package.json +10 -15
|
@@ -1,173 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require__utils_asset = require('../_virtual/_utils_asset.cjs');
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
node_path = require_runtime.__toESM(node_path);
|
|
6
|
-
let _intlayer_core = require("@intlayer/core");
|
|
7
|
-
let node_fs = require("node:fs");
|
|
8
|
-
|
|
9
|
-
//#region src/installSkills/index.ts
|
|
10
|
-
const SKILLS_METADATA = {
|
|
11
|
-
Usage: "How to use Intlayer in your project",
|
|
12
|
-
RemoteContent: "How to use Intlayer with Remote/CMS/Server-side content",
|
|
13
|
-
Config: "Intlayer configuration documentation",
|
|
14
|
-
Content: "Reference for all Intlayer content node types (t, enu, etc.)",
|
|
15
|
-
React: "React-specific syntax and hooks usage",
|
|
16
|
-
Angular: "Angular-specific syntax and Injectable Function usage",
|
|
17
|
-
NextJS: "Next.js-specific usage (Server & Client components)",
|
|
18
|
-
Vue: "Vue-specific composables and syntax",
|
|
19
|
-
Preact: "Preact-specific syntax and hooks usage",
|
|
20
|
-
Solid: "Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.",
|
|
21
|
-
Svelte: "Svelte-specific stores and syntax",
|
|
22
|
-
Astro: "Astro-specific usage and getIntlayer",
|
|
23
|
-
CLI: "Intlayer CLI commands and usage"
|
|
24
|
-
};
|
|
25
|
-
const SKILLS = Object.keys(SKILLS_METADATA);
|
|
26
|
-
/**
|
|
27
|
-
* Maps specific skill keys to special filenames if they differ from standard snake_case.
|
|
28
|
-
*/
|
|
29
|
-
const SKILL_FILENAME_MAP = {};
|
|
30
|
-
/**
|
|
31
|
-
* Configuration for Platform paths to keep code clean.
|
|
32
|
-
*/
|
|
33
|
-
const PLATFORM_DIRS = {
|
|
34
|
-
Cursor: ".cursor/skills",
|
|
35
|
-
Windsurf: ".windsurf/skills",
|
|
36
|
-
Trae: ".trae/skills",
|
|
37
|
-
OpenCode: ".opencode/skills",
|
|
38
|
-
GitHub: ".github/skills",
|
|
39
|
-
Claude: ".claude/skills",
|
|
40
|
-
VSCode: ".vscode/skills",
|
|
41
|
-
Antigravity: ".agent/skills",
|
|
42
|
-
Augment: ".augment/skills",
|
|
43
|
-
OpenClaw: "skills",
|
|
44
|
-
Cline: ".cline/skills",
|
|
45
|
-
CodeBuddy: ".codebuddy/skills",
|
|
46
|
-
CommandCode: ".commandcode/skills",
|
|
47
|
-
Continue: ".continue/skills",
|
|
48
|
-
Crush: ".crush/skills",
|
|
49
|
-
Droid: ".factory/skills",
|
|
50
|
-
Goose: ".goose/skills",
|
|
51
|
-
Junie: ".junie/skills",
|
|
52
|
-
IFlow: ".iflow/skills",
|
|
53
|
-
KiloCode: ".kilocode/skills",
|
|
54
|
-
Kiro: ".kiro/skills",
|
|
55
|
-
Kode: ".kode/skills",
|
|
56
|
-
MCPJam: ".mcpjam/skills",
|
|
57
|
-
MistralVibe: ".vibe/skills",
|
|
58
|
-
Mux: ".mux/skills",
|
|
59
|
-
OpenHands: ".openhands/skills",
|
|
60
|
-
Pi: ".pi/skills",
|
|
61
|
-
Qoder: ".qoder/skills",
|
|
62
|
-
Qwen: ".qwen/skills",
|
|
63
|
-
RooCode: ".roo/skills",
|
|
64
|
-
TraeCN: ".trae/skills",
|
|
65
|
-
Zencoder: ".zencoder/skills",
|
|
66
|
-
Neovate: ".neovate/skills",
|
|
67
|
-
Pochi: ".pochi/skills",
|
|
68
|
-
Other: "skills"
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Helper to convert CamelCase to kebab-case for directory naming
|
|
72
|
-
*/
|
|
73
|
-
const camelToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
74
|
-
/**
|
|
75
|
-
* Reads the raw markdown content for a specific skill from the assets folder.
|
|
76
|
-
*/
|
|
77
|
-
const getSkillContent = (skill) => {
|
|
78
|
-
const fileName = `./skills/${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}.md`;
|
|
79
|
-
try {
|
|
80
|
-
return require__utils_asset.readAsset(fileName);
|
|
81
|
-
} catch {
|
|
82
|
-
console.warn(`Warning: Could not read asset for skill: ${skill} at ${fileName}`);
|
|
83
|
-
return "";
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Reads the licence content from the assets folder.
|
|
88
|
-
*/
|
|
89
|
-
const getLicenceContent = () => {
|
|
90
|
-
try {
|
|
91
|
-
return require__utils_asset.readAsset("./LICENCE.md");
|
|
92
|
-
} catch {
|
|
93
|
-
console.warn("Warning: Could not read LICENCE.md asset");
|
|
94
|
-
return "";
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Fetches the content of a URL using native fetch.
|
|
99
|
-
*/
|
|
100
|
-
const fetchUrlContent = async (url) => {
|
|
101
|
-
const response = await fetch(url);
|
|
102
|
-
if (!response.ok) throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
|
|
103
|
-
return response.text();
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Installs skills using the "Agent Skills" directory standard.
|
|
107
|
-
* Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md
|
|
108
|
-
*/
|
|
109
|
-
const installSkills = async (projectRoot, platform, skills) => {
|
|
110
|
-
const relativeDir = PLATFORM_DIRS[platform] ?? "skills";
|
|
111
|
-
const skillsBaseDir = node_path.default.join(projectRoot, relativeDir);
|
|
112
|
-
const useAgentStructure = platform !== "VSCode";
|
|
113
|
-
await node_fs.promises.mkdir(skillsBaseDir, { recursive: true });
|
|
114
|
-
const createdSkills = [];
|
|
115
|
-
const licenceContent = getLicenceContent();
|
|
116
|
-
for (const skill of skills) {
|
|
117
|
-
const skillName = `intlayer-${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}`;
|
|
118
|
-
const skillContent = getSkillContent(skill);
|
|
119
|
-
if (!skillContent) continue;
|
|
120
|
-
const urls = Array.from(new Set(skillContent.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g) || []));
|
|
121
|
-
if (useAgentStructure) {
|
|
122
|
-
const skillDir = node_path.default.join(skillsBaseDir, skillName);
|
|
123
|
-
const referenceDir = node_path.default.join(skillDir, "references");
|
|
124
|
-
await node_fs.promises.mkdir(referenceDir, { recursive: true });
|
|
125
|
-
if (licenceContent) await node_fs.promises.writeFile(node_path.default.join(skillDir, "LICENCE.md"), licenceContent, "utf-8");
|
|
126
|
-
let updatedSkillContent = skillContent;
|
|
127
|
-
const downloadPromises = urls.map(async (url) => {
|
|
128
|
-
try {
|
|
129
|
-
const content = await fetchUrlContent(url);
|
|
130
|
-
const metadata = (0, _intlayer_core.getMarkdownMetadata)(content);
|
|
131
|
-
let fileName = "";
|
|
132
|
-
if (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== "doc").join("_");
|
|
133
|
-
else fileName = new URL(url).pathname.split("/").filter((part) => part && part !== "doc").map((part) => part.replace(".md", "")).join("_");
|
|
134
|
-
fileName = fileName ? `${fileName}.md` : "index.md";
|
|
135
|
-
return {
|
|
136
|
-
url,
|
|
137
|
-
localRefPath: `references/${fileName}`,
|
|
138
|
-
fileName,
|
|
139
|
-
content,
|
|
140
|
-
success: true
|
|
141
|
-
};
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.warn(`Warning: Failed to download ref ${url} for skill ${skill}`, error);
|
|
144
|
-
return {
|
|
145
|
-
url,
|
|
146
|
-
success: false
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const results = await Promise.all(downloadPromises);
|
|
151
|
-
for (const res of results) if (res.success && res.fileName && res.content && res.localRefPath) {
|
|
152
|
-
await node_fs.promises.writeFile(node_path.default.join(referenceDir, res.fileName), res.content, "utf-8");
|
|
153
|
-
updatedSkillContent = updatedSkillContent.replaceAll(res.url, res.localRefPath);
|
|
154
|
-
}
|
|
155
|
-
const filePath = node_path.default.join(skillDir, "SKILL.md");
|
|
156
|
-
await node_fs.promises.writeFile(filePath, updatedSkillContent, "utf-8");
|
|
157
|
-
createdSkills.push(`${skillName}/SKILL.md`);
|
|
158
|
-
} else {
|
|
159
|
-
const fileName = `${skillName}.md`;
|
|
160
|
-
const filePath = node_path.default.join(skillsBaseDir, fileName);
|
|
161
|
-
await node_fs.promises.writeFile(filePath, skillContent, "utf-8");
|
|
162
|
-
createdSkills.push(fileName);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (createdSkills.length === 0) return `No skill files were created. Check your asset paths.`;
|
|
166
|
-
return `Created ${createdSkills.length} skills in ${skillsBaseDir}`;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
//#endregion
|
|
170
|
-
exports.SKILLS = SKILLS;
|
|
171
|
-
exports.SKILLS_METADATA = SKILLS_METADATA;
|
|
172
|
-
exports.installSkills = installSkills;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../_virtual/_utils_asset.cjs`);let n=require(`node:path`);n=e.__toESM(n);let r=require(`@intlayer/core/markdown`),i=require(`node:fs`);const a={Usage:`How to use Intlayer in your project`,RemoteContent:`How to use Intlayer with Remote/CMS/Server-side content`,Config:`Intlayer configuration documentation`,Content:`Reference for all Intlayer content node types (t, enu, etc.)`,React:`React-specific syntax and hooks usage`,Angular:`Angular-specific syntax and Injectable Function usage`,NextJS:`Next.js-specific usage (Server & Client components)`,Vue:`Vue-specific composables and syntax`,Preact:`Preact-specific syntax and hooks usage`,Solid:`Integrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", use the "useIntlayer" hook in Solid, or manage locales in a SolidJS application.`,Svelte:`Svelte-specific stores and syntax`,Astro:`Astro-specific usage and getIntlayer`,CLI:`Intlayer CLI commands and usage`},o=Object.keys(a),s={},c={Cursor:`.cursor/skills`,Windsurf:`.windsurf/skills`,Trae:`.trae/skills`,OpenCode:`.opencode/skills`,GitHub:`.github/skills`,Claude:`.claude/skills`,VSCode:`.vscode/skills`,Antigravity:`.agent/skills`,Augment:`.augment/skills`,OpenClaw:`skills`,Cline:`.cline/skills`,CodeBuddy:`.codebuddy/skills`,CommandCode:`.commandcode/skills`,Continue:`.continue/skills`,Crush:`.crush/skills`,Droid:`.factory/skills`,Goose:`.goose/skills`,Junie:`.junie/skills`,IFlow:`.iflow/skills`,KiloCode:`.kilocode/skills`,Kiro:`.kiro/skills`,Kode:`.kode/skills`,MCPJam:`.mcpjam/skills`,MistralVibe:`.vibe/skills`,Mux:`.mux/skills`,OpenHands:`.openhands/skills`,Pi:`.pi/skills`,Qoder:`.qoder/skills`,Qwen:`.qwen/skills`,RooCode:`.roo/skills`,TraeCN:`.trae/skills`,Zencoder:`.zencoder/skills`,Neovate:`.neovate/skills`,Pochi:`.pochi/skills`,Other:`skills`},l=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),u=e=>{let n=`./skills/${s[e]??l(e)}.md`;try{return t.readAsset(n)}catch{return console.warn(`Warning: Could not read asset for skill: ${e} at ${n}`),``}},d=()=>{try{return t.readAsset(`./LICENCE.md`)}catch{return console.warn(`Warning: Could not read LICENCE.md asset`),``}},f=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.statusText}`);return t.text()},p=async(e,t,a)=>{let o=c[t]??`skills`,p=n.default.join(e,o),m=t!==`VSCode`;await i.promises.mkdir(p,{recursive:!0});let h=[],g=d();for(let e of a){let t=`intlayer-${s[e]??l(e)}`,a=u(e);if(!a)continue;let o=Array.from(new Set(a.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g)||[]));if(m){let s=n.default.join(p,t),c=n.default.join(s,`references`);await i.promises.mkdir(c,{recursive:!0}),g&&await i.promises.writeFile(n.default.join(s,`LICENCE.md`),g,`utf-8`);let l=a,u=o.map(async t=>{try{let e=await f(t),n=(0,r.getMarkdownMetadata)(e),i=``;return i=Array.isArray(n.slugs)?n.slugs.filter(e=>e!==`doc`).join(`_`):new URL(t).pathname.split(`/`).filter(e=>e&&e!==`doc`).map(e=>e.replace(`.md`,``)).join(`_`),i=i?`${i}.md`:`index.md`,{url:t,localRefPath:`references/${i}`,fileName:i,content:e,success:!0}}catch(n){return console.warn(`Warning: Failed to download ref ${t} for skill ${e}`,n),{url:t,success:!1}}}),d=await Promise.all(u);for(let e of d)e.success&&e.fileName&&e.content&&e.localRefPath&&(await i.promises.writeFile(n.default.join(c,e.fileName),e.content,`utf-8`),l=l.replaceAll(e.url,e.localRefPath));let m=n.default.join(s,`SKILL.md`);await i.promises.writeFile(m,l,`utf-8`),h.push(`${t}/SKILL.md`)}else{let e=`${t}.md`,r=n.default.join(p,e);await i.promises.writeFile(r,a,`utf-8`),h.push(e)}}return h.length===0?`No skill files were created. Check your asset paths.`:`Created ${h.length} skills in ${p}`};exports.SKILLS=o,exports.SKILLS_METADATA=a,exports.installSkills=p;
|
|
173
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["readAsset","path","fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { getMarkdownMetadata } from '@intlayer/core';\n\nexport const SKILLS_METADATA = {\n Usage: 'How to use Intlayer in your project',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n React: 'React-specific syntax and hooks usage',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n Vue: 'Vue-specific composables and syntax',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid:\n 'Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.',\n Svelte: 'Svelte-specific stores and syntax',\n Astro: 'Astro-specific usage and getIntlayer',\n CLI: 'Intlayer CLI commands and usage',\n} as const;\n\nexport const SKILLS = Object.keys(\n SKILLS_METADATA\n) as (keyof typeof SKILLS_METADATA)[];\n\nexport type Skill = (typeof SKILLS)[number];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Configuration for Platform paths to keep code clean.\n */\nconst PLATFORM_DIRS = {\n Cursor: '.cursor/skills',\n Windsurf: '.windsurf/skills',\n Trae: '.trae/skills',\n OpenCode: '.opencode/skills',\n GitHub: '.github/skills',\n Claude: '.claude/skills',\n VSCode: '.vscode/skills', // Fixed: VSCode usually uses .vscode, not .github\n Antigravity: '.agent/skills',\n Augment: '.augment/skills',\n OpenClaw: 'skills',\n Cline: '.cline/skills',\n CodeBuddy: '.codebuddy/skills',\n CommandCode: '.commandcode/skills',\n Continue: '.continue/skills',\n Crush: '.crush/skills',\n Droid: '.factory/skills',\n Goose: '.goose/skills',\n Junie: '.junie/skills',\n IFlow: '.iflow/skills',\n KiloCode: '.kilocode/skills',\n Kiro: '.kiro/skills',\n Kode: '.kode/skills',\n MCPJam: '.mcpjam/skills',\n MistralVibe: '.vibe/skills',\n Mux: '.mux/skills',\n OpenHands: '.openhands/skills',\n Pi: '.pi/skills',\n Qoder: '.qoder/skills',\n Qwen: '.qwen/skills',\n RooCode: '.roo/skills',\n TraeCN: '.trae/skills',\n Zencoder: '.zencoder/skills',\n Neovate: '.neovate/skills',\n Pochi: '.pochi/skills',\n Other: 'skills',\n};\n\nexport type Platform = keyof typeof PLATFORM_DIRS;\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n return response.text();\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // 1. Determine destination directory\n const relativeDir = PLATFORM_DIRS[platform] ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n const useAgentStructure = platform !== 'VSCode';\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(\n skillContent.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g) || []\n )\n );\n\n if (useAgentStructure) {\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs\n .filter((slug) => slug !== 'doc')\n .join('_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n } else {\n // Flat Structure (Generic/VSCode): .../skills/<skill-name>.md\n const fileName = `${skillName}.md`;\n const filePath = path.join(skillsBaseDir, fileName);\n\n await fs.writeFile(filePath, skillContent, 'utf-8');\n createdSkills.push(fileName);\n }\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["readAsset","path","fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\n\nexport const SKILLS_METADATA = {\n Usage: 'How to use Intlayer in your project',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n React: 'React-specific syntax and hooks usage',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n Vue: 'Vue-specific composables and syntax',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid:\n 'Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.',\n Svelte: 'Svelte-specific stores and syntax',\n Astro: 'Astro-specific usage and getIntlayer',\n CLI: 'Intlayer CLI commands and usage',\n} as const;\n\nexport const SKILLS = Object.keys(\n SKILLS_METADATA\n) as (keyof typeof SKILLS_METADATA)[];\n\nexport type Skill = (typeof SKILLS)[number];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Configuration for Platform paths to keep code clean.\n */\nconst PLATFORM_DIRS = {\n Cursor: '.cursor/skills',\n Windsurf: '.windsurf/skills',\n Trae: '.trae/skills',\n OpenCode: '.opencode/skills',\n GitHub: '.github/skills',\n Claude: '.claude/skills',\n VSCode: '.vscode/skills', // Fixed: VSCode usually uses .vscode, not .github\n Antigravity: '.agent/skills',\n Augment: '.augment/skills',\n OpenClaw: 'skills',\n Cline: '.cline/skills',\n CodeBuddy: '.codebuddy/skills',\n CommandCode: '.commandcode/skills',\n Continue: '.continue/skills',\n Crush: '.crush/skills',\n Droid: '.factory/skills',\n Goose: '.goose/skills',\n Junie: '.junie/skills',\n IFlow: '.iflow/skills',\n KiloCode: '.kilocode/skills',\n Kiro: '.kiro/skills',\n Kode: '.kode/skills',\n MCPJam: '.mcpjam/skills',\n MistralVibe: '.vibe/skills',\n Mux: '.mux/skills',\n OpenHands: '.openhands/skills',\n Pi: '.pi/skills',\n Qoder: '.qoder/skills',\n Qwen: '.qwen/skills',\n RooCode: '.roo/skills',\n TraeCN: '.trae/skills',\n Zencoder: '.zencoder/skills',\n Neovate: '.neovate/skills',\n Pochi: '.pochi/skills',\n Other: 'skills',\n};\n\nexport type Platform = keyof typeof PLATFORM_DIRS;\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n return response.text();\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // 1. Determine destination directory\n const relativeDir = PLATFORM_DIRS[platform] ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n const useAgentStructure = platform !== 'VSCode';\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(\n skillContent.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g) || []\n )\n );\n\n if (useAgentStructure) {\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs\n .filter((slug) => slug !== 'doc')\n .join('_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n } else {\n // Flat Structure (Generic/VSCode): .../skills/<skill-name>.md\n const fileName = `${skillName}.md`;\n const filePath = path.join(skillsBaseDir, fileName);\n\n await fs.writeFile(filePath, skillContent, 'utf-8');\n createdSkills.push(fileName);\n }\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":"0QAKA,MAAa,EAAkB,CAC7B,MAAO,sCACP,cAAe,0DACf,OAAQ,uCACR,QAAS,+DACT,MAAO,wCACP,QAAS,wDACT,OAAQ,sDACR,IAAK,sCACL,OAAQ,yCACR,MACE,qMACF,OAAQ,oCACR,MAAO,uCACP,IAAK,kCACN,CAEY,EAAS,OAAO,KAC3B,EACD,CAOK,EAAqD,EAAE,CAKvD,EAAgB,CACpB,OAAQ,iBACR,SAAU,mBACV,KAAM,eACN,SAAU,mBACV,OAAQ,iBACR,OAAQ,iBACR,OAAQ,iBACR,YAAa,gBACb,QAAS,kBACT,SAAU,SACV,MAAO,gBACP,UAAW,oBACX,YAAa,sBACb,SAAU,mBACV,MAAO,gBACP,MAAO,kBACP,MAAO,gBACP,MAAO,gBACP,MAAO,gBACP,SAAU,mBACV,KAAM,eACN,KAAM,eACN,OAAQ,iBACR,YAAa,eACb,IAAK,cACL,UAAW,oBACX,GAAI,aACJ,MAAO,gBACP,KAAM,eACN,QAAS,cACT,OAAQ,eACR,SAAU,mBACV,QAAS,kBACT,MAAO,gBACP,MAAO,SACR,CAOK,EAAoB,GACxB,EAAI,QAAQ,qBAAsB,QAAQ,CAAC,aAAa,CAKpD,EAAmB,GAAyB,CAEhD,IAAM,EAAW,YADA,EAAmB,IAAU,EAAiB,EAAM,CAC/B,KAEtC,GAAI,CACF,OAAOA,EAAAA,UAAU,EAAS,MACpB,CAIN,OAHA,QAAQ,KACN,4CAA4C,EAAM,MAAM,IACzD,CACM,KAOL,MAAkC,CACtC,GAAI,CACF,OAAOA,EAAAA,UAAU,eAAe,MAC1B,CAEN,OADA,QAAQ,KAAK,2CAA2C,CACjD,KAOL,EAAkB,KAAO,IAAiC,CAC9D,IAAM,EAAW,MAAM,MAAM,EAAI,CACjC,GAAI,CAAC,EAAS,GACZ,MAAU,MAAM,mBAAmB,EAAI,IAAI,EAAS,aAAa,CAEnE,OAAO,EAAS,MAAM,EAOX,EAAgB,MAC3B,EACA,EACA,IACoB,CAEpB,IAAM,EAAc,EAAc,IAAa,SACzC,EAAgBC,EAAAA,QAAK,KAAK,EAAa,EAAY,CAEnD,EAAoB,IAAa,SAGvC,MAAMC,EAAAA,SAAG,MAAM,EAAe,CAAE,UAAW,GAAM,CAAC,CAElD,IAAM,EAA0B,EAAE,CAC5B,EAAiB,GAAmB,CAE1C,IAAK,IAAM,KAAS,EAAQ,CAE1B,IAAM,EAAY,YADD,EAAmB,IAAU,EAAiB,EAAM,GAE/D,EAAe,EAAgB,EAAM,CAE3C,GAAI,CAAC,EAAc,SAGnB,IAAM,EAAO,MAAM,KACjB,IAAI,IACF,EAAa,MAAM,6CAA6C,EAAI,EAAE,CACvE,CACF,CAED,GAAI,EAAmB,CAErB,IAAM,EAAWD,EAAAA,QAAK,KAAK,EAAe,EAAU,CAC9C,EAAeA,EAAAA,QAAK,KAAK,EAAU,aAAa,CAGtD,MAAMC,EAAAA,SAAG,MAAM,EAAc,CAAE,UAAW,GAAM,CAAC,CAG7C,GACF,MAAMA,EAAAA,SAAG,UACPD,EAAAA,QAAK,KAAK,EAAU,aAAa,CACjC,EACA,QACD,CAGH,IAAI,EAAsB,EAGpB,EAAmB,EAAK,IAAI,KAAO,IAAQ,CAC/C,GAAI,CACF,IAAM,EAAU,MAAM,EAAgB,EAAI,CACpC,GAAA,EAAA,EAAA,qBAAqD,EAAQ,CAE/D,EAAW,GAoBf,MAjBA,CAME,EANE,MAAM,QAAQ,EAAS,MAAM,CACpB,EAAS,MACjB,OAAQ,GAAS,IAAS,MAAM,CAChC,KAAK,IAAI,CAEI,IAAI,IAAI,EAAI,CAAC,SAE1B,MAAM,IAAI,CACV,OAAQ,GAAS,GAAQ,IAAS,MAAM,CACxC,IAAK,GAAS,EAAK,QAAQ,MAAO,GAAG,CAAC,CACtC,KAAK,IAAI,CAId,EAAW,EAAW,GAAG,EAAS,KAAO,WAGlC,CACL,MACA,aAJmB,cAAc,IAKjC,WACA,UACA,QAAS,GACV,OACM,EAAO,CAKd,OAJA,QAAQ,KACN,mCAAmC,EAAI,aAAa,IACpD,EACD,CACM,CAAE,MAAK,QAAS,GAAO,GAEhC,CAEI,EAAU,MAAM,QAAQ,IAAI,EAAiB,CAGnD,IAAK,IAAM,KAAO,EACZ,EAAI,SAAW,EAAI,UAAY,EAAI,SAAW,EAAI,eAEpD,MAAMC,EAAAA,SAAG,UACPD,EAAAA,QAAK,KAAK,EAAc,EAAI,SAAS,CACrC,EAAI,QACJ,QACD,CAGD,EAAsB,EAAoB,WACxC,EAAI,IACJ,EAAI,aACL,EAKL,IAAM,EAAWA,EAAAA,QAAK,KAAK,EAAU,WAAW,CAChD,MAAMC,EAAAA,SAAG,UAAU,EAAU,EAAqB,QAAQ,CAC1D,EAAc,KAAK,GAAG,EAAU,WAAW,KACtC,CAEL,IAAM,EAAW,GAAG,EAAU,KACxB,EAAWD,EAAAA,QAAK,KAAK,EAAe,EAAS,CAEnD,MAAMC,EAAAA,SAAG,UAAU,EAAU,EAAc,QAAQ,CACnD,EAAc,KAAK,EAAS,EAQhC,OAJI,EAAc,SAAW,EACpB,uDAGF,WAAW,EAAc,OAAO,aAAa"}
|
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let node_fs_promises = require("node:fs/promises");
|
|
4
|
-
let fast_glob = require("fast-glob");
|
|
5
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
6
|
-
|
|
7
|
-
//#region src/listDictionariesPath.ts
|
|
8
|
-
/**
|
|
9
|
-
* List all dictionaries absolute paths in the project
|
|
10
|
-
* @param configuration - The configuration object
|
|
11
|
-
* @returns An array of dictionary paths
|
|
12
|
-
*/
|
|
13
|
-
const listDictionaries = async (configuration) => {
|
|
14
|
-
const { watchedFilesPatternWithPath, excludedPath } = configuration.content;
|
|
15
|
-
const filePromises = watchedFilesPatternWithPath.map(async (pattern) => {
|
|
16
|
-
const magicIndex = pattern.search(/[*?{}(]/);
|
|
17
|
-
const basePattern = magicIndex > -1 ? pattern.slice(0, magicIndex) : pattern;
|
|
18
|
-
return (0, fast_glob.default)(pattern, {
|
|
19
|
-
ignore: excludedPath.filter((excludePattern) => {
|
|
20
|
-
const cleanName = excludePattern.replace(/\*\*/g, "").replace(/\//g, "");
|
|
21
|
-
if (cleanName && basePattern.includes(`/${cleanName}/`)) return false;
|
|
22
|
-
return true;
|
|
23
|
-
}),
|
|
24
|
-
absolute: true,
|
|
25
|
-
dot: true
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
const filesArrays = await Promise.all(filePromises);
|
|
29
|
-
return Array.from(new Set(filesArrays.flat()));
|
|
30
|
-
};
|
|
31
|
-
const listDictionariesWithStats = async (configuration) => {
|
|
32
|
-
const files = await listDictionaries(configuration);
|
|
33
|
-
return Promise.all(files.map(async (file) => ({
|
|
34
|
-
path: file,
|
|
35
|
-
stats: await (0, node_fs_promises.stat)(file)
|
|
36
|
-
})));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.listDictionaries = listDictionaries;
|
|
41
|
-
exports.listDictionariesWithStats = listDictionariesWithStats;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`node:fs/promises`),n=require(`fast-glob`);n=e.__toESM(n);const r=async e=>{let{watchedFilesPatternWithPath:t,excludedPath:r}=e.content,i=t.map(async e=>{let t=e.search(/[*?{}(]/),i=t>-1?e.slice(0,t):e;return(0,n.default)(e,{ignore:r.filter(e=>{let t=e.replace(/\*\*/g,``).replace(/\//g,``);return!(t&&i.includes(`/${t}/`))}),absolute:!0,dot:!0})}),a=await Promise.all(i);return Array.from(new Set(a.flat()))},i=async e=>{let n=await r(e);return Promise.all(n.map(async e=>({path:e,stats:await(0,t.stat)(e)})))};exports.listDictionaries=r,exports.listDictionariesWithStats=i;
|
|
42
2
|
//# sourceMappingURL=listDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listDictionariesPath.cjs","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * List all dictionaries absolute paths in the project\n * @param configuration - The configuration object\n * @returns An array of dictionary paths\n */\nexport const listDictionaries = async (\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { watchedFilesPatternWithPath, excludedPath } = configuration.content;\n\n const filePromises = watchedFilesPatternWithPath.map(async (pattern) => {\n // Identify the static part of the path (before any wildcards like *)\n // e.g. \"/Users/.../design-system/dist/esm/**/*.content.ts\" -> \"/Users/.../design-system/dist/esm/\"\n const magicIndex = pattern.search(/[*?{}(]/);\n const basePattern =\n magicIndex > -1 ? pattern.slice(0, magicIndex) : pattern;\n\n // Filter the global ignored list for this specific pattern\n const applicableIgnore = excludedPath.filter((excludePattern) => {\n // Heuristic: Extract the key directory name from the glob\n // e.g. \"**/dist/**\" -> \"dist\", \"**/node_modules/**\" -> \"node_modules\"\n const cleanName = excludePattern.replace(/\\*\\*/g, '').replace(/\\//g, '');\n\n // If the explicit base path contains the excluded directory (e.g. \".../dist/...\"),\n // we assume you explicitly want it, so we REMOVE it from the ignore list.\n // We check for `/${cleanName}/` to ensure we match whole folder names.\n if (cleanName && basePattern.includes(`/${cleanName}/`)) {\n return false; // Drop this exclude rule\n }\n\n return true; // Keep this exclude rule\n });\n\n // Run fast-glob with the customized ignore list\n return fg(pattern, {\n ignore: applicableIgnore,\n absolute: true,\n dot: true,\n });\n });\n\n const filesArrays = await Promise.all(filePromises);\n\n // Flatten and deduplicate\n const uniqueFiles = Array.from(new Set(filesArrays.flat()));\n\n return uniqueFiles;\n};\n\nexport const listDictionariesWithStats = async (\n configuration: IntlayerConfig\n) => {\n const files = await listDictionaries(configuration);\n\n return Promise.all(\n files.map(async (file) => ({ path: file, stats: await stat(file) }))\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"listDictionariesPath.cjs","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * List all dictionaries absolute paths in the project\n * @param configuration - The configuration object\n * @returns An array of dictionary paths\n */\nexport const listDictionaries = async (\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { watchedFilesPatternWithPath, excludedPath } = configuration.content;\n\n const filePromises = watchedFilesPatternWithPath.map(async (pattern) => {\n // Identify the static part of the path (before any wildcards like *)\n // e.g. \"/Users/.../design-system/dist/esm/**/*.content.ts\" -> \"/Users/.../design-system/dist/esm/\"\n const magicIndex = pattern.search(/[*?{}(]/);\n const basePattern =\n magicIndex > -1 ? pattern.slice(0, magicIndex) : pattern;\n\n // Filter the global ignored list for this specific pattern\n const applicableIgnore = excludedPath.filter((excludePattern) => {\n // Heuristic: Extract the key directory name from the glob\n // e.g. \"**/dist/**\" -> \"dist\", \"**/node_modules/**\" -> \"node_modules\"\n const cleanName = excludePattern.replace(/\\*\\*/g, '').replace(/\\//g, '');\n\n // If the explicit base path contains the excluded directory (e.g. \".../dist/...\"),\n // we assume you explicitly want it, so we REMOVE it from the ignore list.\n // We check for `/${cleanName}/` to ensure we match whole folder names.\n if (cleanName && basePattern.includes(`/${cleanName}/`)) {\n return false; // Drop this exclude rule\n }\n\n return true; // Keep this exclude rule\n });\n\n // Run fast-glob with the customized ignore list\n return fg(pattern, {\n ignore: applicableIgnore,\n absolute: true,\n dot: true,\n });\n });\n\n const filesArrays = await Promise.all(filePromises);\n\n // Flatten and deduplicate\n const uniqueFiles = Array.from(new Set(filesArrays.flat()));\n\n return uniqueFiles;\n};\n\nexport const listDictionariesWithStats = async (\n configuration: IntlayerConfig\n) => {\n const files = await listDictionaries(configuration);\n\n return Promise.all(\n files.map(async (file) => ({ path: file, stats: await stat(file) }))\n );\n};\n"],"mappings":"+LASA,MAAa,EAAmB,KAC9B,IACsB,CACtB,GAAM,CAAE,8BAA6B,gBAAiB,EAAc,QAE9D,EAAe,EAA4B,IAAI,KAAO,IAAY,CAGtE,IAAM,EAAa,EAAQ,OAAO,UAAU,CACtC,EACJ,EAAa,GAAK,EAAQ,MAAM,EAAG,EAAW,CAAG,EAmBnD,OAAA,EAAA,EAAA,SAAU,EAAS,CACjB,OAjBuB,EAAa,OAAQ,GAAmB,CAG/D,IAAM,EAAY,EAAe,QAAQ,QAAS,GAAG,CAAC,QAAQ,MAAO,GAAG,CASxE,MAJA,EAAI,GAAa,EAAY,SAAS,IAAI,EAAU,GAAG,GAKvD,CAKA,SAAU,GACV,IAAK,GACN,CAAC,EACF,CAEI,EAAc,MAAM,QAAQ,IAAI,EAAa,CAKnD,OAFoB,MAAM,KAAK,IAAI,IAAI,EAAY,MAAM,CAAC,CAAC,EAKhD,EAA4B,KACvC,IACG,CACH,IAAM,EAAQ,MAAM,EAAiB,EAAc,CAEnD,OAAO,QAAQ,IACb,EAAM,IAAI,KAAO,KAAU,CAAE,KAAM,EAAM,MAAO,MAAA,EAAA,EAAA,MAAW,EAAK,CAAE,EAAE,CACrE"}
|
|
@@ -1,96 +1,6 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
7
|
-
let node_fs = require("node:fs");
|
|
8
|
-
let simple_git = require("simple-git");
|
|
9
|
-
simple_git = require_runtime.__toESM(simple_git);
|
|
10
|
-
|
|
11
|
-
//#region src/listGitFiles.ts
|
|
12
|
-
const getGitRootDir = async () => {
|
|
13
|
-
try {
|
|
14
|
-
return (await (0, simple_git.default)().revparse(["--show-toplevel"])).trim();
|
|
15
|
-
} catch (error) {
|
|
16
|
-
(0, _intlayer_config.getAppLogger)(_intlayer_config_built.default)(`Error getting git root directory: ${error}`, { level: "error" });
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const listGitFiles = async ({ mode, baseRef = "origin/main", currentRef = "HEAD", absolute = true }) => {
|
|
21
|
-
try {
|
|
22
|
-
const git = (0, simple_git.default)();
|
|
23
|
-
const diff = /* @__PURE__ */ new Set();
|
|
24
|
-
if (mode.includes("untracked")) (await git.status()).not_added.forEach((f) => diff.add(f));
|
|
25
|
-
if (mode.includes("uncommitted")) (await git.diff(["--name-only", "HEAD"])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
26
|
-
if (mode.includes("unpushed")) (await git.diff(["--name-only", "@{push}...HEAD"])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
27
|
-
if (mode.includes("gitDiff")) {
|
|
28
|
-
await git.fetch(baseRef);
|
|
29
|
-
(await git.diff(["--name-only", `${baseRef}...${currentRef}`])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
30
|
-
}
|
|
31
|
-
if (absolute) {
|
|
32
|
-
const gitRootDir = await getGitRootDir();
|
|
33
|
-
if (!gitRootDir) return [];
|
|
34
|
-
return Array.from(diff).map((file) => (0, node_path.join)(gitRootDir, file));
|
|
35
|
-
}
|
|
36
|
-
return Array.from(diff);
|
|
37
|
-
} catch (error) {
|
|
38
|
-
console.warn("Failed to get changes list:", error);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const listGitLines = async (filePath, { mode, baseRef = "origin/main", currentRef = "HEAD" }) => {
|
|
42
|
-
const git = (0, simple_git.default)();
|
|
43
|
-
const changedLines = /* @__PURE__ */ new Set();
|
|
44
|
-
/**
|
|
45
|
-
* Extracts line numbers from a diff generated with `--unified=0`.
|
|
46
|
-
* Each hunk header looks like: @@ -<oldStart>,<oldCount> +<newStart>,<newCount> @@
|
|
47
|
-
* We consider both the "+" (new) side for additions and the "-" (old) side for deletions.
|
|
48
|
-
* For deletions, we add the line before and after the deletion point in the current file.
|
|
49
|
-
*/
|
|
50
|
-
const collectLinesFromDiff = (diffOutput) => {
|
|
51
|
-
const hunkRegex = /@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/g;
|
|
52
|
-
let match;
|
|
53
|
-
while ((match = hunkRegex.exec(diffOutput)) !== null) {
|
|
54
|
-
const oldCount = match[2] ? Number(match[2]) : 1;
|
|
55
|
-
const newStart = Number(match[3]);
|
|
56
|
-
const newCount = match[4] ? Number(match[4]) : 1;
|
|
57
|
-
if (newCount > 0) for (let i = 0; i < newCount; i++) changedLines.add(newStart + i);
|
|
58
|
-
if (oldCount > 0 && newCount === 0) {
|
|
59
|
-
if (newStart > 1) changedLines.add(newStart - 1);
|
|
60
|
-
changedLines.add(newStart);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
if (mode.includes("untracked")) {
|
|
65
|
-
if ((await git.status()).not_added.includes(filePath)) try {
|
|
66
|
-
(0, node_fs.readFileSync)(filePath, "utf-8").split("\n").forEach((_, idx) => changedLines.add(idx + 1));
|
|
67
|
-
} catch {}
|
|
68
|
-
}
|
|
69
|
-
if (mode.includes("uncommitted")) collectLinesFromDiff(await git.diff([
|
|
70
|
-
"--unified=0",
|
|
71
|
-
"HEAD",
|
|
72
|
-
"--",
|
|
73
|
-
filePath
|
|
74
|
-
]));
|
|
75
|
-
if (mode.includes("unpushed")) collectLinesFromDiff(await git.diff([
|
|
76
|
-
"--unified=0",
|
|
77
|
-
"@{push}...HEAD",
|
|
78
|
-
"--",
|
|
79
|
-
filePath
|
|
80
|
-
]));
|
|
81
|
-
if (mode.includes("gitDiff")) {
|
|
82
|
-
await git.fetch(baseRef);
|
|
83
|
-
collectLinesFromDiff(await git.diff([
|
|
84
|
-
"--unified=0",
|
|
85
|
-
`${baseRef}...${currentRef}`,
|
|
86
|
-
"--",
|
|
87
|
-
filePath
|
|
88
|
-
]));
|
|
89
|
-
}
|
|
90
|
-
return Array.from(changedLines).sort((a, b) => a - b);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
exports.listGitFiles = listGitFiles;
|
|
95
|
-
exports.listGitLines = listGitLines;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/logger`),r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`node:fs`),a=require(`simple-git`);a=e.__toESM(a);const o=async()=>{try{return(await(0,a.default)().revparse([`--show-toplevel`])).trim()}catch(e){return(0,n.getAppLogger)(r.default)(`Error getting git root directory: ${e}`,{level:`error`}),null}},s=async({mode:e,baseRef:n=`origin/main`,currentRef:r=`HEAD`,absolute:i=!0})=>{try{let s=(0,a.default)(),c=new Set;if(e.includes(`untracked`)&&(await s.status()).not_added.forEach(e=>{c.add(e)}),e.includes(`uncommitted`)&&(await s.diff([`--name-only`,`HEAD`])).split(`
|
|
2
|
+
`).filter(Boolean).forEach(e=>{c.add(e)}),e.includes(`unpushed`)&&(await s.diff([`--name-only`,`@{push}...HEAD`])).split(`
|
|
3
|
+
`).filter(Boolean).forEach(e=>{c.add(e)}),e.includes(`gitDiff`)&&(await s.fetch(n),(await s.diff([`--name-only`,`${n}...${r}`])).split(`
|
|
4
|
+
`).filter(Boolean).forEach(e=>{c.add(e)})),i){let e=await o();return e?Array.from(c).map(n=>(0,t.join)(e,n)):[]}return Array.from(c)}catch(e){console.warn(`Failed to get changes list:`,e)}},c=async(e,{mode:t,baseRef:n=`origin/main`,currentRef:r=`HEAD`})=>{let o=(0,a.default)(),s=new Set,c=e=>{let t=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/g,n;for(;(n=t.exec(e))!==null;){let e=n[2]?Number(n[2]):1,t=Number(n[3]),r=n[4]?Number(n[4]):1;if(r>0)for(let e=0;e<r;e++)s.add(t+e);e>0&&r===0&&(t>1&&s.add(t-1),s.add(t))}};if(t.includes(`untracked`)&&(await o.status()).not_added.includes(e))try{(0,i.readFileSync)(e,`utf-8`).split(`
|
|
5
|
+
`).forEach((e,t)=>{s.add(t+1)})}catch{}return t.includes(`uncommitted`)&&c(await o.diff([`--unified=0`,`HEAD`,`--`,e])),t.includes(`unpushed`)&&c(await o.diff([`--unified=0`,`@{push}...HEAD`,`--`,e])),t.includes(`gitDiff`)&&(await o.fetch(n),c(await o.diff([`--unified=0`,`${n}...${r}`,`--`,e]))),Array.from(s).sort((e,t)=>e-t)};exports.listGitFiles=s,exports.listGitLines=c;
|
|
96
6
|
//# sourceMappingURL=listGitFiles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listGitFiles.cjs","names":["configuration"],"sources":["../../src/listGitFiles.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport
|
|
1
|
+
{"version":3,"file":"listGitFiles.cjs","names":["configuration"],"sources":["../../src/listGitFiles.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport configuration from '@intlayer/config/built';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport simpleGit from 'simple-git';\n\nexport type DiffMode = 'gitDiff' | 'uncommitted' | 'unpushed' | 'untracked';\n\nconst getGitRootDir = async (): Promise<string | null> => {\n try {\n const git = simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (error) {\n const appLogger = getAppLogger(configuration);\n appLogger(`Error getting git root directory: ${error}`, {\n level: 'error',\n });\n return null;\n }\n};\n\nexport type ListGitFilesOptions = {\n mode: DiffMode[];\n baseRef?: string;\n currentRef?: string;\n absolute?: boolean;\n};\n\nexport const listGitFiles = async ({\n mode,\n baseRef = 'origin/main',\n currentRef = 'HEAD', // HEAD points to the current branch's latest commit\n absolute = true,\n}: ListGitFilesOptions) => {\n try {\n const git = simpleGit();\n const diff: Set<string> = new Set();\n\n if (mode.includes('untracked')) {\n const status = await git.status();\n status.not_added.forEach((file) => {\n diff.add(file);\n });\n }\n\n if (mode.includes('uncommitted')) {\n // Get uncommitted changes\n const uncommittedDiff = await git.diff(['--name-only', 'HEAD']);\n\n const uncommittedFiles = uncommittedDiff.split('\\n').filter(Boolean);\n\n uncommittedFiles.forEach((file) => {\n diff.add(file);\n });\n }\n\n if (mode.includes('unpushed')) {\n // Get unpushed commits\n const unpushedDiff = await git.diff(['--name-only', '@{push}...HEAD']);\n\n const unpushedFiles = unpushedDiff.split('\\n').filter(Boolean);\n\n unpushedFiles.forEach((file) => {\n diff.add(file);\n });\n }\n\n if (mode.includes('gitDiff')) {\n // Get the base branch (usually main/master) from CI environment\n\n await git.fetch(baseRef);\n\n const diffBranch = await git.diff([\n '--name-only',\n `${baseRef}...${currentRef}`,\n ]);\n\n const gitDiffFiles = diffBranch.split('\\n').filter(Boolean);\n\n gitDiffFiles.forEach((file) => {\n diff.add(file);\n });\n }\n\n if (absolute) {\n const gitRootDir = await getGitRootDir();\n if (!gitRootDir) {\n return [];\n }\n return Array.from(diff).map((file) => join(gitRootDir, file));\n }\n\n return Array.from(diff);\n } catch (error) {\n console.warn('Failed to get changes list:', error);\n }\n};\n\nexport type ListGitLinesOptions = {\n mode: DiffMode[];\n baseRef?: string;\n currentRef?: string;\n};\n\nexport const listGitLines = async (\n filePath: string,\n {\n mode,\n baseRef = 'origin/main',\n currentRef = 'HEAD', // HEAD points to the current branch's latest commit\n }: ListGitLinesOptions\n): Promise<number[]> => {\n const git = simpleGit();\n // We collect **line numbers** (1-based) that were modified/added by the diff.\n // Using a Set ensures uniqueness when the same line is reported by several modes.\n const changedLines: Set<number> = new Set();\n\n /**\n * Extracts line numbers from a diff generated with `--unified=0`.\n * Each hunk header looks like: @@ -<oldStart>,<oldCount> +<newStart>,<newCount> @@\n * We consider both the \"+\" (new) side for additions and the \"-\" (old) side for deletions.\n * For deletions, we add the line before and after the deletion point in the current file.\n */\n const collectLinesFromDiff = (diffOutput: string) => {\n const hunkRegex = /@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/g;\n let match: RegExpExecArray | null;\n\n // biome-ignore lint/suspicious/noAssignInExpressions: Used in while loop condition\n while ((match = hunkRegex.exec(diffOutput)) !== null) {\n const oldCount = match[2] ? Number(match[2]) : 1;\n const newStart = Number(match[3]);\n const newCount = match[4] ? Number(match[4]) : 1;\n\n // Handle additions/modifications (+ side)\n if (newCount > 0) {\n for (let i = 0; i < newCount; i++) {\n changedLines.add(newStart + i);\n }\n }\n\n // Handle deletions (- side)\n if (oldCount > 0 && newCount === 0) {\n // For deletions, add the line before and after the deletion point\n // The deletion point in the new file is at newStart\n if (newStart > 1) {\n changedLines.add(newStart - 1); // Line before deletion\n }\n changedLines.add(newStart); // Line after deletion (if it exists)\n }\n }\n };\n\n // 1. Handle untracked files – when a file is untracked its entire content is new.\n if (mode.includes('untracked')) {\n const status = await git.status();\n const isUntracked = status.not_added.includes(filePath);\n if (isUntracked) {\n try {\n const content = readFileSync(filePath, 'utf-8');\n content.split('\\n').forEach((_, idx) => {\n changedLines.add(idx + 1);\n });\n } catch {\n // ignore read errors – file may have been deleted, etc.\n }\n }\n }\n\n // 2. Uncommitted changes (working tree vs HEAD)\n if (mode.includes('uncommitted')) {\n const diffOutput = await git.diff(['--unified=0', 'HEAD', '--', filePath]);\n collectLinesFromDiff(diffOutput);\n }\n\n // 3. Unpushed commits – compare local branch to its upstream\n if (mode.includes('unpushed')) {\n const diffOutput = await git.diff([\n '--unified=0',\n '@{push}...HEAD',\n '--',\n filePath,\n ]);\n collectLinesFromDiff(diffOutput);\n }\n\n // 4. Regular git diff between baseRef and currentRef (e.g., CI pull-request diff)\n if (mode.includes('gitDiff')) {\n await git.fetch(baseRef);\n const diffOutput = await git.diff([\n '--unified=0',\n `${baseRef}...${currentRef}`,\n '--',\n filePath,\n ]);\n collectLinesFromDiff(diffOutput);\n }\n\n // Return the list sorted for convenience\n return Array.from(changedLines).sort((a, b) => a - b);\n};\n"],"mappings":"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"}
|
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let fast_glob = require("fast-glob");
|
|
6
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
7
|
-
let simple_git = require("simple-git");
|
|
8
|
-
simple_git = require_runtime.__toESM(simple_git);
|
|
9
|
-
|
|
10
|
-
//#region src/listProjects.ts
|
|
11
|
-
/**
|
|
12
|
-
* Get the git root directory
|
|
13
|
-
*/
|
|
14
|
-
const getGitRootDir = async (cwd) => {
|
|
15
|
-
try {
|
|
16
|
-
return (await (cwd ? (0, simple_git.default)(cwd) : (0, simple_git.default)()).revparse(["--show-toplevel"])).trim();
|
|
17
|
-
} catch (_error) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* List all Intlayer projects by searching for configuration files
|
|
23
|
-
*
|
|
24
|
-
* @param options - Options for listing projects
|
|
25
|
-
* @returns Array of absolute paths to project directories containing Intlayer config
|
|
26
|
-
*/
|
|
27
|
-
const listProjects = async (options) => {
|
|
28
|
-
let searchDir = options?.baseDir ?? process.cwd();
|
|
29
|
-
if (options?.gitRoot) {
|
|
30
|
-
const gitRootDir = await getGitRootDir(searchDir);
|
|
31
|
-
if (gitRootDir) searchDir = gitRootDir;
|
|
32
|
-
}
|
|
33
|
-
const configFiles = await (0, fast_glob.default)(_intlayer_config.configurationFilesCandidates.map((fileName) => `**/${fileName}`), {
|
|
34
|
-
cwd: searchDir,
|
|
35
|
-
absolute: true,
|
|
36
|
-
ignore: ["**/node_modules/**", "**/.git/**"],
|
|
37
|
-
dot: true
|
|
38
|
-
});
|
|
39
|
-
const projectDirs = [...new Set(configFiles.map((file) => (0, node_path.dirname)(file)))];
|
|
40
|
-
return {
|
|
41
|
-
searchDir,
|
|
42
|
-
projectsPath: projectDirs.sort()
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
exports.listProjects = listProjects;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@intlayer/config/node`),n=require(`node:path`),r=require(`fast-glob`);r=e.__toESM(r);let i=require(`simple-git`);i=e.__toESM(i);const a=async e=>{try{return(await(e?(0,i.default)(e):(0,i.default)()).revparse([`--show-toplevel`])).trim()}catch{return null}},o=async e=>{let i=e?.baseDir??process.cwd();if(e?.gitRoot){let e=await a(i);e&&(i=e)}let o=await(0,r.default)(t.configurationFilesCandidates.map(e=>`**/${e}`),{cwd:i,absolute:!0,ignore:[`**/node_modules/**`,`**/.git/**`],dot:!0}),s=[...new Set(o.map(e=>(0,n.dirname)(e)))];return{searchDir:i,projectsPath:s.sort()}};exports.listProjects=o;
|
|
48
2
|
//# sourceMappingURL=listProjects.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listProjects.cjs","names":["configurationFilesCandidates"],"sources":["../../src/listProjects.ts"],"sourcesContent":["import { dirname } from 'node:path';\nimport { configurationFilesCandidates } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport simpleGit from 'simple-git';\n\nexport type ListProjectsOptions = {\n /**\n * Base directory to search from\n * @default process.cwd()\n */\n baseDir?: string;\n /**\n * If true, search from the git root directory instead of baseDir\n * @default false\n */\n gitRoot?: boolean;\n};\n\n/**\n * Get the git root directory\n */\nconst getGitRootDir = async (cwd?: string): Promise<string | null> => {\n try {\n const git = cwd ? simpleGit(cwd) : simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (_error) {\n return null;\n }\n};\n\n/**\n * List all Intlayer projects by searching for configuration files\n *\n * @param options - Options for listing projects\n * @returns Array of absolute paths to project directories containing Intlayer config\n */\nexport const listProjects = async (\n options?: ListProjectsOptions\n): Promise<{ searchDir: string; projectsPath: string[] }> => {\n let searchDir = options?.baseDir ?? process.cwd();\n\n // If gitRoot option is enabled, try to get the git root directory\n if (options?.gitRoot) {\n const gitRootDir = await getGitRootDir(searchDir);\n if (gitRootDir) {\n searchDir = gitRootDir;\n }\n }\n\n // Build glob patterns for all config file candidates\n const configPatterns = configurationFilesCandidates.map(\n (fileName) => `**/${fileName}`\n );\n\n // Search for all config files\n const configFiles = await fg(configPatterns, {\n cwd: searchDir,\n absolute: true,\n ignore: ['**/node_modules/**', '**/.git/**'],\n dot: true, // Include dot files like .intlayerrc\n });\n\n // Extract unique directory paths from config files\n const projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];\n\n // Sort alphabetically for consistent output\n return { searchDir, projectsPath: projectDirs.sort() };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"listProjects.cjs","names":["configurationFilesCandidates"],"sources":["../../src/listProjects.ts"],"sourcesContent":["import { dirname } from 'node:path';\nimport { configurationFilesCandidates } from '@intlayer/config/node';\nimport fg from 'fast-glob';\nimport simpleGit from 'simple-git';\n\nexport type ListProjectsOptions = {\n /**\n * Base directory to search from\n * @default process.cwd()\n */\n baseDir?: string;\n /**\n * If true, search from the git root directory instead of baseDir\n * @default false\n */\n gitRoot?: boolean;\n};\n\n/**\n * Get the git root directory\n */\nconst getGitRootDir = async (cwd?: string): Promise<string | null> => {\n try {\n const git = cwd ? simpleGit(cwd) : simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (_error) {\n return null;\n }\n};\n\n/**\n * List all Intlayer projects by searching for configuration files\n *\n * @param options - Options for listing projects\n * @returns Array of absolute paths to project directories containing Intlayer config\n */\nexport const listProjects = async (\n options?: ListProjectsOptions\n): Promise<{ searchDir: string; projectsPath: string[] }> => {\n let searchDir = options?.baseDir ?? process.cwd();\n\n // If gitRoot option is enabled, try to get the git root directory\n if (options?.gitRoot) {\n const gitRootDir = await getGitRootDir(searchDir);\n if (gitRootDir) {\n searchDir = gitRootDir;\n }\n }\n\n // Build glob patterns for all config file candidates\n const configPatterns = configurationFilesCandidates.map(\n (fileName) => `**/${fileName}`\n );\n\n // Search for all config files\n const configFiles = await fg(configPatterns, {\n cwd: searchDir,\n absolute: true,\n ignore: ['**/node_modules/**', '**/.git/**'],\n dot: true, // Include dot files like .intlayerrc\n });\n\n // Extract unique directory paths from config files\n const projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];\n\n // Sort alphabetically for consistent output\n return { searchDir, projectsPath: projectDirs.sort() };\n};\n"],"mappings":"sQAqBA,MAAM,EAAgB,KAAO,IAAyC,CACpE,GAAI,CAGF,OADgB,MADJ,GAAA,EAAA,EAAA,SAAgB,EAAI,EAAA,EAAA,EAAA,UAAc,EACpB,SAAS,CAAC,kBAAkB,CAAC,EACxC,MAAM,MACN,CACf,OAAO,OAUE,EAAe,KAC1B,IAC2D,CAC3D,IAAI,EAAY,GAAS,SAAW,QAAQ,KAAK,CAGjD,GAAI,GAAS,QAAS,CACpB,IAAM,EAAa,MAAM,EAAc,EAAU,CAC7C,IACF,EAAY,GAUhB,IAAM,EAAc,MAAA,EAAA,EAAA,SALGA,EAAAA,6BAA6B,IACjD,GAAa,MAAM,IACrB,CAG4C,CAC3C,IAAK,EACL,SAAU,GACV,OAAQ,CAAC,qBAAsB,aAAa,CAC5C,IAAK,GACN,CAAC,CAGI,EAAc,CAAC,GAAG,IAAI,IAAI,EAAY,IAAK,IAAA,EAAA,EAAA,SAAiB,EAAK,CAAC,CAAC,CAAC,CAG1E,MAAO,CAAE,YAAW,aAAc,EAAY,MAAM,CAAE"}
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_fs_promises = require("node:fs/promises");
|
|
5
|
-
let node_path = require("node:path");
|
|
6
|
-
let node_module = require("node:module");
|
|
7
|
-
|
|
8
|
-
//#region src/loadDictionaries/getIntlayerBundle.ts
|
|
9
|
-
/**
|
|
10
|
-
* Rewrites selected bare specifiers (and any of their subpaths) to absolute file paths,
|
|
11
|
-
* using the provided localeRequire (either createRequire(import.meta.url) or require).
|
|
12
|
-
*
|
|
13
|
-
* Example:
|
|
14
|
-
* rewritePathsPlugin(["@intlayer/config", "@intlayer/core"], localeRequire)
|
|
15
|
-
* …will also rewrite "@intlayer/core/file" etc.
|
|
16
|
-
*/
|
|
17
|
-
const rewritePathsPlugin = (replaceModules, excludeModules) => {
|
|
18
|
-
return {
|
|
19
|
-
name: "rewrite-paths",
|
|
20
|
-
setup(build) {
|
|
21
|
-
build.onResolve({ filter: /.*/ }, (args) => {
|
|
22
|
-
const exact = replaceModules[args.path];
|
|
23
|
-
if (excludeModules?.includes(args.path)) return null;
|
|
24
|
-
if (exact) return {
|
|
25
|
-
path: exact,
|
|
26
|
-
namespace: "intlayer-replace-modules",
|
|
27
|
-
external: true
|
|
28
|
-
};
|
|
29
|
-
for (const key of Object.keys(replaceModules)) if (args.path === key || args.path.startsWith(`${key}/`)) {
|
|
30
|
-
const sub = args.path.slice(key.length);
|
|
31
|
-
return {
|
|
32
|
-
path: replaceModules[key] + sub,
|
|
33
|
-
namespace: "intlayer-replace-modules",
|
|
34
|
-
external: true
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Get the intlayer bundle to embed @intlayer/core and be able to mock @intlayer/config/built to mock the configuration file.
|
|
43
|
-
*/
|
|
44
|
-
const getIntlayerBundle = async (configuration) => {
|
|
45
|
-
const rootRequire = (0, _intlayer_config.getProjectRequire)(configuration.content.baseDir);
|
|
46
|
-
const configPackageRequire = _intlayer_config.configESMxCJSRequire;
|
|
47
|
-
const localRequire = _intlayer_config.isESModule ? (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href) : require;
|
|
48
|
-
const configurationPath = (0, node_path.join)(configuration.system.configDir, `configuration.json`);
|
|
49
|
-
const replaceModules = {
|
|
50
|
-
defu: configPackageRequire.resolve("defu"),
|
|
51
|
-
esbuild: configPackageRequire.resolve("esbuild"),
|
|
52
|
-
"@intlayer/config/built": configurationPath,
|
|
53
|
-
"@intlayer/config": localRequire.resolve("@intlayer/config"),
|
|
54
|
-
"@intlayer/config/client": localRequire.resolve("@intlayer/config/client"),
|
|
55
|
-
"@intlayer/core/file": localRequire.resolve("@intlayer/core/file")
|
|
56
|
-
};
|
|
57
|
-
const filePath = rootRequire.resolve("intlayer");
|
|
58
|
-
return await (0, _intlayer_config.bundleFile)(await (0, node_fs_promises.readFile)(filePath, "utf-8"), filePath, {
|
|
59
|
-
external: [...node_module.builtinModules, ...node_module.builtinModules.map((mod) => `node:${mod}`)],
|
|
60
|
-
minify: true,
|
|
61
|
-
plugins: [rewritePathsPlugin(replaceModules)]
|
|
62
|
-
}) ?? "";
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
exports.getIntlayerBundle = getIntlayerBundle;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`node:fs/promises`),t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`@intlayer/config/file`),i=require(`node:module`);const a=(e,t)=>({name:`rewrite-paths`,setup(n){n.onResolve({filter:/.*/},n=>{let r=e[n.path];if(t?.includes(n.path))return null;if(r)return{path:r,namespace:`intlayer-replace-modules`,external:!0};for(let t of Object.keys(e))if(n.path===t||n.path.startsWith(`${t}/`)){let r=n.path.slice(t.length);return{path:e[t]+r,namespace:`intlayer-replace-modules`,external:!0}}})}}),o=async o=>{let s=(0,n.getProjectRequire)(o.content.baseDir),c=n.configESMxCJSRequire,l=n.isESModule?(0,i.createRequire)(require(`url`).pathToFileURL(__filename).href):require,u=(0,t.join)(o.system.configDir,`configuration.json`),d={defu:c.resolve(`defu`),esbuild:c.resolve(`esbuild`),"@intlayer/config/built":u,"@intlayer/config/utils":l.resolve(`@intlayer/config/utils`),"@intlayer/config/client":l.resolve(`@intlayer/config/client`),"@intlayer/core/file":l.resolve(`@intlayer/core/file`)},f=s.resolve(`intlayer`);return await(0,r.bundleFile)(await(0,e.readFile)(f,`utf-8`),f,{external:[...i.builtinModules,...i.builtinModules.map(e=>`node:${e}`)],minify:!0,plugins:[a(d)]})??``};exports.getIntlayerBundle=o;
|
|
67
2
|
//# sourceMappingURL=getIntlayerBundle.cjs.map
|