@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
package/dist/cjs/watcher.cjs
CHANGED
|
@@ -1,96 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_prepareIntlayer = require('./prepareIntlayer.cjs');
|
|
4
|
-
const require_writeContentDeclaration_writeContentDeclaration = require('./writeContentDeclaration/writeContentDeclaration.cjs');
|
|
5
|
-
const require_handleAdditionalContentDeclarationFile = require('./handleAdditionalContentDeclarationFile.cjs');
|
|
6
|
-
const require_handleContentDeclarationFileChange = require('./handleContentDeclarationFileChange.cjs');
|
|
7
|
-
const require_handleContentDeclarationFileMoved = require('./handleContentDeclarationFileMoved.cjs');
|
|
8
|
-
const require_handleUnlinkedContentDeclarationFile = require('./handleUnlinkedContentDeclarationFile.cjs');
|
|
9
|
-
let _intlayer_config = require("@intlayer/config");
|
|
10
|
-
let node_fs_promises = require("node:fs/promises");
|
|
11
|
-
let node_path = require("node:path");
|
|
12
|
-
let chokidar = require("chokidar");
|
|
13
|
-
|
|
14
|
-
//#region src/watcher.ts
|
|
15
|
-
/** @ts-ignore remove error Module '"chokidar"' has no exported member 'ChokidarOptions' */
|
|
16
|
-
const pendingUnlinks = /* @__PURE__ */ new Map();
|
|
17
|
-
const watch = (options) => {
|
|
18
|
-
const configuration = options?.configuration ?? (0, _intlayer_config.getConfiguration)(options?.configOptions);
|
|
19
|
-
const appLogger = (0, _intlayer_config.getAppLogger)(configuration);
|
|
20
|
-
const { watch: isWatchMode, watchedFilesPatternWithPath, fileExtensions } = configuration.content;
|
|
21
|
-
return (0, chokidar.watch)(watchedFilesPatternWithPath, {
|
|
22
|
-
persistent: isWatchMode,
|
|
23
|
-
ignoreInitial: true,
|
|
24
|
-
awaitWriteFinish: {
|
|
25
|
-
stabilityThreshold: 1e3,
|
|
26
|
-
pollInterval: 100
|
|
27
|
-
},
|
|
28
|
-
ignored: [
|
|
29
|
-
"**/node_modules/**",
|
|
30
|
-
"**/dist/**",
|
|
31
|
-
"**/build/**",
|
|
32
|
-
"**/.intlayer/**"
|
|
33
|
-
],
|
|
34
|
-
...options
|
|
35
|
-
}).on("add", async (filePath) => {
|
|
36
|
-
const fileName = (0, node_path.basename)(filePath);
|
|
37
|
-
let isMove = false;
|
|
38
|
-
let matchedOldPath;
|
|
39
|
-
for (const [oldPath] of pendingUnlinks) if ((0, node_path.basename)(oldPath) === fileName) {
|
|
40
|
-
matchedOldPath = oldPath;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
if (!matchedOldPath && pendingUnlinks.size === 1) matchedOldPath = pendingUnlinks.keys().next().value;
|
|
44
|
-
if (matchedOldPath) {
|
|
45
|
-
const pending = pendingUnlinks.get(matchedOldPath);
|
|
46
|
-
if (pending) {
|
|
47
|
-
clearTimeout(pending.timer);
|
|
48
|
-
pendingUnlinks.delete(matchedOldPath);
|
|
49
|
-
}
|
|
50
|
-
isMove = true;
|
|
51
|
-
appLogger(`File moved from ${matchedOldPath} to ${filePath}`);
|
|
52
|
-
await require_handleContentDeclarationFileMoved.handleContentDeclarationFileMoved(matchedOldPath, filePath, configuration);
|
|
53
|
-
}
|
|
54
|
-
if (!isMove) {
|
|
55
|
-
if (await (0, node_fs_promises.readFile)(filePath, "utf-8") === "") {
|
|
56
|
-
const extensionPattern = fileExtensions.map((ext) => ext.replace(/\./g, "\\.")).join("|");
|
|
57
|
-
await require_writeContentDeclaration_writeContentDeclaration.writeContentDeclaration({
|
|
58
|
-
key: fileName.replace(new RegExp(`(${extensionPattern})$`), ""),
|
|
59
|
-
content: {},
|
|
60
|
-
filePath
|
|
61
|
-
}, configuration);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
await require_handleAdditionalContentDeclarationFile.handleAdditionalContentDeclarationFile(filePath, configuration);
|
|
65
|
-
}).on("change", async (filePath) => await require_handleContentDeclarationFileChange.handleContentDeclarationFileChange(filePath, configuration)).on("unlink", async (filePath) => {
|
|
66
|
-
const timer = setTimeout(async () => {
|
|
67
|
-
pendingUnlinks.delete(filePath);
|
|
68
|
-
await require_handleUnlinkedContentDeclarationFile.handleUnlinkedContentDeclarationFile(filePath, configuration);
|
|
69
|
-
}, 200);
|
|
70
|
-
pendingUnlinks.set(filePath, {
|
|
71
|
-
timer,
|
|
72
|
-
oldPath: filePath
|
|
73
|
-
});
|
|
74
|
-
}).on("error", async (error) => {
|
|
75
|
-
appLogger(`Watcher error: ${error}`, { level: "error" });
|
|
76
|
-
appLogger("Restarting watcher");
|
|
77
|
-
await require_prepareIntlayer.prepareIntlayer(configuration);
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
const buildAndWatchIntlayer = async (options) => {
|
|
81
|
-
const { skipPrepare, ...rest } = options ?? {};
|
|
82
|
-
const configuration = options?.configuration ?? (0, _intlayer_config.getConfiguration)(options?.configOptions);
|
|
83
|
-
if (!skipPrepare) await require_prepareIntlayer.prepareIntlayer(configuration, { forceRun: true });
|
|
84
|
-
if (configuration.content.watch || options?.persistent) {
|
|
85
|
-
(0, _intlayer_config.getAppLogger)(configuration)("Watching Intlayer content declarations");
|
|
86
|
-
watch({
|
|
87
|
-
...rest,
|
|
88
|
-
configuration
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
exports.buildAndWatchIntlayer = buildAndWatchIntlayer;
|
|
95
|
-
exports.watch = watch;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./prepareIntlayer.cjs`),t=require(`./writeContentDeclaration/writeContentDeclaration.cjs`),n=require(`./handleAdditionalContentDeclarationFile.cjs`),r=require(`./handleContentDeclarationFileChange.cjs`),i=require(`./handleContentDeclarationFileMoved.cjs`),a=require(`./handleUnlinkedContentDeclarationFile.cjs`);let o=require(`@intlayer/config/node`),s=require(`node:fs/promises`),c=require(`node:path`),l=require(`@intlayer/config/logger`),u=require(`chokidar`);const d=new Map,f=f=>{let p=f?.configuration??(0,o.getConfiguration)(f?.configOptions),m=(0,l.getAppLogger)(p),{watch:h,watchedFilesPatternWithPath:g,fileExtensions:_}=p.content;return(0,u.watch)(g,{persistent:h,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:1e3,pollInterval:100},ignored:[`**/node_modules/**`,`**/dist/**`,`**/build/**`,`**/.intlayer/**`],...f}).on(`add`,async e=>{let r=(0,c.basename)(e),a=!1,o;for(let[e]of d)if((0,c.basename)(e)===r){o=e;break}if(!o&&d.size===1&&(o=d.keys().next().value),o){let t=d.get(o);t&&(clearTimeout(t.timer),d.delete(o)),a=!0,m(`File moved from ${o} to ${e}`),await i.handleContentDeclarationFileMoved(o,e,p)}if(!a&&await(0,s.readFile)(e,`utf-8`)===``){let n=_.map(e=>e.replace(/\./g,`\\.`)).join(`|`);await t.writeContentDeclaration({key:r.replace(RegExp(`(${n})$`),``),content:{},filePath:e},p)}await n.handleAdditionalContentDeclarationFile(e,p)}).on(`change`,async e=>await r.handleContentDeclarationFileChange(e,p)).on(`unlink`,async e=>{let t=setTimeout(async()=>{d.delete(e),await a.handleUnlinkedContentDeclarationFile(e,p)},200);d.set(e,{timer:t,oldPath:e})}).on(`error`,async t=>{m(`Watcher error: ${t}`,{level:`error`}),m(`Restarting watcher`),await e.prepareIntlayer(p)})},p=async t=>{let{skipPrepare:n,...r}=t??{},i=t?.configuration??(0,o.getConfiguration)(t?.configOptions);n||await e.prepareIntlayer(i,{forceRun:!0}),(i.content.watch||t?.persistent)&&((0,l.getAppLogger)(i)(`Watching Intlayer content declarations`),f({...r,configuration:i}))};exports.buildAndWatchIntlayer=p,exports.watch=f;
|
|
96
2
|
//# sourceMappingURL=watcher.cjs.map
|
package/dist/cjs/watcher.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.cjs","names":["handleContentDeclarationFileMoved","writeContentDeclaration","handleAdditionalContentDeclarationFile","handleContentDeclarationFileChange","handleUnlinkedContentDeclarationFile","prepareIntlayer"],"sources":["../../src/watcher.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport {\n type GetConfigurationOptions,\n
|
|
1
|
+
{"version":3,"file":"watcher.cjs","names":["handleContentDeclarationFileMoved","writeContentDeclaration","handleAdditionalContentDeclarationFile","handleContentDeclarationFileChange","handleUnlinkedContentDeclarationFile","prepareIntlayer"],"sources":["../../src/watcher.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types';\n/** @ts-ignore remove error Module '\"chokidar\"' has no exported member 'ChokidarOptions' */\nimport { type ChokidarOptions, watch as chokidarWatch } from 'chokidar';\nimport { handleAdditionalContentDeclarationFile } from './handleAdditionalContentDeclarationFile';\nimport { handleContentDeclarationFileChange } from './handleContentDeclarationFileChange';\nimport { handleContentDeclarationFileMoved } from './handleContentDeclarationFileMoved';\nimport { handleUnlinkedContentDeclarationFile } from './handleUnlinkedContentDeclarationFile';\nimport { prepareIntlayer } from './prepareIntlayer';\nimport { writeContentDeclaration } from './writeContentDeclaration';\n\n// Map to track files that were recently unlinked: oldPath -> { timer, timestamp }\nconst pendingUnlinks = new Map<\n string,\n { timer: NodeJS.Timeout; oldPath: string }\n>();\n\ntype WatchOptions = ChokidarOptions & {\n configuration?: IntlayerConfig;\n configOptions?: GetConfigurationOptions;\n skipPrepare?: boolean;\n};\n\n// Initialize chokidar watcher (non-persistent)\nexport const watch = (options?: WatchOptions) => {\n const configuration: IntlayerConfig =\n options?.configuration ?? getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(configuration);\n\n const {\n watch: isWatchMode,\n watchedFilesPatternWithPath,\n fileExtensions,\n } = configuration.content;\n\n return chokidarWatch(watchedFilesPatternWithPath, {\n persistent: isWatchMode, // Make the watcher persistent\n ignoreInitial: true, // Process existing files\n awaitWriteFinish: {\n stabilityThreshold: 1000,\n pollInterval: 100,\n },\n ignored: [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.intlayer/**',\n ],\n ...options,\n })\n .on('add', async (filePath) => {\n const fileName = basename(filePath);\n let isMove = false;\n\n // Check if this Add corresponds to a pending Unlink (Move/Rename detection)\n // Heuristic:\n // - Priority A: Exact basename match (Moved to different folder)\n // - Priority B: Single entry in pendingUnlinks (Renamed file)\n let matchedOldPath: string | undefined;\n\n // Search for basename match\n for (const [oldPath] of pendingUnlinks) {\n if (basename(oldPath) === fileName) {\n matchedOldPath = oldPath;\n break;\n }\n }\n\n // If no basename match, but exactly one file was recently unlinked, assume it's a rename\n if (!matchedOldPath && pendingUnlinks.size === 1) {\n matchedOldPath = pendingUnlinks.keys().next().value;\n }\n\n if (matchedOldPath) {\n // It is a move! Cancel the unlink handler\n const pending = pendingUnlinks.get(matchedOldPath);\n if (pending) {\n clearTimeout(pending.timer);\n pendingUnlinks.delete(matchedOldPath);\n }\n\n isMove = true;\n appLogger(`File moved from ${matchedOldPath} to ${filePath}`);\n\n await handleContentDeclarationFileMoved(\n matchedOldPath,\n filePath,\n configuration\n );\n }\n\n // If it's NOT a move, perform standard \"New File\" logic\n if (!isMove) {\n const fileContent = await readFile(filePath, 'utf-8');\n const isEmpty = fileContent === '';\n\n // Fill template content declaration file if it is empty\n if (isEmpty) {\n const extensionPattern = fileExtensions\n .map((ext) => ext.replace(/\\./g, '\\\\.'))\n .join('|');\n const name = fileName.replace(\n new RegExp(`(${extensionPattern})$`),\n ''\n );\n\n await writeContentDeclaration(\n {\n key: name,\n content: {},\n filePath,\n },\n configuration\n );\n }\n }\n\n // Always ensure the file is processed (both for moves and adds)\n await handleAdditionalContentDeclarationFile(filePath, configuration);\n })\n .on(\n 'change',\n async (filePath) =>\n await handleContentDeclarationFileChange(filePath, configuration)\n )\n .on('unlink', async (filePath) => {\n // Delay unlink processing to see if an 'add' event occurs (indicating a move)\n const timer = setTimeout(async () => {\n // If timer fires, the file was genuinely removed\n pendingUnlinks.delete(filePath);\n await handleUnlinkedContentDeclarationFile(filePath, configuration);\n }, 200); // 200ms window to catch the 'add' event\n\n pendingUnlinks.set(filePath, { timer, oldPath: filePath });\n })\n .on('error', async (error) => {\n appLogger(`Watcher error: ${error}`, {\n level: 'error',\n });\n\n appLogger('Restarting watcher');\n\n await prepareIntlayer(configuration);\n });\n};\n\nexport const buildAndWatchIntlayer = async (options?: WatchOptions) => {\n const { skipPrepare, ...rest } = options ?? {};\n const configuration =\n options?.configuration ?? getConfiguration(options?.configOptions);\n\n if (!skipPrepare) {\n await prepareIntlayer(configuration, { forceRun: true });\n }\n\n if (configuration.content.watch || options?.persistent) {\n const appLogger = getAppLogger(configuration);\n\n appLogger('Watching Intlayer content declarations');\n watch({ ...rest, configuration });\n }\n};\n"],"mappings":"+kBAkBA,MAAM,EAAiB,IAAI,IAYd,EAAS,GAA2B,CAC/C,IAAM,EACJ,GAAS,gBAAA,EAAA,EAAA,kBAAkC,GAAS,cAAc,CAC9D,GAAA,EAAA,EAAA,cAAyB,EAAc,CAEvC,CACJ,MAAO,EACP,8BACA,kBACE,EAAc,QAElB,OAAA,EAAA,EAAA,OAAqB,EAA6B,CAChD,WAAY,EACZ,cAAe,GACf,iBAAkB,CAChB,mBAAoB,IACpB,aAAc,IACf,CACD,QAAS,CACP,qBACA,aACA,cACA,kBACD,CACD,GAAG,EACJ,CAAC,CACC,GAAG,MAAO,KAAO,IAAa,CAC7B,IAAM,GAAA,EAAA,EAAA,UAAoB,EAAS,CAC/B,EAAS,GAMT,EAGJ,IAAK,GAAM,CAAC,KAAY,EACtB,IAAA,EAAA,EAAA,UAAa,EAAQ,GAAK,EAAU,CAClC,EAAiB,EACjB,MASJ,GAJI,CAAC,GAAkB,EAAe,OAAS,IAC7C,EAAiB,EAAe,MAAM,CAAC,MAAM,CAAC,OAG5C,EAAgB,CAElB,IAAM,EAAU,EAAe,IAAI,EAAe,CAC9C,IACF,aAAa,EAAQ,MAAM,CAC3B,EAAe,OAAO,EAAe,EAGvC,EAAS,GACT,EAAU,mBAAmB,EAAe,MAAM,IAAW,CAE7D,MAAMA,EAAAA,kCACJ,EACA,EACA,EACD,CAIH,GAAI,CAAC,GACiB,MAAA,EAAA,EAAA,UAAe,EAAU,QAAQ,GACrB,GAGnB,CACX,IAAM,EAAmB,EACtB,IAAK,GAAQ,EAAI,QAAQ,MAAO,MAAM,CAAC,CACvC,KAAK,IAAI,CAMZ,MAAMC,EAAAA,wBACJ,CACE,IAPS,EAAS,QAChB,OAAO,IAAI,EAAiB,IAAI,CACpC,GACD,CAKG,QAAS,EAAE,CACX,WACD,CACD,EACD,CAKL,MAAMC,EAAAA,uCAAuC,EAAU,EAAc,EACrE,CACD,GACC,SACA,KAAO,IACL,MAAMC,EAAAA,mCAAmC,EAAU,EAAc,CACpE,CACA,GAAG,SAAU,KAAO,IAAa,CAEhC,IAAM,EAAQ,WAAW,SAAY,CAEnC,EAAe,OAAO,EAAS,CAC/B,MAAMC,EAAAA,qCAAqC,EAAU,EAAc,EAClE,IAAI,CAEP,EAAe,IAAI,EAAU,CAAE,QAAO,QAAS,EAAU,CAAC,EAC1D,CACD,GAAG,QAAS,KAAO,IAAU,CAC5B,EAAU,kBAAkB,IAAS,CACnC,MAAO,QACR,CAAC,CAEF,EAAU,qBAAqB,CAE/B,MAAMC,EAAAA,gBAAgB,EAAc,EACpC,EAGO,EAAwB,KAAO,IAA2B,CACrE,GAAM,CAAE,cAAa,GAAG,GAAS,GAAW,EAAE,CACxC,EACJ,GAAS,gBAAA,EAAA,EAAA,kBAAkC,GAAS,cAAc,CAE/D,GACH,MAAMA,EAAAA,gBAAgB,EAAe,CAAE,SAAU,GAAM,CAAC,EAGtD,EAAc,QAAQ,OAAS,GAAS,eAG1C,EAAA,EAAA,cAF+B,EAAc,CAEnC,yCAAyC,CACnD,EAAM,CAAE,GAAG,EAAM,gBAAe,CAAC"}
|
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_writeJsonIfChanged = require('../writeJsonIfChanged.cjs');
|
|
4
|
-
let node_fs_promises = require("node:fs/promises");
|
|
5
|
-
let node_path = require("node:path");
|
|
6
|
-
let node_util = require("node:util");
|
|
7
|
-
|
|
8
|
-
//#region src/writeConfiguration/index.ts
|
|
9
|
-
const getCachedConfiguration = async (configuration) => {
|
|
10
|
-
const configurationContent = await (0, node_fs_promises.readFile)((0, node_path.join)(configuration.system.configDir, "configuration.json"), "utf8");
|
|
11
|
-
return JSON.parse(configurationContent);
|
|
12
|
-
};
|
|
13
|
-
const isCachedConfigurationUpToDate = async (configuration) => {
|
|
14
|
-
try {
|
|
15
|
-
const cleanedConfiguration = cleanConfiguration(configuration);
|
|
16
|
-
return (0, node_util.isDeepStrictEqual)(await getCachedConfiguration(cleanedConfiguration), cleanedConfiguration);
|
|
17
|
-
} catch {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const cleanConfiguration = (configuration) => {
|
|
22
|
-
const { schemas, plugins, compiler, build, ...filteredConfiguration } = configuration;
|
|
23
|
-
return JSON.parse(JSON.stringify(filteredConfiguration));
|
|
24
|
-
};
|
|
25
|
-
const writeConfiguration = async (configuration) => {
|
|
26
|
-
const { system } = configuration;
|
|
27
|
-
const { configDir } = system;
|
|
28
|
-
await (0, node_fs_promises.mkdir)(configDir, { recursive: true });
|
|
29
|
-
await require_writeJsonIfChanged.writeJsonIfChanged((0, node_path.join)(configDir, "configuration.json"), cleanConfiguration(configuration));
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.isCachedConfigurationUpToDate = isCachedConfigurationUpToDate;
|
|
34
|
-
exports.writeConfiguration = writeConfiguration;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../writeJsonIfChanged.cjs`);let t=require(`node:fs/promises`),n=require(`node:path`),r=require(`node:util`);const i=async e=>{let r=await(0,t.readFile)((0,n.join)(e.system.configDir,`configuration.json`),`utf8`);return JSON.parse(r)},a=async e=>{try{let t=o(e);return(0,r.isDeepStrictEqual)(await i(t),t)}catch{return null}},o=e=>{let{schemas:t,plugins:n,compiler:r,build:i,...a}=e;return JSON.parse(JSON.stringify(a))},s=async r=>{let{system:i}=r,{configDir:a}=i;await(0,t.mkdir)(a,{recursive:!0}),await e.writeJsonIfChanged((0,n.join)(a,`configuration.json`),o(r))};exports.isCachedConfigurationUpToDate=a,exports.writeConfiguration=s;
|
|
35
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["writeJsonIfChanged"],"sources":["../../../src/writeConfiguration/index.ts"],"sourcesContent":["import { mkdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { isDeepStrictEqual } from 'node:util';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\n\nconst getCachedConfiguration = async (configuration: IntlayerConfig) => {\n const configFilePath = join(\n configuration.system.configDir,\n 'configuration.json'\n );\n\n const configurationContent = await readFile(configFilePath, 'utf8');\n return JSON.parse(configurationContent);\n};\n\nexport const isCachedConfigurationUpToDate = async (\n configuration: IntlayerConfig\n): Promise<boolean | null> => {\n try {\n const cleanedConfiguration = cleanConfiguration(configuration);\n const cachedConfiguration =\n await getCachedConfiguration(cleanedConfiguration);\n\n const isSimilar = isDeepStrictEqual(\n cachedConfiguration,\n cleanedConfiguration\n );\n\n return isSimilar;\n } catch {\n return null;\n }\n};\n\nconst cleanConfiguration = (configuration: IntlayerConfig): IntlayerConfig => {\n const {\n // Remove schema, and plugins because only useful at build time\n schemas,\n plugins,\n compiler,\n build,\n ...filteredConfiguration\n } = configuration;\n\n const parsedConfiguration = JSON.parse(JSON.stringify(filteredConfiguration));\n\n return parsedConfiguration;\n};\n\nexport const writeConfiguration = async (configuration: IntlayerConfig) => {\n const { system } = configuration;\n const { configDir } = system;\n\n // Ensure target directory exists\n // configDir is expected to be the directory where configuration.json will live\n await mkdir(configDir, { recursive: true });\n\n const configFilePath = join(configDir, 'configuration.json');\n\n const cleanedConfiguration = cleanConfiguration(configuration);\n\n await writeJsonIfChanged(configFilePath, cleanedConfiguration);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["writeJsonIfChanged"],"sources":["../../../src/writeConfiguration/index.ts"],"sourcesContent":["import { mkdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { isDeepStrictEqual } from 'node:util';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\n\nconst getCachedConfiguration = async (configuration: IntlayerConfig) => {\n const configFilePath = join(\n configuration.system.configDir,\n 'configuration.json'\n );\n\n const configurationContent = await readFile(configFilePath, 'utf8');\n return JSON.parse(configurationContent);\n};\n\nexport const isCachedConfigurationUpToDate = async (\n configuration: IntlayerConfig\n): Promise<boolean | null> => {\n try {\n const cleanedConfiguration = cleanConfiguration(configuration);\n const cachedConfiguration =\n await getCachedConfiguration(cleanedConfiguration);\n\n const isSimilar = isDeepStrictEqual(\n cachedConfiguration,\n cleanedConfiguration\n );\n\n return isSimilar;\n } catch {\n return null;\n }\n};\n\nconst cleanConfiguration = (configuration: IntlayerConfig): IntlayerConfig => {\n const {\n // Remove schema, and plugins because only useful at build time\n schemas,\n plugins,\n compiler,\n build,\n ...filteredConfiguration\n } = configuration;\n\n const parsedConfiguration = JSON.parse(JSON.stringify(filteredConfiguration));\n\n return parsedConfiguration;\n};\n\nexport const writeConfiguration = async (configuration: IntlayerConfig) => {\n const { system } = configuration;\n const { configDir } = system;\n\n // Ensure target directory exists\n // configDir is expected to be the directory where configuration.json will live\n await mkdir(configDir, { recursive: true });\n\n const configFilePath = join(configDir, 'configuration.json');\n\n const cleanedConfiguration = cleanConfiguration(configuration);\n\n await writeJsonIfChanged(configFilePath, cleanedConfiguration);\n};\n"],"mappings":"6OAMA,MAAM,EAAyB,KAAO,IAAkC,CAMtE,IAAM,EAAuB,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,MAJ3B,EAAc,OAAO,UACrB,qBACD,CAE2D,OAAO,CACnE,OAAO,KAAK,MAAM,EAAqB,EAG5B,EAAgC,KAC3C,IAC4B,CAC5B,GAAI,CACF,IAAM,EAAuB,EAAmB,EAAc,CAS9D,OAAA,EAAA,EAAA,mBAPE,MAAM,EAAuB,EAAqB,CAIlD,EACD,MAGK,CACN,OAAO,OAIL,EAAsB,GAAkD,CAC5E,GAAM,CAEJ,UACA,UACA,WACA,QACA,GAAG,GACD,EAIJ,OAF4B,KAAK,MAAM,KAAK,UAAU,EAAsB,CAAC,EAKlE,EAAqB,KAAO,IAAkC,CACzE,GAAM,CAAE,UAAW,EACb,CAAE,aAAc,EAItB,MAAA,EAAA,EAAA,OAAY,EAAW,CAAE,UAAW,GAAM,CAAC,CAM3C,MAAMA,EAAAA,oBAAAA,EAAAA,EAAAA,MAJsB,EAAW,qBAAqB,CAE/B,EAAmB,EAAc,CAEA"}
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/writeContentDeclaration/detectExportedComponentName.ts
|
|
4
|
-
/**
|
|
5
|
-
* Attempt to detect an exported React component name in the file text.
|
|
6
|
-
* Looks for patterns like:
|
|
7
|
-
* - export const MyComponent = ...
|
|
8
|
-
* - export function MyComponent(...)
|
|
9
|
-
* - export default function MyComponent(...)
|
|
10
|
-
*/
|
|
11
|
-
const detectExportedComponentName = (fileText) => {
|
|
12
|
-
const defaultEsmFnRegex = /export\s+default\s+function\s+(\w+)/;
|
|
13
|
-
const defaultEsmVarRegex = /export\s+default\s+(\w+)/;
|
|
14
|
-
const cjsDefaultRegex = /module\.exports\s*=\s*(\w+)/;
|
|
15
|
-
const cjsDefaultVarRegex = /exports\.default\s*=\s*(\w+)/;
|
|
16
|
-
const namedExportRegex = /export\s+(?:const|function)\s+(\w+)/g;
|
|
17
|
-
const defaultEsmFnMatch = fileText.match(defaultEsmFnRegex);
|
|
18
|
-
if (defaultEsmFnMatch) return defaultEsmFnMatch[1];
|
|
19
|
-
const defaultEsmVarMatch = fileText.match(defaultEsmVarRegex);
|
|
20
|
-
if (defaultEsmVarMatch) return defaultEsmVarMatch[1];
|
|
21
|
-
const cjsDefaultMatch = fileText.match(cjsDefaultRegex) || fileText.match(cjsDefaultVarRegex);
|
|
22
|
-
if (cjsDefaultMatch) return cjsDefaultMatch[1];
|
|
23
|
-
for (const match of fileText.matchAll(namedExportRegex)) if (/^[A-Z]/.test(match[1])) return match[1];
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.detectExportedComponentName = detectExportedComponentName;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{let t=/export\s+default\s+function\s+(\w+)/,n=/export\s+default\s+(\w+)/,r=/module\.exports\s*=\s*(\w+)/,i=/exports\.default\s*=\s*(\w+)/,a=/export\s+(?:const|function)\s+(\w+)/g,o=e.match(t);if(o)return o[1];let s=e.match(n);if(s)return s[1];let c=e.match(r)||e.match(i);if(c)return c[1];for(let t of e.matchAll(a))if(/^[A-Z]/.test(t[1]))return t[1];return null};exports.detectExportedComponentName=e;
|
|
29
2
|
//# sourceMappingURL=detectExportedComponentName.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectExportedComponentName.cjs","names":[],"sources":["../../../src/writeContentDeclaration/detectExportedComponentName.ts"],"sourcesContent":["/**\n * Attempt to detect an exported React component name in the file text.\n * Looks for patterns like:\n * - export const MyComponent = ...\n * - export function MyComponent(...)\n * - export default function MyComponent(...)\n */\nexport const detectExportedComponentName = (\n fileText: string\n): string | null => {\n // Added regexes for default ESM, default CJS, and named exports\n const defaultEsmFnRegex = /export\\s+default\\s+function\\s+(\\w+)/;\n const defaultEsmVarRegex = /export\\s+default\\s+(\\w+)/;\n const cjsDefaultRegex = /module\\.exports\\s*=\\s*(\\w+)/;\n const cjsDefaultVarRegex = /exports\\.default\\s*=\\s*(\\w+)/;\n const namedExportRegex = /export\\s+(?:const|function)\\s+(\\w+)/g;\n\n // Check for default ESM function or variable\n const defaultEsmFnMatch = fileText.match(defaultEsmFnRegex);\n if (defaultEsmFnMatch) {\n return defaultEsmFnMatch[1];\n }\n\n const defaultEsmVarMatch = fileText.match(defaultEsmVarRegex);\n if (defaultEsmVarMatch) {\n return defaultEsmVarMatch[1];\n }\n\n // Check for default CJS\n const cjsDefaultMatch =\n fileText.match(cjsDefaultRegex) || fileText.match(cjsDefaultVarRegex);\n\n if (cjsDefaultMatch) return cjsDefaultMatch[1];\n\n // Otherwise, look for capitalized named exports\n for (const match of fileText.matchAll(namedExportRegex)) {\n if (/^[A-Z]/.test(match[1])) return match[1];\n }\n\n // If we can’t find it, return null\n return null;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"detectExportedComponentName.cjs","names":[],"sources":["../../../src/writeContentDeclaration/detectExportedComponentName.ts"],"sourcesContent":["/**\n * Attempt to detect an exported React component name in the file text.\n * Looks for patterns like:\n * - export const MyComponent = ...\n * - export function MyComponent(...)\n * - export default function MyComponent(...)\n */\nexport const detectExportedComponentName = (\n fileText: string\n): string | null => {\n // Added regexes for default ESM, default CJS, and named exports\n const defaultEsmFnRegex = /export\\s+default\\s+function\\s+(\\w+)/;\n const defaultEsmVarRegex = /export\\s+default\\s+(\\w+)/;\n const cjsDefaultRegex = /module\\.exports\\s*=\\s*(\\w+)/;\n const cjsDefaultVarRegex = /exports\\.default\\s*=\\s*(\\w+)/;\n const namedExportRegex = /export\\s+(?:const|function)\\s+(\\w+)/g;\n\n // Check for default ESM function or variable\n const defaultEsmFnMatch = fileText.match(defaultEsmFnRegex);\n if (defaultEsmFnMatch) {\n return defaultEsmFnMatch[1];\n }\n\n const defaultEsmVarMatch = fileText.match(defaultEsmVarRegex);\n if (defaultEsmVarMatch) {\n return defaultEsmVarMatch[1];\n }\n\n // Check for default CJS\n const cjsDefaultMatch =\n fileText.match(cjsDefaultRegex) || fileText.match(cjsDefaultVarRegex);\n\n if (cjsDefaultMatch) return cjsDefaultMatch[1];\n\n // Otherwise, look for capitalized named exports\n for (const match of fileText.matchAll(namedExportRegex)) {\n if (/^[A-Z]/.test(match[1])) return match[1];\n }\n\n // If we can’t find it, return null\n return null;\n};\n"],"mappings":"mEAOA,MAAa,EACX,GACkB,CAElB,IAAM,EAAoB,sCACpB,EAAqB,2BACrB,EAAkB,8BAClB,EAAqB,+BACrB,EAAmB,uCAGnB,EAAoB,EAAS,MAAM,EAAkB,CAC3D,GAAI,EACF,OAAO,EAAkB,GAG3B,IAAM,EAAqB,EAAS,MAAM,EAAmB,CAC7D,GAAI,EACF,OAAO,EAAmB,GAI5B,IAAM,EACJ,EAAS,MAAM,EAAgB,EAAI,EAAS,MAAM,EAAmB,CAEvE,GAAI,EAAiB,OAAO,EAAgB,GAG5C,IAAK,IAAM,KAAS,EAAS,SAAS,EAAiB,CACrD,GAAI,SAAS,KAAK,EAAM,GAAG,CAAE,OAAO,EAAM,GAI5C,OAAO"}
|
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
|
|
5
|
-
//#region src/writeContentDeclaration/detectFormatCommand.ts
|
|
6
|
-
let cachedFormatCommand = null;
|
|
7
|
-
const detectFormatCommand = (configuration, projectRequireProp) => {
|
|
8
|
-
const { formatCommand, baseDir } = configuration.content;
|
|
9
|
-
const projectRequire = projectRequireProp ?? (0, _intlayer_config.getProjectRequire)(baseDir);
|
|
10
|
-
if (formatCommand) return formatCommand;
|
|
11
|
-
if (cachedFormatCommand !== null) return cachedFormatCommand;
|
|
12
|
-
try {
|
|
13
|
-
projectRequire.resolve("prettier");
|
|
14
|
-
cachedFormatCommand = "prettier --write \"{{file}}\" --log-level silent";
|
|
15
|
-
return cachedFormatCommand;
|
|
16
|
-
} catch (_error) {}
|
|
17
|
-
try {
|
|
18
|
-
projectRequire.resolve("biome");
|
|
19
|
-
cachedFormatCommand = "biome format \"{{file}}\" --write --log-level none";
|
|
20
|
-
return cachedFormatCommand;
|
|
21
|
-
} catch (_error) {}
|
|
22
|
-
try {
|
|
23
|
-
projectRequire.resolve("eslint");
|
|
24
|
-
cachedFormatCommand = "eslint --fix \"{{file}}\" --quiet";
|
|
25
|
-
return cachedFormatCommand;
|
|
26
|
-
} catch (_error) {}
|
|
27
|
-
cachedFormatCommand = void 0;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
exports.detectFormatCommand = detectFormatCommand;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/config/utils`),t=null;const n=(n,r)=>{let{formatCommand:i,baseDir:a}=n.content,o=r??(0,e.getProjectRequire)(a);if(i)return i;if(t!==null)return t;try{return o.resolve(`prettier`),t=`prettier --write "{{file}}" --log-level silent`,t}catch{}try{return o.resolve(`biome`),t=`biome format "{{file}}" --write --log-level none`,t}catch{}try{return o.resolve(`eslint`),t=`eslint --fix "{{file}}" --quiet`,t}catch{}t=void 0};exports.detectFormatCommand=n;
|
|
32
2
|
//# sourceMappingURL=detectFormatCommand.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectFormatCommand.cjs","names":[],"sources":["../../../src/writeContentDeclaration/detectFormatCommand.ts"],"sourcesContent":["import { getProjectRequire } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nlet cachedFormatCommand: string | undefined | null = null;\n\nexport const detectFormatCommand = (\n configuration: IntlayerConfig,\n projectRequireProp?: NodeJS.Require\n) => {\n const { formatCommand, baseDir } = configuration.content;\n const projectRequire = projectRequireProp ?? getProjectRequire(baseDir);\n\n // Priority: Explicit configuration\n // We do not cache this because the user might change their config file active-session.\n if (formatCommand) {\n return formatCommand;\n }\n\n // Priority: Cached detection\n // If not null, we have already performed the expensive checks.\n if (cachedFormatCommand !== null) {\n return cachedFormatCommand;\n }\n\n // Perform Detection\n\n // Try Prettier\n try {\n projectRequire.resolve('prettier');\n cachedFormatCommand = 'prettier --write \"{{file}}\" --log-level silent';\n return cachedFormatCommand;\n } catch (_error) {\n // Prettier not found, continue\n }\n\n // Try Biome\n try {\n projectRequire.resolve('biome');\n cachedFormatCommand = 'biome format \"{{file}}\" --write --log-level none';\n return cachedFormatCommand;\n } catch (_error) {\n // Biome not found, continue\n }\n\n // Try ESLint\n try {\n projectRequire.resolve('eslint');\n cachedFormatCommand = 'eslint --fix \"{{file}}\" --quiet';\n return cachedFormatCommand;\n } catch (_error) {\n // ESLint not found\n }\n\n // No formatter found\n // Set to undefined (not null) so we know we checked and found nothing.\n cachedFormatCommand = undefined;\n return undefined;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"detectFormatCommand.cjs","names":[],"sources":["../../../src/writeContentDeclaration/detectFormatCommand.ts"],"sourcesContent":["import { getProjectRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nlet cachedFormatCommand: string | undefined | null = null;\n\nexport const detectFormatCommand = (\n configuration: IntlayerConfig,\n projectRequireProp?: NodeJS.Require\n) => {\n const { formatCommand, baseDir } = configuration.content;\n const projectRequire = projectRequireProp ?? getProjectRequire(baseDir);\n\n // Priority: Explicit configuration\n // We do not cache this because the user might change their config file active-session.\n if (formatCommand) {\n return formatCommand;\n }\n\n // Priority: Cached detection\n // If not null, we have already performed the expensive checks.\n if (cachedFormatCommand !== null) {\n return cachedFormatCommand;\n }\n\n // Perform Detection\n\n // Try Prettier\n try {\n projectRequire.resolve('prettier');\n cachedFormatCommand = 'prettier --write \"{{file}}\" --log-level silent';\n return cachedFormatCommand;\n } catch (_error) {\n // Prettier not found, continue\n }\n\n // Try Biome\n try {\n projectRequire.resolve('biome');\n cachedFormatCommand = 'biome format \"{{file}}\" --write --log-level none';\n return cachedFormatCommand;\n } catch (_error) {\n // Biome not found, continue\n }\n\n // Try ESLint\n try {\n projectRequire.resolve('eslint');\n cachedFormatCommand = 'eslint --fix \"{{file}}\" --quiet';\n return cachedFormatCommand;\n } catch (_error) {\n // ESLint not found\n }\n\n // No formatter found\n // Set to undefined (not null) so we know we checked and found nothing.\n cachedFormatCommand = undefined;\n return undefined;\n};\n"],"mappings":"wJAGI,EAAiD,KAErD,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,gBAAe,WAAY,EAAc,QAC3C,EAAiB,IAAA,EAAA,EAAA,mBAAwC,EAAQ,CAIvE,GAAI,EACF,OAAO,EAKT,GAAI,IAAwB,KAC1B,OAAO,EAMT,GAAI,CAGF,OAFA,EAAe,QAAQ,WAAW,CAClC,EAAsB,iDACf,OACQ,EAKjB,GAAI,CAGF,OAFA,EAAe,QAAQ,QAAQ,CAC/B,EAAsB,mDACf,OACQ,EAKjB,GAAI,CAGF,OAFA,EAAe,QAAQ,SAAS,CAChC,EAAsB,kCACf,OACQ,EAMjB,EAAsB,IAAA"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_writeContentDeclaration_detectExportedComponentName = require('./detectExportedComponentName.cjs');
|
|
3
|
-
const require_writeContentDeclaration_detectFormatCommand = require('./detectFormatCommand.cjs');
|
|
4
|
-
const require_writeContentDeclaration_transformJSFile = require('./transformJSFile.cjs');
|
|
5
|
-
const require_writeContentDeclaration_writeJSFile = require('./writeJSFile.cjs');
|
|
6
|
-
const require_writeContentDeclaration_writeContentDeclaration = require('./writeContentDeclaration.cjs');
|
|
7
|
-
|
|
8
|
-
exports.detectExportedComponentName = require_writeContentDeclaration_detectExportedComponentName.detectExportedComponentName;
|
|
9
|
-
exports.detectFormatCommand = require_writeContentDeclaration_detectFormatCommand.detectFormatCommand;
|
|
10
|
-
exports.transformJSFile = require_writeContentDeclaration_transformJSFile.transformJSFile;
|
|
11
|
-
exports.writeContentDeclaration = require_writeContentDeclaration_writeContentDeclaration.writeContentDeclaration;
|
|
12
|
-
exports.writeJSFile = require_writeContentDeclaration_writeJSFile.writeJSFile;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./detectExportedComponentName.cjs`),t=require(`./detectFormatCommand.cjs`),n=require(`./transformJSFile.cjs`),r=require(`./writeJSFile.cjs`),i=require(`./writeContentDeclaration.cjs`);exports.detectExportedComponentName=e.detectExportedComponentName,exports.detectFormatCommand=t.detectFormatCommand,exports.transformJSFile=n.transformJSFile,exports.writeContentDeclaration=i.writeContentDeclaration,exports.writeJSFile=r.writeJSFile;
|
|
@@ -1,94 +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 _intlayer_core = require("@intlayer/core");
|
|
6
|
-
let _intlayer_types = require("@intlayer/types");
|
|
7
|
-
let node_fs = require("node:fs");
|
|
8
|
-
|
|
9
|
-
//#region src/writeContentDeclaration/processContentDeclarationContent.ts
|
|
10
|
-
/**
|
|
11
|
-
* Write file plugin
|
|
12
|
-
*/
|
|
13
|
-
const writeFilePlugin = {
|
|
14
|
-
id: "write-file-plugin",
|
|
15
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === _intlayer_types.NodeType.File,
|
|
16
|
-
transform: (node) => {
|
|
17
|
-
const fileContent = node.content;
|
|
18
|
-
const filePath = node.fixedPath;
|
|
19
|
-
if (typeof fileContent !== "string") throw new Error("File content must be a string");
|
|
20
|
-
if (typeof filePath !== "string") throw new Error("File path must be a string");
|
|
21
|
-
try {
|
|
22
|
-
const absoluteFilePath = (0, node_path.join)(process.cwd(), filePath);
|
|
23
|
-
const fileDirectory = (0, node_path.dirname)(absoluteFilePath);
|
|
24
|
-
if (!(0, node_fs.existsSync)(fileDirectory)) (0, node_fs.mkdirSync)(fileDirectory, { recursive: true });
|
|
25
|
-
(0, node_fs.writeFileSync)(absoluteFilePath, fileContent);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
throw new Error(`${_intlayer_config.x} Error writing file to ${(0, _intlayer_config.colorizePath)(filePath)}: ${error}`);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
nodeType: _intlayer_types.NodeType.File,
|
|
31
|
-
[_intlayer_types.NodeType.File]: node.file
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Markdown file plugin
|
|
37
|
-
*/
|
|
38
|
-
const markdownFilePlugin = {
|
|
39
|
-
id: "markdown-file-plugin",
|
|
40
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === _intlayer_types.NodeType.Markdown,
|
|
41
|
-
transform: (node, props, deepTransformNode) => {
|
|
42
|
-
return {
|
|
43
|
-
nodeType: _intlayer_types.NodeType.Markdown,
|
|
44
|
-
[_intlayer_types.NodeType.Markdown]: deepTransformNode(node.markdown, props)
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Insertion file plugin
|
|
50
|
-
*/
|
|
51
|
-
const insertionFilePlugin = {
|
|
52
|
-
id: "insertion-file-plugin",
|
|
53
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === _intlayer_types.NodeType.Insertion,
|
|
54
|
-
transform: (node, props, deepTransformNode) => {
|
|
55
|
-
return {
|
|
56
|
-
nodeType: _intlayer_types.NodeType.Insertion,
|
|
57
|
-
[_intlayer_types.NodeType.Insertion]: deepTransformNode(node.insertion, props)
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* HTML file plugin
|
|
63
|
-
*/
|
|
64
|
-
const htmlFilePlugin = {
|
|
65
|
-
id: "html-file-plugin",
|
|
66
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === _intlayer_types.NodeType.HTML,
|
|
67
|
-
transform: (node, props, deepTransformNode) => {
|
|
68
|
-
return {
|
|
69
|
-
nodeType: _intlayer_types.NodeType.HTML,
|
|
70
|
-
[_intlayer_types.NodeType.HTML]: deepTransformNode(node.html, props)
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Process content declaration content
|
|
76
|
-
*
|
|
77
|
-
* It filter node that are autogenerated by intlayer to do not rewrite them in the content declaration file.
|
|
78
|
-
*
|
|
79
|
-
* And write external sources as file content if necessary.
|
|
80
|
-
*/
|
|
81
|
-
const processContentDeclarationContent = async (dictionary) => (0, _intlayer_core.deepTransformNode)(dictionary, {
|
|
82
|
-
dictionaryKey: dictionary.key,
|
|
83
|
-
keyPath: [],
|
|
84
|
-
plugins: [
|
|
85
|
-
writeFilePlugin,
|
|
86
|
-
markdownFilePlugin,
|
|
87
|
-
insertionFilePlugin,
|
|
88
|
-
htmlFilePlugin
|
|
89
|
-
]
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
//#endregion
|
|
93
|
-
exports.processContentDeclarationContent = processContentDeclarationContent;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`node:path`),t=require(`@intlayer/config/logger`),n=require(`@intlayer/core/interpreter`),r=require(`@intlayer/types`),i=require(`node:fs`);const a={id:`write-file-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===r.NodeType.File,transform:n=>{let a=n.content,o=n.fixedPath;if(typeof a!=`string`)throw Error(`File content must be a string`);if(typeof o!=`string`)throw Error(`File path must be a string`);try{let t=(0,e.join)(process.cwd(),o),n=(0,e.dirname)(t);(0,i.existsSync)(n)||(0,i.mkdirSync)(n,{recursive:!0}),(0,i.writeFileSync)(t,a)}catch(e){throw Error(`${t.x} Error writing file to ${(0,t.colorizePath)(o)}: ${e}`)}return{nodeType:r.NodeType.File,[r.NodeType.File]:n.file}}},o={id:`markdown-file-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===r.NodeType.Markdown,transform:(e,t,n)=>({nodeType:r.NodeType.Markdown,[r.NodeType.Markdown]:n(e.markdown,t)})},s={id:`insertion-file-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===r.NodeType.Insertion,transform:(e,t,n)=>({nodeType:r.NodeType.Insertion,[r.NodeType.Insertion]:n(e.insertion,t)})},c={id:`html-file-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===r.NodeType.HTML,transform:(e,t,n)=>({nodeType:r.NodeType.HTML,[r.NodeType.HTML]:n(e.html,t)})},l=async e=>(0,n.deepTransformNode)(e,{dictionaryKey:e.key,keyPath:[],plugins:[a,o,s,c]});exports.processContentDeclarationContent=l;
|
|
94
2
|
//# sourceMappingURL=processContentDeclarationContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processContentDeclarationContent.cjs","names":["NodeType","x"],"sources":["../../../src/writeContentDeclaration/processContentDeclarationContent.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { colorizePath, x } from '@intlayer/config';\nimport {\n
|
|
1
|
+
{"version":3,"file":"processContentDeclarationContent.cjs","names":["NodeType","x"],"sources":["../../../src/writeContentDeclaration/processContentDeclarationContent.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { colorizePath, x } from '@intlayer/config/logger';\nimport { deepTransformNode, type Plugins } from '@intlayer/core/interpreter';\nimport type {\n FileContent,\n FileContentConstructor,\n HTMLContent,\n HTMLContentConstructor,\n InsertionContent,\n InsertionContentConstructor,\n MarkdownContent,\n MarkdownContentConstructor,\n} from '@intlayer/core/transpiler';\nimport { type Dictionary, NodeType } from '@intlayer/types';\n\n/**\n * Write file plugin\n */\n\nconst writeFilePlugin: Plugins = {\n id: 'write-file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.File,\n transform: (node: FileContent) => {\n const fileContent = node.content;\n const filePath = node.fixedPath;\n\n if (typeof fileContent !== 'string') {\n throw new Error('File content must be a string');\n }\n\n if (typeof filePath !== 'string') {\n throw new Error('File path must be a string');\n }\n\n // Write the file to the file system\n try {\n const absoluteFilePath = join(process.cwd(), filePath);\n\n // Create the file directory if it doesn't exist\n const fileDirectory = dirname(absoluteFilePath);\n\n if (!existsSync(fileDirectory)) {\n mkdirSync(fileDirectory, { recursive: true });\n }\n\n // Write the file\n writeFileSync(absoluteFilePath, fileContent);\n } catch (error) {\n throw new Error(\n `${x} Error writing file to ${colorizePath(filePath)}: ${error}`\n );\n }\n\n const transformedFileContent: FileContentConstructor = {\n nodeType: NodeType.File,\n [NodeType.File]: node.file,\n };\n\n return transformedFileContent;\n },\n};\n\n/**\n * Markdown file plugin\n */\n\nconst markdownFilePlugin: Plugins = {\n id: 'markdown-file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Markdown,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const simplifiedMarkdownNode: MarkdownContentConstructor = {\n nodeType: NodeType.Markdown,\n [NodeType.Markdown]: deepTransformNode(node.markdown, props),\n };\n\n return simplifiedMarkdownNode;\n },\n};\n\n/**\n * Insertion file plugin\n */\n\nconst insertionFilePlugin: Plugins = {\n id: 'insertion-file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Insertion,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const simplifiedInsertionNode: InsertionContentConstructor = {\n nodeType: NodeType.Insertion,\n [NodeType.Insertion]: deepTransformNode(node.insertion, props),\n };\n\n return simplifiedInsertionNode;\n },\n};\n\n/**\n * HTML file plugin\n */\n\nconst htmlFilePlugin: Plugins = {\n id: 'html-file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.HTML,\n transform: (node: HTMLContent, props, deepTransformNode) => {\n const simplifiedHTMLNode: HTMLContentConstructor = {\n nodeType: NodeType.HTML,\n [NodeType.HTML]: deepTransformNode(node.html, props),\n };\n\n return simplifiedHTMLNode;\n },\n};\n\n/**\n * Process content declaration content\n *\n * It filter node that are autogenerated by intlayer to do not rewrite them in the content declaration file.\n *\n * And write external sources as file content if necessary.\n */\nexport const processContentDeclarationContent = async (\n dictionary: Dictionary\n) =>\n deepTransformNode(dictionary, {\n dictionaryKey: dictionary.key,\n keyPath: [],\n plugins: [\n writeFilePlugin,\n markdownFilePlugin,\n insertionFilePlugin,\n htmlFilePlugin,\n ],\n });\n"],"mappings":"0QAoBA,MAAM,EAA2B,CAC/B,GAAI,oBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaA,EAAAA,SAAS,KAC1D,UAAY,GAAsB,CAChC,IAAM,EAAc,EAAK,QACnB,EAAW,EAAK,UAEtB,GAAI,OAAO,GAAgB,SACzB,MAAU,MAAM,gCAAgC,CAGlD,GAAI,OAAO,GAAa,SACtB,MAAU,MAAM,6BAA6B,CAI/C,GAAI,CACF,IAAM,GAAA,EAAA,EAAA,MAAwB,QAAQ,KAAK,CAAE,EAAS,CAGhD,GAAA,EAAA,EAAA,SAAwB,EAAiB,EAE3C,EAAA,EAAA,YAAY,EAAc,GAC5B,EAAA,EAAA,WAAU,EAAe,CAAE,UAAW,GAAM,CAAC,EAI/C,EAAA,EAAA,eAAc,EAAkB,EAAY,OACrC,EAAO,CACd,MAAU,MACR,GAAGC,EAAAA,EAAE,0BAAA,EAAA,EAAA,cAAsC,EAAS,CAAC,IAAI,IAC1D,CAQH,MALuD,CACrD,SAAUD,EAAAA,SAAS,MAClBA,EAAAA,SAAS,MAAO,EAAK,KACvB,EAIJ,CAMK,EAA8B,CAClC,GAAI,uBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaA,EAAAA,SAAS,SAC1D,WAAY,EAAuB,EAAO,KACmB,CACzD,SAAUA,EAAAA,SAAS,UAClBA,EAAAA,SAAS,UAAW,EAAkB,EAAK,SAAU,EAAM,CAC7D,EAIJ,CAMK,EAA+B,CACnC,GAAI,wBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaA,EAAAA,SAAS,UAC1D,WAAY,EAAwB,EAAO,KACoB,CAC3D,SAAUA,EAAAA,SAAS,WAClBA,EAAAA,SAAS,WAAY,EAAkB,EAAK,UAAW,EAAM,CAC/D,EAIJ,CAMK,EAA0B,CAC9B,GAAI,mBACJ,UAAY,GACV,OAAO,GAAS,UAAY,GAAM,WAAaA,EAAAA,SAAS,KAC1D,WAAY,EAAmB,EAAO,KACe,CACjD,SAAUA,EAAAA,SAAS,MAClBA,EAAAA,SAAS,MAAO,EAAkB,EAAK,KAAM,EAAM,CACrD,EAIJ,CASY,EAAmC,KAC9C,KAAA,EAAA,EAAA,mBAEkB,EAAY,CAC5B,cAAe,EAAW,IAC1B,QAAS,EAAE,CACX,QAAS,CACP,EACA,EACA,EACA,EACD,CACF,CAAC"}
|