@inlang/sdk 0.36.4 → 2.0.0-beta.2
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/README.md +1 -1
- package/dist/database/initDb.d.ts +7 -0
- package/dist/database/initDb.d.ts.map +1 -0
- package/dist/database/initDb.js +36 -0
- package/dist/database/initDb.js.map +1 -0
- package/dist/database/initDbAndSchema.test.d.ts +2 -0
- package/dist/database/initDbAndSchema.test.d.ts.map +1 -0
- package/dist/database/initDbAndSchema.test.js +110 -0
- package/dist/database/initDbAndSchema.test.js.map +1 -0
- package/dist/database/jsonbPlugin.d.ts +20 -0
- package/dist/database/jsonbPlugin.d.ts.map +1 -0
- package/dist/database/jsonbPlugin.js +183 -0
- package/dist/database/jsonbPlugin.js.map +1 -0
- package/dist/database/jsonbPlugin.test.d.ts +2 -0
- package/dist/database/jsonbPlugin.test.d.ts.map +1 -0
- package/dist/database/jsonbPlugin.test.js +119 -0
- package/dist/database/jsonbPlugin.test.js.map +1 -0
- package/dist/database/schema.d.ts +74 -0
- package/dist/database/schema.d.ts.map +1 -0
- package/dist/database/schema.js +45 -0
- package/dist/database/schema.js.map +1 -0
- package/dist/helper.d.ts +71 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/helper.js +91 -0
- package/dist/helper.js.map +1 -0
- package/dist/human-id/human-id.d.ts +3 -0
- package/dist/human-id/human-id.d.ts.map +1 -0
- package/dist/human-id/human-id.js +12 -0
- package/dist/human-id/human-id.js.map +1 -0
- package/dist/human-id/words.d.ts.map +1 -0
- package/dist/{storage/human-id → human-id}/words.js +4 -0
- package/dist/human-id/words.js.map +1 -0
- package/dist/human-id/words.test.d.ts.map +1 -0
- package/dist/{storage/human-id → human-id}/words.test.js +4 -0
- package/dist/human-id/words.test.js.map +1 -0
- package/dist/import-export/exportFiles.d.ts +11 -0
- package/dist/import-export/exportFiles.d.ts.map +1 -0
- package/dist/import-export/exportFiles.js +26 -0
- package/dist/import-export/exportFiles.js.map +1 -0
- package/dist/import-export/importFiles.d.ts +13 -0
- package/dist/import-export/importFiles.d.ts.map +1 -0
- package/dist/import-export/importFiles.js +124 -0
- package/dist/import-export/importFiles.js.map +1 -0
- package/dist/import-export/importFiles.test.d.ts +2 -0
- package/dist/import-export/importFiles.test.d.ts.map +1 -0
- package/dist/import-export/importFiles.test.js +179 -0
- package/dist/import-export/importFiles.test.js.map +1 -0
- package/dist/import-export/roundtrip.test.d.ts +2 -0
- package/dist/import-export/roundtrip.test.d.ts.map +1 -0
- package/dist/import-export/roundtrip.test.js +273 -0
- package/dist/import-export/roundtrip.test.js.map +1 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.d.ts +4 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.d.ts.map +1 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.js +58 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.js.map +1 -0
- package/dist/index.d.ts +21 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -17
- package/dist/index.js.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.d.ts +9 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.js +84 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.d.ts +2 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.js +85 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.js.map +1 -0
- package/dist/json-schema/old-v1-message/schemaV1.d.ts +86 -0
- package/dist/json-schema/old-v1-message/schemaV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/schemaV1.js +35 -0
- package/dist/json-schema/old-v1-message/schemaV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.d.ts +9 -0
- package/dist/json-schema/old-v1-message/toMessageV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.js +67 -0
- package/dist/json-schema/old-v1-message/toMessageV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.d.ts +2 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.js +85 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.js.map +1 -0
- package/dist/json-schema/pattern.d.ts +190 -0
- package/dist/json-schema/pattern.d.ts.map +1 -0
- package/dist/json-schema/pattern.js +43 -0
- package/dist/json-schema/pattern.js.map +1 -0
- package/dist/json-schema/settings.d.ts +31 -0
- package/dist/json-schema/settings.d.ts.map +1 -0
- package/dist/json-schema/settings.js +96 -0
- package/dist/json-schema/settings.js.map +1 -0
- package/dist/json-schema/settings.test-d.d.ts +2 -0
- package/dist/json-schema/settings.test-d.d.ts.map +1 -0
- package/dist/json-schema/settings.test-d.js +20 -0
- package/dist/json-schema/settings.test-d.js.map +1 -0
- package/dist/lix-plugin/applyChanges.d.ts +3 -0
- package/dist/lix-plugin/applyChanges.d.ts.map +1 -0
- package/dist/lix-plugin/applyChanges.js +127 -0
- package/dist/lix-plugin/applyChanges.js.map +1 -0
- package/dist/lix-plugin/applyChanges.test.d.ts +2 -0
- package/dist/lix-plugin/applyChanges.test.d.ts.map +1 -0
- package/dist/lix-plugin/applyChanges.test.js +135 -0
- package/dist/lix-plugin/applyChanges.test.js.map +1 -0
- package/dist/lix-plugin/detectConflicts.d.ts +3 -0
- package/dist/lix-plugin/detectConflicts.d.ts.map +1 -0
- package/dist/lix-plugin/detectConflicts.js +47 -0
- package/dist/lix-plugin/detectConflicts.js.map +1 -0
- package/dist/lix-plugin/detectConflicts.test.d.ts +2 -0
- package/dist/lix-plugin/detectConflicts.test.d.ts.map +1 -0
- package/dist/lix-plugin/detectConflicts.test.js +251 -0
- package/dist/lix-plugin/detectConflicts.test.js.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.d.ts +8 -0
- package/dist/lix-plugin/inlangLixPluginV1.d.ts.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.js +109 -0
- package/dist/lix-plugin/inlangLixPluginV1.js.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.d.ts +2 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.d.ts.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.js +418 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.js.map +1 -0
- package/dist/lix-plugin/merge.test.d.ts +2 -0
- package/dist/lix-plugin/merge.test.d.ts.map +1 -0
- package/dist/lix-plugin/merge.test.js +120 -0
- package/dist/lix-plugin/merge.test.js.map +1 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.d.ts +2 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.d.ts.map +1 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.js +176 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.js.map +1 -0
- package/dist/migrations/v2/createMessageV1.d.ts +28 -0
- package/dist/migrations/v2/createMessageV1.d.ts.map +1 -0
- package/dist/migrations/v2/createMessageV1.js +31 -0
- package/dist/migrations/v2/createMessageV1.js.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.d.ts +9 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.d.ts.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.js +31 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.js.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.d.ts +2 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.d.ts.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.js +45 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.js.map +1 -0
- package/dist/plugin/cache.d.ts +6 -0
- package/dist/plugin/cache.d.ts.map +1 -0
- package/dist/plugin/cache.js +59 -0
- package/dist/plugin/cache.js.map +1 -0
- package/dist/plugin/cache.test.d.ts +2 -0
- package/dist/plugin/cache.test.d.ts.map +1 -0
- package/dist/plugin/cache.test.js +61 -0
- package/dist/plugin/cache.test.js.map +1 -0
- package/dist/plugin/errors.d.ts +41 -0
- package/dist/plugin/errors.d.ts.map +1 -0
- package/dist/plugin/errors.js +48 -0
- package/dist/plugin/errors.js.map +1 -0
- package/dist/plugin/importPlugins.d.ts +19 -0
- package/dist/plugin/importPlugins.d.ts.map +1 -0
- package/dist/plugin/importPlugins.js +43 -0
- package/dist/plugin/importPlugins.js.map +1 -0
- package/dist/plugin/importPlugins.test.d.ts +2 -0
- package/dist/plugin/importPlugins.test.d.ts.map +1 -0
- package/dist/plugin/importPlugins.test.js +95 -0
- package/dist/plugin/importPlugins.test.js.map +1 -0
- package/dist/plugin/meta/ideExtension.d.ts +54 -0
- package/dist/plugin/meta/ideExtension.d.ts.map +1 -0
- package/dist/plugin/meta/ideExtension.js +5 -0
- package/dist/plugin/meta/ideExtension.js.map +1 -0
- package/dist/plugin/schema.d.ts +152 -0
- package/dist/plugin/schema.d.ts.map +1 -0
- package/dist/plugin/schema.js +5 -0
- package/dist/plugin/schema.js.map +1 -0
- package/dist/project/api.d.ts +74 -0
- package/dist/project/api.d.ts.map +1 -0
- package/dist/project/api.js +5 -0
- package/dist/project/api.js.map +1 -0
- package/dist/project/initHandleSaveToLixOnChange.d.ts +14 -0
- package/dist/project/initHandleSaveToLixOnChange.d.ts.map +1 -0
- package/dist/project/initHandleSaveToLixOnChange.js +87 -0
- package/dist/project/initHandleSaveToLixOnChange.js.map +1 -0
- package/dist/project/loadProject.d.ts +53 -0
- package/dist/project/loadProject.d.ts.map +1 -0
- package/dist/project/loadProject.js +168 -0
- package/dist/project/loadProject.js.map +1 -0
- package/dist/project/loadProject.test.d.ts.map +1 -0
- package/dist/project/loadProject.test.js +146 -0
- package/dist/project/loadProject.test.js.map +1 -0
- package/dist/project/loadProjectFromDirectory.d.ts +77 -0
- package/dist/project/loadProjectFromDirectory.d.ts.map +1 -0
- package/dist/project/loadProjectFromDirectory.js +584 -0
- package/dist/project/loadProjectFromDirectory.js.map +1 -0
- package/dist/project/loadProjectFromDirectory.test.d.ts +2 -0
- package/dist/project/loadProjectFromDirectory.test.d.ts.map +1 -0
- package/dist/project/loadProjectFromDirectory.test.js +663 -0
- package/dist/project/loadProjectFromDirectory.test.js.map +1 -0
- package/dist/project/loadProjectInMemory.d.ts +8 -0
- package/dist/project/loadProjectInMemory.d.ts.map +1 -0
- package/dist/project/loadProjectInMemory.js +32 -0
- package/dist/project/loadProjectInMemory.js.map +1 -0
- package/dist/project/loadProjectInMemory.test.d.ts +2 -0
- package/dist/project/loadProjectInMemory.test.d.ts.map +1 -0
- package/dist/project/loadProjectInMemory.test.js +27 -0
- package/dist/project/loadProjectInMemory.test.js.map +1 -0
- package/dist/project/maybeCaptureTelemetry.d.ts +15 -0
- package/dist/project/maybeCaptureTelemetry.d.ts.map +1 -0
- package/dist/project/maybeCaptureTelemetry.js +58 -0
- package/dist/project/maybeCaptureTelemetry.js.map +1 -0
- package/dist/project/maybeCaptureTelemetry.test.d.ts +2 -0
- package/dist/project/maybeCaptureTelemetry.test.d.ts.map +1 -0
- package/dist/project/maybeCaptureTelemetry.test.js +71 -0
- package/dist/project/maybeCaptureTelemetry.test.js.map +1 -0
- package/dist/project/newProject.d.ts +17 -0
- package/dist/project/newProject.d.ts.map +1 -0
- package/dist/project/newProject.js +71 -0
- package/dist/project/newProject.js.map +1 -0
- package/dist/project/newProject.test.d.ts +2 -0
- package/dist/project/newProject.test.d.ts.map +1 -0
- package/dist/project/newProject.test.js +37 -0
- package/dist/project/newProject.test.js.map +1 -0
- package/dist/project/saveProjectToDirectory.d.ts +8 -0
- package/dist/project/saveProjectToDirectory.d.ts.map +1 -0
- package/dist/project/saveProjectToDirectory.js +86 -0
- package/dist/project/saveProjectToDirectory.js.map +1 -0
- package/dist/project/saveProjectToDirectory.test.d.ts +2 -0
- package/dist/project/saveProjectToDirectory.test.d.ts.map +1 -0
- package/dist/project/saveProjectToDirectory.test.js +245 -0
- package/dist/project/saveProjectToDirectory.test.js.map +1 -0
- package/dist/project/state/id$.d.ts +6 -0
- package/dist/project/state/id$.d.ts.map +1 -0
- package/dist/project/state/id$.js +19 -0
- package/dist/project/state/id$.js.map +1 -0
- package/dist/project/state/id$.test.d.ts +2 -0
- package/dist/project/state/id$.test.d.ts.map +1 -0
- package/dist/project/state/id$.test.js +36 -0
- package/dist/project/state/id$.test.js.map +1 -0
- package/dist/project/state/setSettings.d.ts +7 -0
- package/dist/project/state/setSettings.d.ts.map +1 -0
- package/dist/project/state/setSettings.js +16 -0
- package/dist/project/state/setSettings.js.map +1 -0
- package/dist/project/state/setSettings.test.d.ts +2 -0
- package/dist/project/state/setSettings.test.d.ts.map +1 -0
- package/dist/project/state/setSettings.test.js +58 -0
- package/dist/project/state/setSettings.test.js.map +1 -0
- package/dist/project/state/settings$.d.ts +7 -0
- package/dist/project/state/settings$.d.ts.map +1 -0
- package/dist/project/state/settings$.js +21 -0
- package/dist/project/state/settings$.js.map +1 -0
- package/dist/project/state/settings$.test.d.ts +2 -0
- package/dist/project/state/settings$.test.d.ts.map +1 -0
- package/dist/project/state/settings$.test.js +51 -0
- package/dist/project/state/settings$.test.js.map +1 -0
- package/dist/project/state/state.d.ts +58 -0
- package/dist/project/state/state.d.ts.map +1 -0
- package/dist/project/state/state.js +67 -0
- package/dist/project/state/state.js.map +1 -0
- package/dist/project/state/state.test.d.ts +2 -0
- package/dist/project/state/state.test.d.ts.map +1 -0
- package/dist/project/state/state.test.js +103 -0
- package/dist/project/state/state.test.js.map +1 -0
- package/dist/query-utilities/index.d.ts +5 -0
- package/dist/query-utilities/index.d.ts.map +1 -0
- package/dist/query-utilities/index.js +8 -0
- package/dist/query-utilities/index.js.map +1 -0
- package/dist/query-utilities/insertBundleNested.d.ts +4 -0
- package/dist/query-utilities/insertBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/insertBundleNested.js +39 -0
- package/dist/query-utilities/insertBundleNested.js.map +1 -0
- package/dist/query-utilities/pollQuery.d.ts +14 -0
- package/dist/query-utilities/pollQuery.d.ts.map +1 -0
- package/dist/query-utilities/pollQuery.js +22 -0
- package/dist/query-utilities/pollQuery.js.map +1 -0
- package/dist/query-utilities/pollQuery.test.d.ts +2 -0
- package/dist/query-utilities/pollQuery.test.d.ts.map +1 -0
- package/dist/query-utilities/pollQuery.test.js +67 -0
- package/dist/query-utilities/pollQuery.test.js.map +1 -0
- package/dist/query-utilities/selectBundleNested.d.ts +107 -0
- package/dist/query-utilities/selectBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/selectBundleNested.js +43 -0
- package/dist/query-utilities/selectBundleNested.js.map +1 -0
- package/dist/query-utilities/updateBundleNested.d.ts +12 -0
- package/dist/query-utilities/updateBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/updateBundleNested.js +25 -0
- package/dist/query-utilities/updateBundleNested.js.map +1 -0
- package/dist/query-utilities/upsertBundleNested.d.ts +4 -0
- package/dist/query-utilities/upsertBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/upsertBundleNested.js +50 -0
- package/dist/query-utilities/upsertBundleNested.js.map +1 -0
- package/dist/services/env-variables/index.d.ts +6 -0
- package/dist/services/env-variables/index.d.ts.map +1 -0
- package/dist/services/env-variables/index.js +9 -0
- package/dist/services/env-variables/index.js.map +1 -0
- package/dist/services/error-reporting/index.d.ts +15 -0
- package/dist/services/error-reporting/index.d.ts.map +1 -0
- package/dist/services/error-reporting/index.js +30 -0
- package/dist/services/error-reporting/index.js.map +1 -0
- package/dist/{telemetry → services/telemetry}/capture.d.ts +5 -2
- package/dist/services/telemetry/capture.d.ts.map +1 -0
- package/dist/services/telemetry/capture.js +76 -0
- package/dist/services/telemetry/capture.js.map +1 -0
- package/dist/services/telemetry/capture.test.d.ts +2 -0
- package/dist/services/telemetry/capture.test.d.ts.map +1 -0
- package/dist/services/telemetry/capture.test.js +46 -0
- package/dist/services/telemetry/capture.test.js.map +1 -0
- package/dist/utilities/detectJsonFormatting.d.ts +11 -0
- package/dist/utilities/detectJsonFormatting.d.ts.map +1 -0
- package/dist/utilities/detectJsonFormatting.js +83 -0
- package/dist/utilities/detectJsonFormatting.js.map +1 -0
- package/dist/utilities/detectJsonFormatting.test.d.ts +2 -0
- package/dist/utilities/detectJsonFormatting.test.d.ts.map +1 -0
- package/dist/utilities/detectJsonFormatting.test.js +33 -0
- package/dist/utilities/detectJsonFormatting.test.js.map +1 -0
- package/package.json +32 -40
- package/src/database/initDb.ts +34 -0
- package/src/database/initDbAndSchema.test.ts +125 -0
- package/src/database/jsonbPlugin.test.ts +154 -0
- package/src/database/jsonbPlugin.ts +215 -0
- package/src/database/schema.ts +127 -0
- package/src/helper.ts +113 -0
- package/src/human-id/human-id.ts +14 -0
- package/src/{storage/human-id → human-id}/words.test.ts +14 -14
- package/src/{storage/human-id → human-id}/words.ts +4 -4
- package/src/import-export/exportFiles.ts +36 -0
- package/src/import-export/importFiles.test.ts +211 -0
- package/src/import-export/importFiles.ts +142 -0
- package/src/import-export/roundtrip.test.ts +313 -0
- package/src/import-export/upsertBundleNestedMatchByProperties.ts +74 -0
- package/src/index.ts +29 -37
- package/src/json-schema/old-v1-message/README.md +1 -0
- package/src/json-schema/old-v1-message/fromMessageV1.test.ts +87 -0
- package/src/json-schema/old-v1-message/fromMessageV1.ts +99 -0
- package/src/json-schema/old-v1-message/schemaV1.ts +66 -0
- package/src/json-schema/old-v1-message/toMessageV1.test.ts +87 -0
- package/src/json-schema/old-v1-message/toMessageV1.ts +79 -0
- package/src/json-schema/pattern.ts +59 -0
- package/src/json-schema/settings.test-d.ts +21 -0
- package/src/json-schema/settings.ts +138 -0
- package/src/lix-plugin/applyChanges.test.ts +150 -0
- package/src/lix-plugin/applyChanges.ts +171 -0
- package/src/lix-plugin/detectConflicts.test.ts +286 -0
- package/src/lix-plugin/detectConflicts.ts +62 -0
- package/src/lix-plugin/inlangLixPluginV1.test.ts +439 -0
- package/src/lix-plugin/inlangLixPluginV1.ts +132 -0
- package/src/lix-plugin/merge.test.ts +133 -0
- package/src/lix-plugin/resolveConflictBySelecting.test.ts +188 -0
- package/src/migrations/v2/createMessageV1.ts +37 -0
- package/src/migrations/v2/withLanguageTagToLocaleMigration.test.ts +51 -0
- package/src/migrations/v2/withLanguageTagToLocaleMigration.ts +31 -0
- package/src/plugin/cache.test.ts +83 -0
- package/src/plugin/cache.ts +79 -0
- package/src/plugin/errors.ts +67 -0
- package/src/plugin/importPlugins.test.ts +107 -0
- package/src/plugin/importPlugins.ts +60 -0
- package/src/plugin/meta/ideExtension.ts +56 -0
- package/src/plugin/schema.ts +165 -0
- package/src/project/api.ts +77 -0
- package/src/project/initHandleSaveToLixOnChange.ts +93 -0
- package/src/project/loadProject.test.ts +176 -0
- package/src/project/loadProject.ts +246 -0
- package/src/project/loadProjectFromDirectory.test.ts +854 -0
- package/src/project/loadProjectFromDirectory.ts +752 -0
- package/src/project/loadProjectInMemory.test.ts +29 -0
- package/src/project/loadProjectInMemory.ts +36 -0
- package/src/project/maybeCaptureTelemetry.test.ts +79 -0
- package/src/project/maybeCaptureTelemetry.ts +69 -0
- package/src/project/newProject.test.ts +36 -0
- package/src/project/newProject.ts +78 -0
- package/src/project/saveProjectToDirectory.test.ts +310 -0
- package/src/project/saveProjectToDirectory.ts +100 -0
- package/src/query-utilities/index.ts +4 -0
- package/src/query-utilities/insertBundleNested.ts +46 -0
- package/src/query-utilities/selectBundleNested.ts +46 -0
- package/src/query-utilities/updateBundleNested.ts +35 -0
- package/src/query-utilities/upsertBundleNested.ts +61 -0
- package/src/services/env-variables/createIndexFile.js +40 -0
- package/src/{env-variables → services/env-variables}/index.d.ts +8 -5
- package/src/services/error-reporting/index.ts +28 -0
- package/src/services/telemetry/capture.test.ts +50 -0
- package/src/services/telemetry/capture.ts +99 -0
- package/src/utilities/detectJsonFormatting.test.ts +38 -0
- package/src/utilities/detectJsonFormatting.ts +109 -0
- package/dist/adapter/solidAdapter.d.ts +0 -33
- package/dist/adapter/solidAdapter.d.ts.map +0 -1
- package/dist/adapter/solidAdapter.js +0 -40
- package/dist/adapter/solidAdapter.test.d.ts +0 -2
- package/dist/adapter/solidAdapter.test.d.ts.map +0 -1
- package/dist/adapter/solidAdapter.test.js +0 -356
- package/dist/api.d.ts +0 -113
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -1
- package/dist/api.test-d.d.ts +0 -2
- package/dist/api.test-d.d.ts.map +0 -1
- package/dist/api.test-d.js +0 -4
- package/dist/createMessageLintReportsQuery.d.ts +0 -12
- package/dist/createMessageLintReportsQuery.d.ts.map +0 -1
- package/dist/createMessageLintReportsQuery.js +0 -176
- package/dist/createMessagesQuery.d.ts +0 -19
- package/dist/createMessagesQuery.d.ts.map +0 -1
- package/dist/createMessagesQuery.js +0 -451
- package/dist/createMessagesQuery.test.d.ts +0 -2
- package/dist/createMessagesQuery.test.d.ts.map +0 -1
- package/dist/createMessagesQuery.test.js +0 -402
- package/dist/createNewProject.d.ts +0 -12
- package/dist/createNewProject.d.ts.map +0 -1
- package/dist/createNewProject.js +0 -38
- package/dist/createNewProject.test.d.ts +0 -2
- package/dist/createNewProject.test.d.ts.map +0 -1
- package/dist/createNewProject.test.js +0 -91
- package/dist/createNodeishFsWithAbsolutePaths.d.ts +0 -12
- package/dist/createNodeishFsWithAbsolutePaths.d.ts.map +0 -1
- package/dist/createNodeishFsWithAbsolutePaths.js +0 -38
- package/dist/createNodeishFsWithAbsolutePaths.test.d.ts +0 -2
- package/dist/createNodeishFsWithAbsolutePaths.test.d.ts.map +0 -1
- package/dist/createNodeishFsWithAbsolutePaths.test.js +0 -44
- package/dist/createNodeishFsWithWatcher.d.ts +0 -14
- package/dist/createNodeishFsWithWatcher.d.ts.map +0 -1
- package/dist/createNodeishFsWithWatcher.js +0 -75
- package/dist/createNodeishFsWithWatcher.test.d.ts +0 -2
- package/dist/createNodeishFsWithWatcher.test.d.ts.map +0 -1
- package/dist/createNodeishFsWithWatcher.test.js +0 -38
- package/dist/defaultProjectSettings.d.ts +0 -14
- package/dist/defaultProjectSettings.d.ts.map +0 -1
- package/dist/defaultProjectSettings.js +0 -22
- package/dist/env-variables/index.d.ts +0 -4
- package/dist/env-variables/index.d.ts.map +0 -1
- package/dist/env-variables/index.js +0 -3
- package/dist/errors.d.ts +0 -48
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -62
- package/dist/lint/index.d.ts +0 -3
- package/dist/lint/index.d.ts.map +0 -1
- package/dist/lint/index.js +0 -2
- package/dist/lint/message/errors.d.ts +0 -7
- package/dist/lint/message/errors.d.ts.map +0 -1
- package/dist/lint/message/errors.js +0 -9
- package/dist/lint/message/lintMessages.d.ts +0 -13
- package/dist/lint/message/lintMessages.d.ts.map +0 -1
- package/dist/lint/message/lintMessages.js +0 -12
- package/dist/lint/message/lintMessages.test.d.ts +0 -2
- package/dist/lint/message/lintMessages.test.d.ts.map +0 -1
- package/dist/lint/message/lintMessages.test.js +0 -107
- package/dist/lint/message/lintSingleMessage.d.ts +0 -19
- package/dist/lint/message/lintSingleMessage.d.ts.map +0 -1
- package/dist/lint/message/lintSingleMessage.js +0 -38
- package/dist/lint/message/lintSingleMessage.test.d.ts +0 -2
- package/dist/lint/message/lintSingleMessage.test.d.ts.map +0 -1
- package/dist/lint/message/lintSingleMessage.test.js +0 -161
- package/dist/listProjects.d.ts +0 -5
- package/dist/listProjects.d.ts.map +0 -1
- package/dist/listProjects.js +0 -38
- package/dist/listProjects.test.d.ts +0 -2
- package/dist/listProjects.test.d.ts.map +0 -1
- package/dist/listProjects.test.js +0 -72
- package/dist/loadProject.d.ts +0 -19
- package/dist/loadProject.d.ts.map +0 -1
- package/dist/loadProject.js +0 -343
- package/dist/loadProject.test.d.ts.map +0 -1
- package/dist/loadProject.test.js +0 -975
- package/dist/messages/errors.d.ts +0 -13
- package/dist/messages/errors.d.ts.map +0 -1
- package/dist/messages/errors.js +0 -18
- package/dist/messages/index.d.ts +0 -3
- package/dist/messages/index.d.ts.map +0 -1
- package/dist/messages/index.js +0 -2
- package/dist/messages/variant.d.ts +0 -46
- package/dist/messages/variant.d.ts.map +0 -1
- package/dist/messages/variant.js +0 -176
- package/dist/messages/variant.test.d.ts +0 -2
- package/dist/messages/variant.test.d.ts.map +0 -1
- package/dist/messages/variant.test.js +0 -439
- package/dist/migrations/maybeAddModuleCache.d.ts +0 -6
- package/dist/migrations/maybeAddModuleCache.d.ts.map +0 -1
- package/dist/migrations/maybeAddModuleCache.js +0 -62
- package/dist/migrations/maybeCreateFirstProjectId.d.ts +0 -16
- package/dist/migrations/maybeCreateFirstProjectId.d.ts.map +0 -1
- package/dist/migrations/maybeCreateFirstProjectId.js +0 -46
- package/dist/migrations/maybeCreateFirstProjectId.test.d.ts +0 -2
- package/dist/migrations/maybeCreateFirstProjectId.test.d.ts.map +0 -1
- package/dist/migrations/maybeCreateFirstProjectId.test.js +0 -24
- package/dist/migrations/migrateToDirectory.d.ts +0 -10
- package/dist/migrations/migrateToDirectory.d.ts.map +0 -1
- package/dist/migrations/migrateToDirectory.js +0 -48
- package/dist/migrations/migrateToDirectory.test.d.ts +0 -2
- package/dist/migrations/migrateToDirectory.test.d.ts.map +0 -1
- package/dist/migrations/migrateToDirectory.test.js +0 -48
- package/dist/parseConfig.d.ts +0 -8
- package/dist/parseConfig.d.ts.map +0 -1
- package/dist/parseConfig.js +0 -26
- package/dist/persistence/batchedIO.d.ts +0 -11
- package/dist/persistence/batchedIO.d.ts.map +0 -1
- package/dist/persistence/batchedIO.js +0 -49
- package/dist/persistence/batchedIO.test.d.ts +0 -2
- package/dist/persistence/batchedIO.test.d.ts.map +0 -1
- package/dist/persistence/batchedIO.test.js +0 -56
- package/dist/persistence/filelock/acquireFileLock.d.ts +0 -3
- package/dist/persistence/filelock/acquireFileLock.d.ts.map +0 -1
- package/dist/persistence/filelock/acquireFileLock.js +0 -111
- package/dist/persistence/filelock/releaseLock.d.ts +0 -3
- package/dist/persistence/filelock/releaseLock.d.ts.map +0 -1
- package/dist/persistence/filelock/releaseLock.js +0 -24
- package/dist/persistence/store.d.ts +0 -107
- package/dist/persistence/store.d.ts.map +0 -1
- package/dist/persistence/store.js +0 -99
- package/dist/persistence/store.test.d.ts +0 -2
- package/dist/persistence/store.test.d.ts.map +0 -1
- package/dist/persistence/store.test.js +0 -79
- package/dist/persistence/storeApi.d.ts +0 -22
- package/dist/persistence/storeApi.d.ts.map +0 -1
- package/dist/persistence/storeApi.js +0 -1
- package/dist/reactivity/map.d.ts +0 -67
- package/dist/reactivity/map.d.ts.map +0 -1
- package/dist/reactivity/map.js +0 -143
- package/dist/reactivity/solid.d.ts +0 -14
- package/dist/reactivity/solid.d.ts.map +0 -1
- package/dist/reactivity/solid.js +0 -15
- package/dist/reactivity/solid.test.d.ts +0 -2
- package/dist/reactivity/solid.test.d.ts.map +0 -1
- package/dist/reactivity/solid.test.js +0 -189
- package/dist/reactivity/trigger.d.ts +0 -11
- package/dist/reactivity/trigger.d.ts.map +0 -1
- package/dist/reactivity/trigger.js +0 -46
- package/dist/resolve-modules/cache.d.ts +0 -6
- package/dist/resolve-modules/cache.d.ts.map +0 -1
- package/dist/resolve-modules/cache.js +0 -58
- package/dist/resolve-modules/errors.d.ts +0 -41
- package/dist/resolve-modules/errors.d.ts.map +0 -1
- package/dist/resolve-modules/errors.js +0 -45
- package/dist/resolve-modules/import.d.ts +0 -19
- package/dist/resolve-modules/import.d.ts.map +0 -1
- package/dist/resolve-modules/import.js +0 -102
- package/dist/resolve-modules/import.test.d.ts +0 -2
- package/dist/resolve-modules/import.test.d.ts.map +0 -1
- package/dist/resolve-modules/import.test.js +0 -47
- package/dist/resolve-modules/index.d.ts +0 -3
- package/dist/resolve-modules/index.d.ts.map +0 -1
- package/dist/resolve-modules/index.js +0 -2
- package/dist/resolve-modules/message-lint-rules/errors.d.ts +0 -9
- package/dist/resolve-modules/message-lint-rules/errors.d.ts.map +0 -1
- package/dist/resolve-modules/message-lint-rules/errors.js +0 -6
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.d.ts +0 -9
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.d.ts.map +0 -1
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.js +0 -24
- package/dist/resolve-modules/plugins/errors.d.ts +0 -33
- package/dist/resolve-modules/plugins/errors.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/errors.js +0 -38
- package/dist/resolve-modules/plugins/resolvePlugins.d.ts +0 -3
- package/dist/resolve-modules/plugins/resolvePlugins.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/resolvePlugins.js +0 -92
- package/dist/resolve-modules/plugins/resolvePlugins.test.d.ts +0 -2
- package/dist/resolve-modules/plugins/resolvePlugins.test.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/resolvePlugins.test.js +0 -252
- package/dist/resolve-modules/plugins/types.d.ts +0 -57
- package/dist/resolve-modules/plugins/types.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/types.js +0 -1
- package/dist/resolve-modules/plugins/types.test.d.ts +0 -2
- package/dist/resolve-modules/plugins/types.test.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/types.test.js +0 -45
- package/dist/resolve-modules/resolveModules.d.ts +0 -3
- package/dist/resolve-modules/resolveModules.d.ts.map +0 -1
- package/dist/resolve-modules/resolveModules.js +0 -80
- package/dist/resolve-modules/resolveModules.test.d.ts +0 -2
- package/dist/resolve-modules/resolveModules.test.d.ts.map +0 -1
- package/dist/resolve-modules/resolveModules.test.js +0 -185
- package/dist/resolve-modules/types.d.ts +0 -63
- package/dist/resolve-modules/types.d.ts.map +0 -1
- package/dist/resolve-modules/types.js +0 -1
- package/dist/resolve-modules/validateModuleSettings.test.d.ts +0 -2
- package/dist/resolve-modules/validateModuleSettings.test.d.ts.map +0 -1
- package/dist/resolve-modules/validateModuleSettings.test.js +0 -71
- package/dist/resolve-modules/validatedModuleSettings.d.ts +0 -7
- package/dist/resolve-modules/validatedModuleSettings.d.ts.map +0 -1
- package/dist/resolve-modules/validatedModuleSettings.js +0 -11
- package/dist/storage/helper.d.ts +0 -11
- package/dist/storage/helper.d.ts.map +0 -1
- package/dist/storage/helper.js +0 -63
- package/dist/storage/helpers.test.d.ts +0 -2
- package/dist/storage/helpers.test.d.ts.map +0 -1
- package/dist/storage/helpers.test.js +0 -84
- package/dist/storage/human-id/human-readable-id.d.ts +0 -3
- package/dist/storage/human-id/human-readable-id.d.ts.map +0 -1
- package/dist/storage/human-id/human-readable-id.js +0 -20
- package/dist/storage/human-id/words.d.ts.map +0 -1
- package/dist/storage/human-id/words.test.d.ts.map +0 -1
- package/dist/telemetry/capture.d.ts.map +0 -1
- package/dist/telemetry/capture.js +0 -39
- package/dist/telemetry/groupIdentify.d.ts +0 -13
- package/dist/telemetry/groupIdentify.d.ts.map +0 -1
- package/dist/telemetry/groupIdentify.js +0 -35
- package/dist/test-utilities/createMessage.d.ts +0 -18
- package/dist/test-utilities/createMessage.d.ts.map +0 -1
- package/dist/test-utilities/createMessage.js +0 -17
- package/dist/test-utilities/createMessage.test.d.ts +0 -2
- package/dist/test-utilities/createMessage.test.d.ts.map +0 -1
- package/dist/test-utilities/createMessage.test.js +0 -106
- package/dist/test-utilities/index.d.ts +0 -3
- package/dist/test-utilities/index.d.ts.map +0 -1
- package/dist/test-utilities/index.js +0 -2
- package/dist/test-utilities/sleep.d.ts +0 -4
- package/dist/test-utilities/sleep.d.ts.map +0 -1
- package/dist/test-utilities/sleep.js +0 -9
- package/dist/v2/helper.d.ts +0 -43
- package/dist/v2/helper.d.ts.map +0 -1
- package/dist/v2/helper.js +0 -75
- package/dist/v2/helper.test.d.ts +0 -2
- package/dist/v2/helper.test.d.ts.map +0 -1
- package/dist/v2/helper.test.js +0 -92
- package/dist/v2/index.d.ts +0 -4
- package/dist/v2/index.d.ts.map +0 -1
- package/dist/v2/index.js +0 -2
- package/dist/v2/mocks/index.d.ts +0 -3
- package/dist/v2/mocks/index.d.ts.map +0 -1
- package/dist/v2/mocks/index.js +0 -2
- package/dist/v2/mocks/multipleMatcher/bundle.d.ts +0 -3
- package/dist/v2/mocks/multipleMatcher/bundle.d.ts.map +0 -1
- package/dist/v2/mocks/multipleMatcher/bundle.js +0 -194
- package/dist/v2/mocks/multipleMatcher/bundle.test.d.ts +0 -2
- package/dist/v2/mocks/multipleMatcher/bundle.test.d.ts.map +0 -1
- package/dist/v2/mocks/multipleMatcher/bundle.test.js +0 -10
- package/dist/v2/mocks/plural/bundle.d.ts +0 -3
- package/dist/v2/mocks/plural/bundle.d.ts.map +0 -1
- package/dist/v2/mocks/plural/bundle.js +0 -162
- package/dist/v2/mocks/plural/bundle.test.d.ts +0 -2
- package/dist/v2/mocks/plural/bundle.test.d.ts.map +0 -1
- package/dist/v2/mocks/plural/bundle.test.js +0 -15
- package/dist/v2/shim.d.ts +0 -12
- package/dist/v2/shim.d.ts.map +0 -1
- package/dist/v2/shim.js +0 -151
- package/dist/v2/shim.test.d.ts +0 -2
- package/dist/v2/shim.test.d.ts.map +0 -1
- package/dist/v2/shim.test.js +0 -49
- package/dist/v2/stubQueryApi.d.ts +0 -9
- package/dist/v2/stubQueryApi.d.ts.map +0 -1
- package/dist/v2/stubQueryApi.js +0 -38
- package/dist/v2/types.d.ts +0 -521
- package/dist/v2/types.d.ts.map +0 -1
- package/dist/v2/types.js +0 -78
- package/dist/validateProjectPath.d.ts +0 -17
- package/dist/validateProjectPath.d.ts.map +0 -1
- package/dist/validateProjectPath.js +0 -31
- package/dist/validateProjectPath.test.d.ts +0 -2
- package/dist/validateProjectPath.test.d.ts.map +0 -1
- package/dist/validateProjectPath.test.js +0 -40
- package/dist/versionedInterfaces.d.ts +0 -8
- package/dist/versionedInterfaces.d.ts.map +0 -1
- package/dist/versionedInterfaces.js +0 -8
- package/src/adapter/solidAdapter.test.ts +0 -472
- package/src/adapter/solidAdapter.ts +0 -79
- package/src/api.test-d.ts +0 -8
- package/src/api.ts +0 -116
- package/src/createMessageLintReportsQuery.ts +0 -225
- package/src/createMessagesQuery.test.ts +0 -538
- package/src/createMessagesQuery.ts +0 -635
- package/src/createNewProject.test.ts +0 -105
- package/src/createNewProject.ts +0 -46
- package/src/createNodeishFsWithAbsolutePaths.test.ts +0 -55
- package/src/createNodeishFsWithAbsolutePaths.ts +0 -52
- package/src/createNodeishFsWithWatcher.test.ts +0 -50
- package/src/createNodeishFsWithWatcher.ts +0 -85
- package/src/defaultProjectSettings.ts +0 -26
- package/src/env-variables/.prettierignore +0 -1
- package/src/env-variables/createIndexFile.js +0 -28
- package/src/errors.ts +0 -84
- package/src/lint/index.ts +0 -2
- package/src/lint/message/errors.ts +0 -9
- package/src/lint/message/lintMessages.test.ts +0 -126
- package/src/lint/message/lintMessages.ts +0 -25
- package/src/lint/message/lintSingleMessage.test.ts +0 -191
- package/src/lint/message/lintSingleMessage.ts +0 -57
- package/src/listProjects.test.ts +0 -91
- package/src/listProjects.ts +0 -48
- package/src/loadProject.test.ts +0 -1173
- package/src/loadProject.ts +0 -460
- package/src/messages/errors.ts +0 -25
- package/src/messages/index.ts +0 -2
- package/src/messages/variant.test.ts +0 -511
- package/src/messages/variant.ts +0 -247
- package/src/migrations/maybeAddModuleCache.ts +0 -68
- package/src/migrations/maybeCreateFirstProjectId.test.ts +0 -31
- package/src/migrations/maybeCreateFirstProjectId.ts +0 -51
- package/src/migrations/migrateToDirectory.test.ts +0 -54
- package/src/migrations/migrateToDirectory.ts +0 -62
- package/src/parseConfig.ts +0 -35
- package/src/persistence/batchedIO.test.ts +0 -63
- package/src/persistence/batchedIO.ts +0 -64
- package/src/persistence/filelock/acquireFileLock.ts +0 -129
- package/src/persistence/filelock/releaseLock.ts +0 -29
- package/src/persistence/store.test.ts +0 -102
- package/src/persistence/store.ts +0 -119
- package/src/persistence/storeApi.ts +0 -19
- package/src/reactivity/map.ts +0 -135
- package/src/reactivity/solid.test.ts +0 -222
- package/src/reactivity/solid.ts +0 -42
- package/src/reactivity/trigger.ts +0 -46
- package/src/resolve-modules/cache.ts +0 -89
- package/src/resolve-modules/errors.ts +0 -69
- package/src/resolve-modules/import.test.ts +0 -62
- package/src/resolve-modules/import.ts +0 -133
- package/src/resolve-modules/index.ts +0 -2
- package/src/resolve-modules/message-lint-rules/errors.ts +0 -9
- package/src/resolve-modules/message-lint-rules/resolveMessageLintRules.ts +0 -27
- package/src/resolve-modules/plugins/errors.ts +0 -56
- package/src/resolve-modules/plugins/resolvePlugins.test.ts +0 -301
- package/src/resolve-modules/plugins/resolvePlugins.ts +0 -129
- package/src/resolve-modules/plugins/types.test.ts +0 -53
- package/src/resolve-modules/plugins/types.ts +0 -76
- package/src/resolve-modules/resolveModules.test.ts +0 -224
- package/src/resolve-modules/resolveModules.ts +0 -113
- package/src/resolve-modules/types.ts +0 -72
- package/src/resolve-modules/validateModuleSettings.test.ts +0 -85
- package/src/resolve-modules/validatedModuleSettings.ts +0 -19
- package/src/storage/helper.ts +0 -74
- package/src/storage/helpers.test.ts +0 -95
- package/src/storage/human-id/human-readable-id.ts +0 -27
- package/src/telemetry/capture.ts +0 -49
- package/src/telemetry/groupIdentify.ts +0 -41
- package/src/test-utilities/createMessage.test.ts +0 -118
- package/src/test-utilities/createMessage.ts +0 -21
- package/src/test-utilities/index.ts +0 -2
- package/src/test-utilities/sleep.ts +0 -11
- package/src/v2/helper.test.ts +0 -95
- package/src/v2/helper.ts +0 -98
- package/src/v2/index.ts +0 -3
- package/src/v2/mocks/index.ts +0 -2
- package/src/v2/mocks/multipleMatcher/bundle.test.ts +0 -11
- package/src/v2/mocks/multipleMatcher/bundle.ts +0 -196
- package/src/v2/mocks/plural/bundle.test.ts +0 -18
- package/src/v2/mocks/plural/bundle.ts +0 -164
- package/src/v2/shim.test.ts +0 -56
- package/src/v2/shim.ts +0 -173
- package/src/v2/stubQueryApi.ts +0 -43
- package/src/v2/types.ts +0 -159
- package/src/validateProjectPath.test.ts +0 -50
- package/src/validateProjectPath.ts +0 -38
- package/src/versionedInterfaces.ts +0 -9
- /package/dist/{storage/human-id → human-id}/words.d.ts +0 -0
- /package/dist/{storage/human-id → human-id}/words.test.d.ts +0 -0
- /package/dist/{loadProject.test.d.ts → project/loadProject.test.d.ts} +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { ProjectSettings } from "@inlang/project-settings";
|
|
2
|
-
import type { MessageLintRule } from "@inlang/message-lint-rule";
|
|
3
|
-
import type { Plugin } from "@inlang/plugin";
|
|
4
|
-
import type { NodeishFilesystemSubset, ResolvePluginsFunction, ResolvedPluginApi } from "./plugins/types.js";
|
|
5
|
-
import type { ModuleHasNoExportsError, ModuleImportError } from "./errors.js";
|
|
6
|
-
import type { ImportFunction } from "./import.js";
|
|
7
|
-
import type { resolveMessageLintRules } from "./message-lint-rules/resolveMessageLintRules.js";
|
|
8
|
-
/**
|
|
9
|
-
* Function that resolves modules from the config.
|
|
10
|
-
*
|
|
11
|
-
* Pass a custom `_import` function to override the default import function.
|
|
12
|
-
*/
|
|
13
|
-
export type ResolveModuleFunction = (args: {
|
|
14
|
-
projectPath: string;
|
|
15
|
-
settings: ProjectSettings;
|
|
16
|
-
nodeishFs: NodeishFilesystemSubset;
|
|
17
|
-
_import?: ImportFunction;
|
|
18
|
-
}) => Promise<{
|
|
19
|
-
/**
|
|
20
|
-
* Metadata about the resolved module.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* [{
|
|
24
|
-
* id: "plugin.inlang.json",
|
|
25
|
-
* module: "https://myplugin.com/index.js"
|
|
26
|
-
* }]
|
|
27
|
-
*/
|
|
28
|
-
meta: Array<{
|
|
29
|
-
/**
|
|
30
|
-
* The module link.
|
|
31
|
-
*
|
|
32
|
-
* @example "https://myplugin.com/index.js"
|
|
33
|
-
*/
|
|
34
|
-
module: string;
|
|
35
|
-
/**
|
|
36
|
-
* The resolved item id of the module.
|
|
37
|
-
*/
|
|
38
|
-
id: Plugin["id"] | MessageLintRule["id"];
|
|
39
|
-
}>;
|
|
40
|
-
/**
|
|
41
|
-
* The resolved plugins.
|
|
42
|
-
*/
|
|
43
|
-
plugins: Array<Plugin>;
|
|
44
|
-
/**
|
|
45
|
-
* The resolved message lint rules.
|
|
46
|
-
*/
|
|
47
|
-
messageLintRules: Array<MessageLintRule>;
|
|
48
|
-
/**
|
|
49
|
-
* The resolved api provided by plugins.
|
|
50
|
-
*/
|
|
51
|
-
resolvedPluginApi: ResolvedPluginApi;
|
|
52
|
-
/**
|
|
53
|
-
* Errors during the resolution process.
|
|
54
|
-
*
|
|
55
|
-
* This includes errors from:
|
|
56
|
-
* - importing module
|
|
57
|
-
* - resolving plugins
|
|
58
|
-
* - resolving lint rules
|
|
59
|
-
* - resolving the runtime plugin api
|
|
60
|
-
*/
|
|
61
|
-
errors: Array<ModuleHasNoExportsError | ModuleImportError | Awaited<ReturnType<ResolvePluginsFunction>>["errors"][number] | Awaited<ReturnType<typeof resolveMessageLintRules>>["errors"][number]>;
|
|
62
|
-
}>;
|
|
63
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolve-modules/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAA;AAE9F;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,uBAAuB,CAAA;IAClC,OAAO,CAAC,EAAE,cAAc,CAAA;CACxB,KAAK,OAAO,CAAC;IACb;;;;;;;;OAQG;IACH,IAAI,EAAE,KAAK,CAAC;QACX;;;;WAIG;QACH,MAAM,EAAE,MAAM,CAAA;QACd;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;KACxC,CAAC,CAAA;IACF;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACtB;;OAEG;IACH,gBAAgB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACxC;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAA;IACpC;;;;;;;;OAQG;IACH,MAAM,EAAE,KAAK,CACV,uBAAuB,GACvB,iBAAiB,GACjB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CACvE,CAAA;CACD,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateModuleSettings.test.d.ts","sourceRoot":"","sources":["../../src/resolve-modules/validateModuleSettings.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
-
import { expect, test } from "vitest";
|
|
3
|
-
import { Plugin, MessageLintRule } from "../index.js";
|
|
4
|
-
// import { createNodeishMemoryFs } from "@lix-js/fs"
|
|
5
|
-
import { Type } from "@sinclair/typebox";
|
|
6
|
-
import { validatedModuleSettings } from "./validatedModuleSettings.js";
|
|
7
|
-
const mockPluginSchema = Type.Object({
|
|
8
|
-
pathPattern: Type.Union([
|
|
9
|
-
Type.String({
|
|
10
|
-
pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json",
|
|
11
|
-
description: "The pathPattern must contain `{languageTag}` and end with `.json`.",
|
|
12
|
-
}),
|
|
13
|
-
Type.Record(Type.String({
|
|
14
|
-
pattern: "^[^.]+$",
|
|
15
|
-
description: "Dots are not allowd ",
|
|
16
|
-
examples: ["website", "app", "homepage"],
|
|
17
|
-
}), Type.String({
|
|
18
|
-
pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json",
|
|
19
|
-
description: "The pathPattern must contain `{languageTag}` and end with `.json`.",
|
|
20
|
-
})),
|
|
21
|
-
]),
|
|
22
|
-
variableReferencePattern: Type.Array(Type.String()),
|
|
23
|
-
});
|
|
24
|
-
const mockMessageLintRuleSchema = Type.Object({
|
|
25
|
-
ignore: Type.Array(Type.String({
|
|
26
|
-
pattern: '([^"]*)',
|
|
27
|
-
description: "All items in the array need quotaion marks at the end and beginning",
|
|
28
|
-
})),
|
|
29
|
-
});
|
|
30
|
-
test("if PluginSchema does match with the moduleSettings", async () => {
|
|
31
|
-
const isValid = await validatedModuleSettings({
|
|
32
|
-
settingsSchema: mockPluginSchema,
|
|
33
|
-
moduleSettings: {
|
|
34
|
-
pathPattern: "./examples/example01/{languageTag}.json",
|
|
35
|
-
variableReferencePattern: ["{", "}"],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
expect(isValid).toBe("isValid");
|
|
39
|
-
});
|
|
40
|
-
test("if namespace settings are valide", async () => {
|
|
41
|
-
const isValid = validatedModuleSettings({
|
|
42
|
-
settingsSchema: mockPluginSchema,
|
|
43
|
-
moduleSettings: {
|
|
44
|
-
pathPattern: {
|
|
45
|
-
website: "./{languageTag}examplerFolder/ExampleFile.json",
|
|
46
|
-
app: "../{languageTag}examplerFolder/ExampleFile.json",
|
|
47
|
-
footer: "./{languageTag}examplerFolder/ExampleFile.json",
|
|
48
|
-
},
|
|
49
|
-
variableReferencePattern: ["{", "}"],
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
expect(isValid).toBe("isValid");
|
|
53
|
-
});
|
|
54
|
-
test(" if MessageLintRuleSchema match with the settings", async () => {
|
|
55
|
-
const isValid = await validatedModuleSettings({
|
|
56
|
-
settingsSchema: mockMessageLintRuleSchema,
|
|
57
|
-
moduleSettings: {
|
|
58
|
-
ignore: ["example", "warning"],
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
expect(isValid).toBe("isValid");
|
|
62
|
-
});
|
|
63
|
-
test("if messageLintRule settings are not matching to the settingsSchema would pass ", async () => {
|
|
64
|
-
const isValid = validatedModuleSettings({
|
|
65
|
-
settingsSchema: mockMessageLintRuleSchema,
|
|
66
|
-
moduleSettings: {
|
|
67
|
-
ignore: "example",
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
expect(isValid).not.toBe("isValid");
|
|
71
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { InlangModule } from "@inlang/module";
|
|
2
|
-
import { type ValueError } from "@sinclair/typebox/value";
|
|
3
|
-
export declare const validatedModuleSettings: (args: {
|
|
4
|
-
settingsSchema: InlangModule["default"]["settingsSchema"];
|
|
5
|
-
moduleSettings: unknown;
|
|
6
|
-
}) => "isValid" | ValueError[];
|
|
7
|
-
//# sourceMappingURL=validatedModuleSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validatedModuleSettings.d.ts","sourceRoot":"","sources":["../../src/resolve-modules/validatedModuleSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,eAAO,MAAM,uBAAuB,SAAU;IAC7C,cAAc,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAA;IACzD,cAAc,EAAE,OAAO,CAAA;CACvB,KAAG,SAAS,GAAG,UAAU,EAWzB,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Value } from "@sinclair/typebox/value";
|
|
2
|
-
export const validatedModuleSettings = (args) => {
|
|
3
|
-
if (args.settingsSchema && args.moduleSettings) {
|
|
4
|
-
const hasValidSettings = Value.Check(args.settingsSchema, args.moduleSettings);
|
|
5
|
-
if (hasValidSettings === false) {
|
|
6
|
-
const errors = [...Value.Errors(args.settingsSchema, args.moduleSettings)];
|
|
7
|
-
return errors;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return "isValid";
|
|
11
|
-
};
|
package/dist/storage/helper.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Message } from "../versionedInterfaces.js";
|
|
2
|
-
export declare function getMessageIdFromPath(path: string): string | undefined;
|
|
3
|
-
export declare function getPathFromMessageId(id: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Returns a copy of a message object with sorted variants and object keys.
|
|
6
|
-
* This produces a deterministic result when passed to stringify
|
|
7
|
-
* independent of the initialization order.
|
|
8
|
-
*/
|
|
9
|
-
export declare function normalizeMessage(message: Message): Message;
|
|
10
|
-
export declare function stringifyMessage(message: Message): string;
|
|
11
|
-
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/storage/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,2BAA2B,CAAA;AAI5D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,sBAahD;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,UAG9C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAuChB,OAAO,CACvC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,UAEhD"}
|
package/dist/storage/helper.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Message, Variant } from "../versionedInterfaces.js";
|
|
2
|
-
const fileExtension = ".json";
|
|
3
|
-
export function getMessageIdFromPath(path) {
|
|
4
|
-
if (!path.endsWith(fileExtension)) {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
const cleanedPath = path.replace(/\/$/, ""); // This regex matches a trailing slash and replaces it with an empty string
|
|
8
|
-
const messageFileName = cleanedPath.split("/").join("_"); // we split by the first leading namespace or _ separator - make sure slashes don't exit in the id
|
|
9
|
-
// const messageFileName = pathParts.at(-1)!
|
|
10
|
-
const lastDotIndex = messageFileName.lastIndexOf(".");
|
|
11
|
-
// Extract until the last dot (excluding the dot)
|
|
12
|
-
return messageFileName.slice(0, Math.max(0, lastDotIndex));
|
|
13
|
-
}
|
|
14
|
-
export function getPathFromMessageId(id) {
|
|
15
|
-
const path = id.replace("_", "/") + fileExtension;
|
|
16
|
-
return path;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Returns a copy of a message object with sorted variants and object keys.
|
|
20
|
-
* This produces a deterministic result when passed to stringify
|
|
21
|
-
* independent of the initialization order.
|
|
22
|
-
*/
|
|
23
|
-
export function normalizeMessage(message) {
|
|
24
|
-
// order keys in message
|
|
25
|
-
const messageWithSortedKeys = {};
|
|
26
|
-
for (const key of Object.keys(message).sort()) {
|
|
27
|
-
messageWithSortedKeys[key] = message[key];
|
|
28
|
-
}
|
|
29
|
-
// order variants
|
|
30
|
-
messageWithSortedKeys["variants"] = messageWithSortedKeys["variants"]
|
|
31
|
-
.sort((variantA, variantB) => {
|
|
32
|
-
// compare by language
|
|
33
|
-
const languageComparison = variantA.languageTag.localeCompare(variantB.languageTag);
|
|
34
|
-
// if languages are the same, compare by match
|
|
35
|
-
if (languageComparison === 0) {
|
|
36
|
-
return variantA.match.join("-").localeCompare(variantB.match.join("-"));
|
|
37
|
-
}
|
|
38
|
-
return languageComparison;
|
|
39
|
-
})
|
|
40
|
-
// order keys in each variant
|
|
41
|
-
.map((variant) => {
|
|
42
|
-
const variantWithSortedKeys = {};
|
|
43
|
-
for (const variantKey of Object.keys(variant).sort()) {
|
|
44
|
-
if (variantKey === "pattern") {
|
|
45
|
-
variantWithSortedKeys[variantKey] = variant["pattern"].map((token) => {
|
|
46
|
-
const tokenWithSortedKey = {};
|
|
47
|
-
for (const tokenKey of Object.keys(token).sort()) {
|
|
48
|
-
tokenWithSortedKey[tokenKey] = token[tokenKey];
|
|
49
|
-
}
|
|
50
|
-
return tokenWithSortedKey;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
variantWithSortedKeys[variantKey] = variant[variantKey];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return variantWithSortedKeys;
|
|
58
|
-
});
|
|
59
|
-
return messageWithSortedKeys;
|
|
60
|
-
}
|
|
61
|
-
export function stringifyMessage(message) {
|
|
62
|
-
return JSON.stringify(normalizeMessage(message), undefined, 4);
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.test.d.ts","sourceRoot":"","sources":["../../src/storage/helpers.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
// import { parseLixUri, parseOrigin } from "./helpers.js"
|
|
3
|
-
import { normalizeMessage, stringifyMessage } from "./helper.js";
|
|
4
|
-
const unsortedMessageRaw = {
|
|
5
|
-
alias: {},
|
|
6
|
-
selectors: [],
|
|
7
|
-
id: "footer_categories_apps",
|
|
8
|
-
variants: [
|
|
9
|
-
{ languageTag: "a", match: ["*", "1"], pattern: [{ type: "Text", value: "2" }] },
|
|
10
|
-
{ languageTag: "a", match: ["*", "*"], pattern: [{ type: "Text", value: "1" }] },
|
|
11
|
-
{
|
|
12
|
-
languageTag: "a",
|
|
13
|
-
match: ["1", "*"],
|
|
14
|
-
pattern: [
|
|
15
|
-
{ type: "Text", value: "2" },
|
|
16
|
-
{ type: "Text", value: "2" },
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
{ languageTag: "b", match: [], pattern: [{ type: "Text", value: "4" }] },
|
|
20
|
-
{ languageTag: "a", match: ["1", "1"], pattern: [{ type: "Text", value: "2" }] },
|
|
21
|
-
{ languageTag: "c", match: [], pattern: [{ value: "5", type: "Text" }] },
|
|
22
|
-
{ match: [], languageTag: "d", pattern: [{ type: "Text", value: "6" }] },
|
|
23
|
-
{ languageTag: "e", match: [], pattern: [{ type: "Text", value: "7" }] },
|
|
24
|
-
{ languageTag: "f", match: [], pattern: [{ type: "Text", value: "8" }] },
|
|
25
|
-
{ languageTag: "g", match: [], pattern: [{ type: "Text", value: "9" }] },
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
const sortedMessageRaw = {
|
|
29
|
-
alias: {},
|
|
30
|
-
id: "footer_categories_apps",
|
|
31
|
-
selectors: [],
|
|
32
|
-
variants: [
|
|
33
|
-
{ languageTag: "a", match: ["*", "*"], pattern: [{ type: "Text", value: "1" }] },
|
|
34
|
-
{ languageTag: "a", match: ["*", "1"], pattern: [{ type: "Text", value: "2" }] },
|
|
35
|
-
{
|
|
36
|
-
languageTag: "a",
|
|
37
|
-
match: ["1", "*"],
|
|
38
|
-
pattern: [
|
|
39
|
-
{ type: "Text", value: "2" },
|
|
40
|
-
{ type: "Text", value: "2" },
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
{ languageTag: "a", match: ["1", "1"], pattern: [{ type: "Text", value: "2" }] },
|
|
44
|
-
{ languageTag: "b", match: [], pattern: [{ type: "Text", value: "4" }] },
|
|
45
|
-
{ languageTag: "c", match: [], pattern: [{ type: "Text", value: "5" }] },
|
|
46
|
-
{ languageTag: "d", match: [], pattern: [{ type: "Text", value: "6" }] },
|
|
47
|
-
{ languageTag: "e", match: [], pattern: [{ type: "Text", value: "7" }] },
|
|
48
|
-
{ languageTag: "f", match: [], pattern: [{ type: "Text", value: "8" }] },
|
|
49
|
-
{ languageTag: "g", match: [], pattern: [{ type: "Text", value: "9" }] },
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
// stringify with no indentation
|
|
53
|
-
function str(obj) {
|
|
54
|
-
return JSON.stringify(obj);
|
|
55
|
-
}
|
|
56
|
-
// stringify with 2 space indentation
|
|
57
|
-
function str2(obj) {
|
|
58
|
-
return JSON.stringify(obj, undefined, 2);
|
|
59
|
-
}
|
|
60
|
-
// stringify with 4 space indentation
|
|
61
|
-
function str4(obj) {
|
|
62
|
-
return JSON.stringify(obj, undefined, 4);
|
|
63
|
-
}
|
|
64
|
-
describe("normalizeMessage", () => {
|
|
65
|
-
it("should return the message with sorted keys and variants", () => {
|
|
66
|
-
// test cases are not the same (deep equal) before normalization
|
|
67
|
-
// array order of variants is different
|
|
68
|
-
expect(unsortedMessageRaw).not.toEqual(sortedMessageRaw);
|
|
69
|
-
// test cases are the same after normalization
|
|
70
|
-
expect(normalizeMessage(unsortedMessageRaw)).toEqual(sortedMessageRaw);
|
|
71
|
-
// stringify results are not the same before normalization
|
|
72
|
-
expect(str(unsortedMessageRaw)).not.toBe(str(sortedMessageRaw));
|
|
73
|
-
// stringify results are the same after normalization
|
|
74
|
-
expect(str(normalizeMessage(unsortedMessageRaw))).toBe(str(sortedMessageRaw));
|
|
75
|
-
expect(str2(normalizeMessage(unsortedMessageRaw))).toBe(str2(sortedMessageRaw));
|
|
76
|
-
expect(str4(normalizeMessage(unsortedMessageRaw))).toBe(str4(sortedMessageRaw));
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
describe("stringifyMessage", () => {
|
|
80
|
-
it("should normalize and JSON stringify a message with 4 space indentation", () => {
|
|
81
|
-
expect(stringifyMessage(unsortedMessageRaw)).toBe(str4(sortedMessageRaw));
|
|
82
|
-
expect(stringifyMessage(sortedMessageRaw)).toBe(str4(sortedMessageRaw));
|
|
83
|
-
});
|
|
84
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human-readable-id.d.ts","sourceRoot":"","sources":["../../../src/storage/human-id/human-readable-id.ts"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,WAI5B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,UAgB5D"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// we use murmur for best distribution https://medium.com/miro-engineering/choosing-a-hash-function-to-solve-a-data-sharding-problem-c656259e2b54
|
|
2
|
-
import murmurhash3 from "murmurhash3js";
|
|
3
|
-
import { adjectives, animals, adverbs, verbs } from "./words.js";
|
|
4
|
-
export function randomHumanId() {
|
|
5
|
-
return `${adjectives[Math.floor(Math.random() * 256)]}_${animals[Math.floor(Math.random() * 256)]}_${verbs[Math.floor(Math.random() * 256)]}_${adverbs[Math.floor(Math.random() * 256)]}`;
|
|
6
|
-
}
|
|
7
|
-
export function humanIdHash(value, offset = 0) {
|
|
8
|
-
// Seed value can be any arbitrary value
|
|
9
|
-
const seed = 42;
|
|
10
|
-
// Use MurmurHash3 to produce a 32-bit hash
|
|
11
|
-
const hash32 = murmurhash3.x86.hash32(value, seed);
|
|
12
|
-
// Add 1 and take modulo 2^32 to fit within 32 bits
|
|
13
|
-
const hash32WithOffset = (hash32 + offset) >>> 0;
|
|
14
|
-
// Extract four 8-bit parts
|
|
15
|
-
const part1 = (hash32WithOffset >>> 24) & 0xff;
|
|
16
|
-
const part2 = (hash32WithOffset >>> 16) & 0xff;
|
|
17
|
-
const part3 = (hash32WithOffset >>> 8) & 0xff;
|
|
18
|
-
const part4 = hash32WithOffset & 0xff;
|
|
19
|
-
return `${adjectives[part1]}_${animals[part2]}_${verbs[part3]}_${adverbs[part4]}`;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../../../src/storage/human-id/words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAiQnB,CAAA;AAED,eAAO,MAAM,UAAU,UAiQtB,CAAA;AAED,eAAO,MAAM,OAAO,UAiQnB,CAAA;AAED,eAAO,MAAM,KAAK,UAiQjB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"words.test.d.ts","sourceRoot":"","sources":["../../../src/storage/human-id/words.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/telemetry/capture.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,QAAA,MAAM,MAAM,iCAAkC,CAAA;AAE9C;;;;GAIG;AACH,eAAO,MAAM,OAAO,UACZ,CAAC,OAAO,MAAM,EAAE,MAAM,CAAC,QACxB;IACL,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,kBAyBD,CAAA"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ENV_VARIABLES } from "../env-variables/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* List of telemetry events for typesafety.
|
|
4
|
-
*
|
|
5
|
-
* - prefix with `SDK` to avoid collisions with other apps
|
|
6
|
-
* - use past tense to indicate that the event is completed
|
|
7
|
-
*/
|
|
8
|
-
const events = ["SDK loaded project"];
|
|
9
|
-
/**
|
|
10
|
-
* Capture an event.
|
|
11
|
-
*
|
|
12
|
-
* - manually calling the PostHog API because the SDKs were not platform angostic (and generally bloated)
|
|
13
|
-
*/
|
|
14
|
-
export const capture = async (event, args) => {
|
|
15
|
-
// do not send events if the token is not set
|
|
16
|
-
// (assuming this eases testing)
|
|
17
|
-
if (ENV_VARIABLES.PUBLIC_POSTHOG_TOKEN === undefined) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
await fetch("https://eu.posthog.com/capture/", {
|
|
22
|
-
method: "POST",
|
|
23
|
-
body: JSON.stringify({
|
|
24
|
-
api_key: ENV_VARIABLES.PUBLIC_POSTHOG_TOKEN,
|
|
25
|
-
event,
|
|
26
|
-
// id is "unknown" because no user information is available
|
|
27
|
-
distinct_id: "unknown",
|
|
28
|
-
properties: {
|
|
29
|
-
$groups: { project: args.projectId },
|
|
30
|
-
...args.properties,
|
|
31
|
-
},
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
// TODO implement sentry logging
|
|
37
|
-
// do not console.log and avoid exposing internal errors to the user
|
|
38
|
-
}
|
|
39
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capture an event.
|
|
3
|
-
*
|
|
4
|
-
* - manually calling the PostHog API because the SDKs were not platform angostic (and generally bloated)
|
|
5
|
-
*/
|
|
6
|
-
export declare const identifyProject: (args: {
|
|
7
|
-
projectId: string;
|
|
8
|
-
/**
|
|
9
|
-
* Please use snake_case for property names.
|
|
10
|
-
*/
|
|
11
|
-
properties: Record<string, any>;
|
|
12
|
-
}) => Promise<void>;
|
|
13
|
-
//# sourceMappingURL=groupIdentify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupIdentify.d.ts","sourceRoot":"","sources":["../../src/telemetry/groupIdentify.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAgB;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,kBA2BA,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ENV_VARIABLES } from "../env-variables/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Capture an event.
|
|
4
|
-
*
|
|
5
|
-
* - manually calling the PostHog API because the SDKs were not platform angostic (and generally bloated)
|
|
6
|
-
*/
|
|
7
|
-
export const identifyProject = async (args) => {
|
|
8
|
-
// do not send events if the token is not set
|
|
9
|
-
// (assuming this eases testing)
|
|
10
|
-
if (ENV_VARIABLES.PUBLIC_POSTHOG_TOKEN === undefined) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
await fetch("https://eu.posthog.com/capture/", {
|
|
15
|
-
method: "POST",
|
|
16
|
-
body: JSON.stringify({
|
|
17
|
-
api_key: ENV_VARIABLES.PUBLIC_POSTHOG_TOKEN,
|
|
18
|
-
event: "$groupidentify",
|
|
19
|
-
// id is "unknown" because no user information is available
|
|
20
|
-
distinct_id: "unknown",
|
|
21
|
-
properties: {
|
|
22
|
-
$group_type: "project",
|
|
23
|
-
$group_key: args.projectId,
|
|
24
|
-
$group_set: {
|
|
25
|
-
...args.properties,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
// TODO implement sentry logging
|
|
33
|
-
// do not console.log and avoid exposing internal errors to the user
|
|
34
|
-
}
|
|
35
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Pattern } from "@inlang/message";
|
|
2
|
-
export declare const createMessage: (id: string, patterns: Record<string, Pattern | string>) => {
|
|
3
|
-
id: string;
|
|
4
|
-
alias: {};
|
|
5
|
-
selectors: never[];
|
|
6
|
-
variants: {
|
|
7
|
-
languageTag: string;
|
|
8
|
-
match: never[];
|
|
9
|
-
pattern: ({
|
|
10
|
-
type: "Text";
|
|
11
|
-
value: string;
|
|
12
|
-
} | {
|
|
13
|
-
type: "VariableReference";
|
|
14
|
-
name: string;
|
|
15
|
-
})[];
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=createMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMessage.d.ts","sourceRoot":"","sources":["../../src/test-utilities/createMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEvD,eAAO,MAAM,aAAa,OAAQ,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;;;;;;;;;;;;;;;CAkB/D,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const createMessage = (id, patterns) => ({
|
|
2
|
-
id,
|
|
3
|
-
alias: {},
|
|
4
|
-
selectors: [],
|
|
5
|
-
variants: Object.entries(patterns).map(([languageTag, patterns]) => ({
|
|
6
|
-
languageTag,
|
|
7
|
-
match: [],
|
|
8
|
-
pattern: typeof patterns === "string"
|
|
9
|
-
? [
|
|
10
|
-
{
|
|
11
|
-
type: "Text",
|
|
12
|
-
value: patterns,
|
|
13
|
-
},
|
|
14
|
-
]
|
|
15
|
-
: patterns,
|
|
16
|
-
})),
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMessage.test.d.ts","sourceRoot":"","sources":["../../src/test-utilities/createMessage.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
2
|
-
import { createMessage } from "./createMessage.js";
|
|
3
|
-
test("should create a simple message", () => {
|
|
4
|
-
expect(createMessage("welcome", {
|
|
5
|
-
de: "Hallo inlang",
|
|
6
|
-
})).toMatchInlineSnapshot({
|
|
7
|
-
alias: {},
|
|
8
|
-
id: "welcome",
|
|
9
|
-
selectors: [],
|
|
10
|
-
variants: [
|
|
11
|
-
{
|
|
12
|
-
languageTag: "de",
|
|
13
|
-
match: [],
|
|
14
|
-
pattern: [
|
|
15
|
-
{
|
|
16
|
-
type: "Text",
|
|
17
|
-
value: "Hallo inlang",
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
}, `
|
|
23
|
-
{
|
|
24
|
-
"alias": {},
|
|
25
|
-
"id": "welcome",
|
|
26
|
-
"selectors": [],
|
|
27
|
-
"variants": [
|
|
28
|
-
{
|
|
29
|
-
"languageTag": "de",
|
|
30
|
-
"match": [],
|
|
31
|
-
"pattern": [
|
|
32
|
-
{
|
|
33
|
-
"type": "Text",
|
|
34
|
-
"value": "Hallo inlang",
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
}
|
|
40
|
-
`);
|
|
41
|
-
});
|
|
42
|
-
test("should create a message with pattern", () => {
|
|
43
|
-
expect(createMessage("greeting", {
|
|
44
|
-
en: [
|
|
45
|
-
{ type: "Text", value: "Hi " },
|
|
46
|
-
{ type: "VariableReference", name: "name" },
|
|
47
|
-
{ type: "Text", value: '"' },
|
|
48
|
-
],
|
|
49
|
-
})).toStrictEqual({
|
|
50
|
-
alias: {},
|
|
51
|
-
id: "greeting",
|
|
52
|
-
selectors: [],
|
|
53
|
-
variants: [
|
|
54
|
-
{
|
|
55
|
-
languageTag: "en",
|
|
56
|
-
match: [],
|
|
57
|
-
pattern: [
|
|
58
|
-
{
|
|
59
|
-
type: "Text",
|
|
60
|
-
value: "Hi ",
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "name",
|
|
64
|
-
type: "VariableReference",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: "Text",
|
|
68
|
-
value: '"',
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
test("should create a message with a pattern", () => {
|
|
76
|
-
expect(createMessage("welcome", {
|
|
77
|
-
en: "hello inlang",
|
|
78
|
-
de: [{ type: "Text", value: "Hallo inlang" }],
|
|
79
|
-
})).toStrictEqual({
|
|
80
|
-
alias: {},
|
|
81
|
-
id: "welcome",
|
|
82
|
-
selectors: [],
|
|
83
|
-
variants: [
|
|
84
|
-
{
|
|
85
|
-
languageTag: "en",
|
|
86
|
-
match: [],
|
|
87
|
-
pattern: [
|
|
88
|
-
{
|
|
89
|
-
type: "Text",
|
|
90
|
-
value: "hello inlang",
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
languageTag: "de",
|
|
96
|
-
match: [],
|
|
97
|
-
pattern: [
|
|
98
|
-
{
|
|
99
|
-
type: "Text",
|
|
100
|
-
value: "Hallo inlang",
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA"}
|