@kvaser/canking-api 7.1.0-beta.231
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/EULA.pdf +0 -0
- package/README.md +87 -0
- package/REDISTRIBUTABLES.txt +5 -0
- package/dist/ElectronAPIFake.js +1 -0
- package/dist/ElectronAPIFake.mjs +266 -0
- package/dist/controls/CanChannelSelectControl.d.ts +35 -0
- package/dist/controls/CanIdentifierControl.d.ts +176 -0
- package/dist/controls/CanKingDataProvider.d.ts +116 -0
- package/dist/controls/CheckboxControl.d.ts +30 -0
- package/dist/controls/ContextMenu.d.ts +44 -0
- package/dist/controls/DropdownButton.d.ts +73 -0
- package/dist/controls/DropdownPanel.d.ts +41 -0
- package/dist/controls/FillBox.d.ts +8 -0
- package/dist/controls/FormControlRow.d.ts +30 -0
- package/dist/controls/InlineEditor.d.ts +26 -0
- package/dist/controls/LocalizedStrings.d.ts +21 -0
- package/dist/controls/NumberRangeControl.d.ts +80 -0
- package/dist/controls/OneLineButton.d.ts +9 -0
- package/dist/controls/RadioControl.d.ts +25 -0
- package/dist/controls/RadioGroupControl.d.ts +31 -0
- package/dist/controls/SectionControl.d.ts +40 -0
- package/dist/controls/SelectControl.d.ts +55 -0
- package/dist/controls/SizedBox.d.ts +11 -0
- package/dist/controls/TableControl.d.ts +61 -0
- package/dist/controls/TabsPanel.d.ts +5 -0
- package/dist/controls/TextControl.d.ts +56 -0
- package/dist/controls/ToolbarControl.d.ts +143 -0
- package/dist/controls/ValidateableTextControl.d.ts +82 -0
- package/dist/controls/index.d.ts +103 -0
- package/dist/controls.js +1 -0
- package/dist/controls.mjs +1714 -0
- package/dist/grpc/index.d.ts +7 -0
- package/dist/grpc.js +1 -0
- package/dist/grpc.mjs +917 -0
- package/dist/hooks/index.d.ts +112 -0
- package/dist/hooks.js +1 -0
- package/dist/hooks.mjs +28 -0
- package/dist/icons/index.d.ts +121 -0
- package/dist/icons.js +1 -0
- package/dist/icons.mjs +1237 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +596 -0
- package/dist/ipc/index.d.ts +160 -0
- package/dist/ipc.js +1 -0
- package/dist/ipc.mjs +123 -0
- package/dist/measurement_settings.js +1 -0
- package/dist/measurement_settings.mjs +4132 -0
- package/dist/models/DataBuffer.d.ts +100 -0
- package/dist/models/ElectronAPIFake.d.ts +13 -0
- package/dist/models/Point.d.ts +30 -0
- package/dist/models/index.d.ts +95 -0
- package/dist/models.js +1 -0
- package/dist/models.mjs +448 -0
- package/dist/protos/app_params.d.ts +208 -0
- package/dist/protos/app_service.d.ts +354 -0
- package/dist/protos/common_params.d.ts +33 -0
- package/dist/protos/device_params.d.ts +271 -0
- package/dist/protos/device_service.d.ts +154 -0
- package/dist/protos/frame_params.d.ts +189 -0
- package/dist/protos/google/protobuf/empty.d.ts +35 -0
- package/dist/protos/measurement_params.d.ts +308 -0
- package/dist/protos/measurement_service.d.ts +1333 -0
- package/dist/protos/measurement_settings.d.ts +453 -0
- package/dist/protos/signal_params.d.ts +72 -0
- package/dist/protos/status_params.d.ts +118 -0
- package/dist/status_params.js +1 -0
- package/dist/status_params.mjs +5045 -0
- package/doc/.nojekyll +1 -0
- package/doc/assets/highlight.css +120 -0
- package/doc/assets/icons.js +18 -0
- package/doc/assets/icons.svg +1 -0
- package/doc/assets/main.js +60 -0
- package/doc/assets/material-style.css +247 -0
- package/doc/assets/navigation.js +1 -0
- package/doc/assets/search.js +1 -0
- package/doc/assets/style.css +1493 -0
- package/doc/classes/controls.LocalizedStrings.html +177 -0
- package/doc/classes/models.DataBuffer.html +205 -0
- package/doc/classes/models.DataBufferView.html +193 -0
- package/doc/classes/models.Point.html +187 -0
- package/doc/enums/models.AccessMode.html +188 -0
- package/doc/enums/models.AppEvent.html +179 -0
- package/doc/enums/models.CanChannelCap.html +217 -0
- package/doc/enums/models.CanFrameFlag.html +200 -0
- package/doc/enums/models.CanMode.html +180 -0
- package/doc/enums/models.DecimalChar.html +178 -0
- package/doc/enums/models.DeviceEvent.html +179 -0
- package/doc/enums/models.FileConflictAction.html +180 -0
- package/doc/enums/models.LinFrameFlag.html +185 -0
- package/doc/enums/models.LogFileFormat.html +221 -0
- package/doc/enums/models.LogLevel.html +195 -0
- package/doc/enums/models.LogReplayState.html +179 -0
- package/doc/enums/models.MeasurementEvent.html +185 -0
- package/doc/enums/models.MessageLoggerState.html +180 -0
- package/doc/enums/models.Protocols.html +182 -0
- package/doc/enums/models.Separator.html +178 -0
- package/doc/enums/models.SignalEncoding.html +178 -0
- package/doc/enums/models.SignalType.html +185 -0
- package/doc/enums/models.SignalValueTriggerOperator.html +186 -0
- package/doc/enums/models.StatusLevel.html +180 -0
- package/doc/enums/models.TimeReference.html +178 -0
- package/doc/enums/models.TriggerOperator.html +179 -0
- package/doc/functions/controls.CanChannelSelectControl.html +177 -0
- package/doc/functions/controls.CanIdentifierControl.html +177 -0
- package/doc/functions/controls.CanIdentifierFrameControl.html +177 -0
- package/doc/functions/controls.CanIdentifierGeneratorControl.html +177 -0
- package/doc/functions/controls.CanIdentifierGeneratorSettingsControl.html +178 -0
- package/doc/functions/controls.CanKingDataProvider.html +182 -0
- package/doc/functions/controls.CheckboxControl.html +177 -0
- package/doc/functions/controls.ContextMenu.html +177 -0
- package/doc/functions/controls.DropdownButton.html +177 -0
- package/doc/functions/controls.DropdownButtonTextItems.html +177 -0
- package/doc/functions/controls.DropdownPanel.html +177 -0
- package/doc/functions/controls.FillBox.html +206 -0
- package/doc/functions/controls.FormControlRow.html +177 -0
- package/doc/functions/controls.InlineEditor.html +177 -0
- package/doc/functions/controls.NumberRangeControl.html +177 -0
- package/doc/functions/controls.OneLineButton.html +205 -0
- package/doc/functions/controls.RadioControl.html +177 -0
- package/doc/functions/controls.RadioGroupControl.html +177 -0
- package/doc/functions/controls.SectionControl.html +177 -0
- package/doc/functions/controls.SelectControl.html +177 -0
- package/doc/functions/controls.SizedBox.html +206 -0
- package/doc/functions/controls.TableControl.html +177 -0
- package/doc/functions/controls.TabsPanel.html +205 -0
- package/doc/functions/controls.TextControl.html +177 -0
- package/doc/functions/controls.ToolbarControl.html +177 -0
- package/doc/functions/controls.ValidateableTextControl.html +177 -0
- package/doc/functions/hooks.useDevices.html +176 -0
- package/doc/functions/hooks.useIsOnline.html +176 -0
- package/doc/functions/hooks.useLanguage.html +176 -0
- package/doc/functions/hooks.useLocalizedStrings.html +176 -0
- package/doc/functions/hooks.useLogMessages.html +176 -0
- package/doc/functions/hooks.useMaxDataBytes.html +175 -0
- package/doc/functions/hooks.useMeasurementSetup.html +176 -0
- package/doc/functions/hooks.useMeasurementStatus.html +176 -0
- package/doc/functions/hooks.useMessageLogFileFormats.html +175 -0
- package/doc/functions/hooks.useNewMeasurementData.html +178 -0
- package/doc/functions/hooks.useNodeStatus.html +176 -0
- package/doc/functions/hooks.useNumericRadix.html +176 -0
- package/doc/functions/hooks.useOnlineStatus.html +176 -0
- package/doc/functions/hooks.useOverallStatusLevel.html +176 -0
- package/doc/functions/hooks.useProjectData.html +178 -0
- package/doc/functions/hooks.useRecentProjectFiles.html +175 -0
- package/doc/functions/hooks.useRunningPeriodicTransmissions.html +176 -0
- package/doc/functions/hooks.useSessionData.html +178 -0
- package/doc/functions/hooks.useUserSettings.html +176 -0
- package/doc/functions/hooks.useWorkspacePaneWithId.html +175 -0
- package/doc/functions/icons.AddIcon.html +175 -0
- package/doc/functions/icons.ArrowDownIcon.html +175 -0
- package/doc/functions/icons.ArrowLeftIcon.html +175 -0
- package/doc/functions/icons.ArrowRightIcon.html +175 -0
- package/doc/functions/icons.ArrowUpIcon.html +175 -0
- package/doc/functions/icons.BusIsOffIcon.html +175 -0
- package/doc/functions/icons.BusIsOnIcon.html +175 -0
- package/doc/functions/icons.CloseIcon.html +175 -0
- package/doc/functions/icons.CopyIcon.html +175 -0
- package/doc/functions/icons.DarkModeIcon.html +175 -0
- package/doc/functions/icons.DeleteIcon.html +175 -0
- package/doc/functions/icons.DisableIcon.html +175 -0
- package/doc/functions/icons.EditIcon.html +175 -0
- package/doc/functions/icons.FilterIcon.html +175 -0
- package/doc/functions/icons.FixedPositionIcon.html +175 -0
- package/doc/functions/icons.LeaveFullScreenIcon.html +175 -0
- package/doc/functions/icons.LightModeIcon.html +175 -0
- package/doc/functions/icons.LineArrowDownIcon.html +175 -0
- package/doc/functions/icons.LineArrowUpIcon.html +175 -0
- package/doc/functions/icons.MaximizeWindowIcon.html +175 -0
- package/doc/functions/icons.MeasurementSetupIcon.html +175 -0
- package/doc/functions/icons.MoreHorizIcon.html +175 -0
- package/doc/functions/icons.MoreVertIcon.html +175 -0
- package/doc/functions/icons.NewIcon.html +175 -0
- package/doc/functions/icons.OpenExternallyIcon.html +175 -0
- package/doc/functions/icons.OpenIcon.html +175 -0
- package/doc/functions/icons.PauseIcon.html +175 -0
- package/doc/functions/icons.PlayIcon.html +175 -0
- package/doc/functions/icons.PlaySolidIcon.html +175 -0
- package/doc/functions/icons.SaveIcon.html +175 -0
- package/doc/functions/icons.SelectAllIcon.html +175 -0
- package/doc/functions/icons.ServiceIconActive.html +175 -0
- package/doc/functions/icons.ServiceIconInactive.html +175 -0
- package/doc/functions/icons.SettingsIcon.html +175 -0
- package/doc/functions/icons.StopIcon.html +175 -0
- package/doc/functions/icons.StopSolidIcon.html +175 -0
- package/doc/functions/icons.ToolsPanelHiddenIcon.html +175 -0
- package/doc/functions/icons.ToolsPanelVisibleIcon.html +175 -0
- package/doc/functions/icons.UnmaximizeWindowIcon.html +175 -0
- package/doc/functions/icons.WorkspacesIcon.html +175 -0
- package/doc/functions/ipc.addDataProcessor.html +178 -0
- package/doc/functions/ipc.addSource.html +176 -0
- package/doc/functions/ipc.addTarget.html +176 -0
- package/doc/functions/ipc.connectNodes.html +177 -0
- package/doc/functions/ipc.deleteDataProcessor.html +176 -0
- package/doc/functions/ipc.deleteSource.html +176 -0
- package/doc/functions/ipc.deleteTarget.html +176 -0
- package/doc/functions/ipc.disableNode.html +176 -0
- package/doc/functions/ipc.disconnectNodes.html +177 -0
- package/doc/functions/ipc.enableNode.html +176 -0
- package/doc/functions/ipc.getFrameDefinitions.html +178 -0
- package/doc/functions/ipc.getLogger.html +177 -0
- package/doc/functions/ipc.getMessageLogFileFormats.html +176 -0
- package/doc/functions/ipc.sendCanMessage.html +179 -0
- package/doc/functions/ipc.sendMessage.html +177 -0
- package/doc/functions/ipc.showMessageBox.html +177 -0
- package/doc/functions/ipc.showQuestionBox.html +183 -0
- package/doc/functions/ipc.startLogReplay.html +176 -0
- package/doc/functions/ipc.startMeasurement.html +175 -0
- package/doc/functions/ipc.startPeriodicTransmission.html +177 -0
- package/doc/functions/ipc.stopLogReplay.html +176 -0
- package/doc/functions/ipc.stopMeasurement.html +175 -0
- package/doc/functions/ipc.stopPeriodicTransmission.html +176 -0
- package/doc/functions/ipc.updateDataProcessor.html +176 -0
- package/doc/functions/ipc.updateSource.html +176 -0
- package/doc/functions/ipc.updateTarget.html +176 -0
- package/doc/functions/models.accessModeFromJSON.html +174 -0
- package/doc/functions/models.accessModeToJSON.html +174 -0
- package/doc/functions/models.appEventFromJSON.html +174 -0
- package/doc/functions/models.appEventToJSON.html +174 -0
- package/doc/functions/models.canChannelCapFromJSON.html +174 -0
- package/doc/functions/models.canChannelCapToJSON.html +174 -0
- package/doc/functions/models.canFrameFlagFromJSON.html +174 -0
- package/doc/functions/models.canFrameFlagToJSON.html +174 -0
- package/doc/functions/models.canModeFromJSON.html +174 -0
- package/doc/functions/models.canModeToJSON.html +174 -0
- package/doc/functions/models.createElectronApiFake.html +177 -0
- package/doc/functions/models.decimalCharFromJSON.html +174 -0
- package/doc/functions/models.decimalCharToJSON.html +174 -0
- package/doc/functions/models.decimalToFixed.html +174 -0
- package/doc/functions/models.decimalToHex.html +174 -0
- package/doc/functions/models.deviceEventFromJSON.html +174 -0
- package/doc/functions/models.deviceEventToJSON.html +174 -0
- package/doc/functions/models.fileConflictActionFromJSON.html +174 -0
- package/doc/functions/models.fileConflictActionToJSON.html +174 -0
- package/doc/functions/models.linFrameFlagFromJSON.html +174 -0
- package/doc/functions/models.linFrameFlagToJSON.html +174 -0
- package/doc/functions/models.logFileFormatFromJSON.html +174 -0
- package/doc/functions/models.logFileFormatToJSON.html +174 -0
- package/doc/functions/models.logLevelFromJSON.html +174 -0
- package/doc/functions/models.logLevelToJSON.html +174 -0
- package/doc/functions/models.logReplayStateFromJSON.html +174 -0
- package/doc/functions/models.logReplayStateToJSON.html +174 -0
- package/doc/functions/models.longToNumber.html +174 -0
- package/doc/functions/models.measurementEventFromJSON.html +174 -0
- package/doc/functions/models.measurementEventToJSON.html +174 -0
- package/doc/functions/models.messageLoggerStateFromJSON.html +174 -0
- package/doc/functions/models.messageLoggerStateToJSON.html +174 -0
- package/doc/functions/models.protocolsFromJSON.html +174 -0
- package/doc/functions/models.protocolsToJSON.html +174 -0
- package/doc/functions/models.separatorFromJSON.html +174 -0
- package/doc/functions/models.separatorToJSON.html +174 -0
- package/doc/functions/models.signalEncodingFromJSON.html +174 -0
- package/doc/functions/models.signalEncodingToJSON.html +174 -0
- package/doc/functions/models.signalTypeFromJSON.html +174 -0
- package/doc/functions/models.signalTypeToJSON.html +174 -0
- package/doc/functions/models.signalValueTriggerOperatorFromJSON.html +174 -0
- package/doc/functions/models.signalValueTriggerOperatorToJSON.html +174 -0
- package/doc/functions/models.statusLevelFromJSON.html +174 -0
- package/doc/functions/models.statusLevelToJSON.html +174 -0
- package/doc/functions/models.timeReferenceFromJSON.html +174 -0
- package/doc/functions/models.timeReferenceToJSON.html +174 -0
- package/doc/functions/models.triggerOperatorFromJSON.html +174 -0
- package/doc/functions/models.triggerOperatorToJSON.html +174 -0
- package/doc/hierarchy.html +174 -0
- package/doc/index.html +244 -0
- package/doc/interfaces/controls.ButtonGroupProps.html +183 -0
- package/doc/interfaces/controls.ButtonProps.html +195 -0
- package/doc/interfaces/controls.CanChannelSelectControlProps.html +194 -0
- package/doc/interfaces/controls.CanIdentifierControlProps.html +195 -0
- package/doc/interfaces/controls.CanIdentifierFrameControlProps.html +190 -0
- package/doc/interfaces/controls.CanIdentifierGeneratorControlProps.html +208 -0
- package/doc/interfaces/controls.CanIdentifierGeneratorSettingsControlProps.html +194 -0
- package/doc/interfaces/controls.CheckboxControlProps.html +190 -0
- package/doc/interfaces/controls.ContextMenuProps.html +182 -0
- package/doc/interfaces/controls.DropdownButtonChildrenProps.html +177 -0
- package/doc/interfaces/controls.DropdownButtonProps.html +193 -0
- package/doc/interfaces/controls.DropdownButtonTextItemsProps.html +183 -0
- package/doc/interfaces/controls.DropdownPanelProps.html +193 -0
- package/doc/interfaces/controls.FormControlRowProps.html +181 -0
- package/doc/interfaces/controls.ILocalizedStrings.html +176 -0
- package/doc/interfaces/controls.InlineEditorProps.html +186 -0
- package/doc/interfaces/controls.LabelProps.html +179 -0
- package/doc/interfaces/controls.NumberRangeControlProps.html +225 -0
- package/doc/interfaces/controls.RadioControlProps.html +187 -0
- package/doc/interfaces/controls.RadioGroupControlProps.html +182 -0
- package/doc/interfaces/controls.SectionControlProps.html +190 -0
- package/doc/interfaces/controls.SelectControlProps.html +205 -0
- package/doc/interfaces/controls.TableColumn.html +185 -0
- package/doc/interfaces/controls.TableControlProps.html +197 -0
- package/doc/interfaces/controls.TextControlProps.html +214 -0
- package/doc/interfaces/controls.ToggleButtonGroupProps.html +190 -0
- package/doc/interfaces/controls.ToggleButtonProps.html +187 -0
- package/doc/interfaces/controls.ToolbarControlProps.html +191 -0
- package/doc/interfaces/controls.ValidateableTextControlProps.html +233 -0
- package/doc/interfaces/controls.toolbarItem.html +185 -0
- package/doc/interfaces/ipc.ILogger.html +181 -0
- package/doc/interfaces/models.AboutInformation.html +181 -0
- package/doc/interfaces/models.ActivateLicenseRequest.html +181 -0
- package/doc/interfaces/models.AddAllConnectedCanChannelsRequest.html +177 -0
- package/doc/interfaces/models.AddAllConnectedLinChannelsRequest.html +177 -0
- package/doc/interfaces/models.AddOrUpdateDataProcessorRequest.html +185 -0
- package/doc/interfaces/models.AddOrUpdateSourceRequest.html +181 -0
- package/doc/interfaces/models.AddOrUpdateTargetRequest.html +181 -0
- package/doc/interfaces/models.ApiPreferences.html +183 -0
- package/doc/interfaces/models.AppEventArgs.html +179 -0
- package/doc/interfaces/models.BaseNodeProperties.html +181 -0
- package/doc/interfaces/models.BusStatus.html +190 -0
- package/doc/interfaces/models.CanBusParamLimits.html +180 -0
- package/doc/interfaces/models.CanBusParams.html +197 -0
- package/doc/interfaces/models.CanBusSpeed.html +187 -0
- package/doc/interfaces/models.CanBusSpeedInfo.html +193 -0
- package/doc/interfaces/models.CanChannelCapacity.html +180 -0
- package/doc/interfaces/models.CanChannelConfiguration.html +185 -0
- package/doc/interfaces/models.CanFDBusSpeedCombination.html +177 -0
- package/doc/interfaces/models.CanFDBusSpeedInfo.html +191 -0
- package/doc/interfaces/models.CanFrameFlags.html +177 -0
- package/doc/interfaces/models.CanMessageFilterSettings.html +178 -0
- package/doc/interfaces/models.Channel.html +180 -0
- package/doc/interfaces/models.ChannelSettings.html +193 -0
- package/doc/interfaces/models.ClearLinMessageRequest.html +180 -0
- package/doc/interfaces/models.ConnectNodesRequest.html +178 -0
- package/doc/interfaces/models.DataProcessingStatus.html +179 -0
- package/doc/interfaces/models.DataProcessorNodeProperties.html +181 -0
- package/doc/interfaces/models.DatabasesSettings.html +176 -0
- package/doc/interfaces/models.Device.html +182 -0
- package/doc/interfaces/models.DeviceEventArgs.html +177 -0
- package/doc/interfaces/models.Devices.html +175 -0
- package/doc/interfaces/models.DisconnectNodesRequest.html +178 -0
- package/doc/interfaces/models.Empty.html +182 -0
- package/doc/interfaces/models.ErrorStatus.html +177 -0
- package/doc/interfaces/models.Frame.html +203 -0
- package/doc/interfaces/models.FrameDefinition.html +185 -0
- package/doc/interfaces/models.FrameDefinitions.html +175 -0
- package/doc/interfaces/models.FramePropertyValue.html +177 -0
- package/doc/interfaces/models.FrameReceivedTrigger.html +179 -0
- package/doc/interfaces/models.Frame_PropertiesEntry.html +176 -0
- package/doc/interfaces/models.Frames.html +175 -0
- package/doc/interfaces/models.GetCanChannelBusSpeedsRequest.html +177 -0
- package/doc/interfaces/models.GetCanChannelBusSpeedsResponse.html +179 -0
- package/doc/interfaces/models.GetCanFdBusSpeedsRequest.html +179 -0
- package/doc/interfaces/models.GetCanFdBusSpeedsResponse.html +177 -0
- package/doc/interfaces/models.GetChannelsFromLogFileRequest.html +178 -0
- package/doc/interfaces/models.GetChannelsFromLogFileResponse.html +177 -0
- package/doc/interfaces/models.GetClassicCanBusSpeedsRequest.html +178 -0
- package/doc/interfaces/models.GetClassicCanBusSpeedsResponse.html +177 -0
- package/doc/interfaces/models.GetDataProcessorResponse.html +176 -0
- package/doc/interfaces/models.GetDevicesRequest.html +177 -0
- package/doc/interfaces/models.GetDevicesResponse.html +176 -0
- package/doc/interfaces/models.GetFrameDefinitionsFromDatabaseFilesRequest.html +178 -0
- package/doc/interfaces/models.GetLicensesResponse.html +177 -0
- package/doc/interfaces/models.GetLogFileFormatsRequest.html +180 -0
- package/doc/interfaces/models.GetLogFileFormatsResponse.html +183 -0
- package/doc/interfaces/models.GetLogLevelResponse.html +177 -0
- package/doc/interfaces/models.GetScheduleTablesFromDatabaseFilesRequest.html +178 -0
- package/doc/interfaces/models.GetScheduleTablesFromDatabaseFilesResponse.html +177 -0
- package/doc/interfaces/models.GetServiceExtensionInfoRequest.html +181 -0
- package/doc/interfaces/models.GetServiceExtensionInfoResponse.html +187 -0
- package/doc/interfaces/models.GetSignalDataFromMessageDataRequest.html +180 -0
- package/doc/interfaces/models.GetSignalDataFromMessageDataResponse.html +177 -0
- package/doc/interfaces/models.GetSourceResponse.html +176 -0
- package/doc/interfaces/models.GetTargetResponse.html +176 -0
- package/doc/interfaces/models.ILogFileFormat.html +179 -0
- package/doc/interfaces/models.IProject.html +179 -0
- package/doc/interfaces/models.IUserSettings.html +187 -0
- package/doc/interfaces/models.IWorkspaceComponentPaneData.html +177 -0
- package/doc/interfaces/models.IWorkspaceContainerPaneData.html +178 -0
- package/doc/interfaces/models.IWorkspaceData.html +178 -0
- package/doc/interfaces/models.IWorkspacePaneData.html +178 -0
- package/doc/interfaces/models.IdentifierRequest.html +178 -0
- package/doc/interfaces/models.IdentifiersRequest.html +178 -0
- package/doc/interfaces/models.InstallServiceExtensionRequest.html +181 -0
- package/doc/interfaces/models.InterpreterSettings.html +177 -0
- package/doc/interfaces/models.J1939InterpreterSettings.html +175 -0
- package/doc/interfaces/models.LicenseInformation.html +191 -0
- package/doc/interfaces/models.Licenses.html +177 -0
- package/doc/interfaces/models.LinChannelConfiguration.html +185 -0
- package/doc/interfaces/models.LinFrameFlags.html +177 -0
- package/doc/interfaces/models.LogMessage.html +185 -0
- package/doc/interfaces/models.LogMessages.html +177 -0
- package/doc/interfaces/models.LogReplaySettings.html +199 -0
- package/doc/interfaces/models.LogReplaySettings_ChannelIdentifiersEntry.html +176 -0
- package/doc/interfaces/models.LogReplayStatus.html +176 -0
- package/doc/interfaces/models.MeasurementEventArgs.html +179 -0
- package/doc/interfaces/models.MeasurementSetup.html +179 -0
- package/doc/interfaces/models.MessageLoggerSettings.html +213 -0
- package/doc/interfaces/models.MessageLoggerStatus.html +176 -0
- package/doc/interfaces/models.NodeStatus.html +191 -0
- package/doc/interfaces/models.NodeStatuses.html +176 -0
- package/doc/interfaces/models.OnlineStatus.html +176 -0
- package/doc/interfaces/models.PeriodicTransmissionSettings.html +209 -0
- package/doc/interfaces/models.RequestLinMessageRequest.html +180 -0
- package/doc/interfaces/models.ScheduleTable.html +181 -0
- package/doc/interfaces/models.ScheduleTableEntry.html +179 -0
- package/doc/interfaces/models.SendLinWakeupFrameRequest.html +182 -0
- package/doc/interfaces/models.SendMessageRequest.html +178 -0
- package/doc/interfaces/models.ServiceExtensionSettings.html +177 -0
- package/doc/interfaces/models.SetLogLevelRequest.html +179 -0
- package/doc/interfaces/models.SetMeasurementSetupRequest.html +177 -0
- package/doc/interfaces/models.SetSignalDataToMessageDataRequest.html +182 -0
- package/doc/interfaces/models.SetSignalDataToMessageDataResponse.html +180 -0
- package/doc/interfaces/models.SignalDefinition.html +188 -0
- package/doc/interfaces/models.SignalDefinition_EnumValuesEntry.html +176 -0
- package/doc/interfaces/models.SignalDefinitions.html +175 -0
- package/doc/interfaces/models.SignalValue.html +180 -0
- package/doc/interfaces/models.SignalValueTrigger.html +189 -0
- package/doc/interfaces/models.SourceNodeProperties.html +180 -0
- package/doc/interfaces/models.StartPeriodicTransmissionRequest.html +178 -0
- package/doc/interfaces/models.StartPeriodicTransmissionResponse.html +176 -0
- package/doc/interfaces/models.TargetNodeProperties.html +178 -0
- package/doc/interfaces/models.TriggerSettings.html +181 -0
- package/doc/interfaces/models.UninstallServiceExtensionRequest.html +179 -0
- package/doc/interfaces/models.UpdateLinMessageRequest.html +181 -0
- package/doc/interfaces/models.WriteFrame.html +183 -0
- package/doc/modules/controls.html +242 -0
- package/doc/modules/hooks.html +201 -0
- package/doc/modules/icons.html +216 -0
- package/doc/modules/ipc.html +202 -0
- package/doc/modules/models.html +478 -0
- package/doc/modules.html +179 -0
- package/doc/types/controls.ContextMenuOption.html +179 -0
- package/doc/types/controls.SelectOption.html +177 -0
- package/doc/types/controls.StringsMap.html +175 -0
- package/doc/types/controls.canIdentifierType.html +175 -0
- package/doc/types/models.IReadOnlyDataBuffer.html +174 -0
- package/doc/types/models.themes.html +174 -0
- package/doc/variables/models.AboutInformation-1.html +174 -0
- package/doc/variables/models.ActivateLicenseRequest-1.html +174 -0
- package/doc/variables/models.AddAllConnectedCanChannelsRequest-1.html +174 -0
- package/doc/variables/models.AddAllConnectedLinChannelsRequest-1.html +174 -0
- package/doc/variables/models.AddOrUpdateDataProcessorRequest-1.html +174 -0
- package/doc/variables/models.AddOrUpdateSourceRequest-1.html +174 -0
- package/doc/variables/models.AddOrUpdateTargetRequest-1.html +174 -0
- package/doc/variables/models.ApiPreferences-1.html +174 -0
- package/doc/variables/models.AppEventArgs-1.html +174 -0
- package/doc/variables/models.BaseNodeProperties-1.html +174 -0
- package/doc/variables/models.BusStatus-1.html +174 -0
- package/doc/variables/models.CanBusParamLimits-1.html +174 -0
- package/doc/variables/models.CanBusParams-1.html +174 -0
- package/doc/variables/models.CanBusSpeed-1.html +174 -0
- package/doc/variables/models.CanBusSpeedInfo-1.html +174 -0
- package/doc/variables/models.CanChannelCapacity-1.html +174 -0
- package/doc/variables/models.CanChannelConfiguration-1.html +174 -0
- package/doc/variables/models.CanFDBusSpeedCombination-1.html +174 -0
- package/doc/variables/models.CanFDBusSpeedInfo-1.html +174 -0
- package/doc/variables/models.CanFrameFlags-1.html +174 -0
- package/doc/variables/models.CanMessageFilterSettings-1.html +174 -0
- package/doc/variables/models.Channel-1.html +174 -0
- package/doc/variables/models.ChannelSettings-1.html +174 -0
- package/doc/variables/models.ClearLinMessageRequest-1.html +174 -0
- package/doc/variables/models.ConnectNodesRequest-1.html +174 -0
- package/doc/variables/models.DataProcessingStatus-1.html +174 -0
- package/doc/variables/models.DataProcessorNodeProperties-1.html +174 -0
- package/doc/variables/models.DatabasesSettings-1.html +174 -0
- package/doc/variables/models.Device-1.html +174 -0
- package/doc/variables/models.DeviceEventArgs-1.html +174 -0
- package/doc/variables/models.Devices-1.html +174 -0
- package/doc/variables/models.DisconnectNodesRequest-1.html +174 -0
- package/doc/variables/models.Empty-1.html +174 -0
- package/doc/variables/models.ErrorStatus-1.html +174 -0
- package/doc/variables/models.Frame-1.html +174 -0
- package/doc/variables/models.FrameDefinition-1.html +174 -0
- package/doc/variables/models.FrameDefinitions-1.html +174 -0
- package/doc/variables/models.FramePropertyValue-1.html +174 -0
- package/doc/variables/models.FrameReceivedTrigger-1.html +174 -0
- package/doc/variables/models.Frame_PropertiesEntry-1.html +174 -0
- package/doc/variables/models.Frames-1.html +174 -0
- package/doc/variables/models.GetCanChannelBusSpeedsRequest-1.html +174 -0
- package/doc/variables/models.GetCanChannelBusSpeedsResponse-1.html +174 -0
- package/doc/variables/models.GetCanFdBusSpeedsRequest-1.html +174 -0
- package/doc/variables/models.GetCanFdBusSpeedsResponse-1.html +174 -0
- package/doc/variables/models.GetChannelsFromLogFileRequest-1.html +174 -0
- package/doc/variables/models.GetChannelsFromLogFileResponse-1.html +174 -0
- package/doc/variables/models.GetClassicCanBusSpeedsRequest-1.html +174 -0
- package/doc/variables/models.GetClassicCanBusSpeedsResponse-1.html +174 -0
- package/doc/variables/models.GetDataProcessorResponse-1.html +174 -0
- package/doc/variables/models.GetDevicesRequest-1.html +174 -0
- package/doc/variables/models.GetDevicesResponse-1.html +174 -0
- package/doc/variables/models.GetFrameDefinitionsFromDatabaseFilesRequest-1.html +174 -0
- package/doc/variables/models.GetLicensesResponse-1.html +174 -0
- package/doc/variables/models.GetLogFileFormatsRequest-1.html +174 -0
- package/doc/variables/models.GetLogFileFormatsResponse-1.html +174 -0
- package/doc/variables/models.GetLogLevelResponse-1.html +174 -0
- package/doc/variables/models.GetScheduleTablesFromDatabaseFilesRequest-1.html +174 -0
- package/doc/variables/models.GetScheduleTablesFromDatabaseFilesResponse-1.html +174 -0
- package/doc/variables/models.GetServiceExtensionInfoRequest-1.html +174 -0
- package/doc/variables/models.GetServiceExtensionInfoResponse-1.html +174 -0
- package/doc/variables/models.GetSignalDataFromMessageDataRequest-1.html +174 -0
- package/doc/variables/models.GetSignalDataFromMessageDataResponse-1.html +174 -0
- package/doc/variables/models.GetSourceResponse-1.html +174 -0
- package/doc/variables/models.GetTargetResponse-1.html +174 -0
- package/doc/variables/models.IdentifierRequest-1.html +174 -0
- package/doc/variables/models.IdentifiersRequest-1.html +174 -0
- package/doc/variables/models.InstallServiceExtensionRequest-1.html +174 -0
- package/doc/variables/models.InterpreterSettings-1.html +174 -0
- package/doc/variables/models.J1939InterpreterSettings-1.html +174 -0
- package/doc/variables/models.LicenseInformation-1.html +174 -0
- package/doc/variables/models.Licenses-1.html +174 -0
- package/doc/variables/models.LinChannelConfiguration-1.html +174 -0
- package/doc/variables/models.LinFrameFlags-1.html +174 -0
- package/doc/variables/models.LogMessage-1.html +174 -0
- package/doc/variables/models.LogMessages-1.html +174 -0
- package/doc/variables/models.LogReplaySettings-1.html +174 -0
- package/doc/variables/models.LogReplaySettings_ChannelIdentifiersEntry-1.html +174 -0
- package/doc/variables/models.LogReplayStatus-1.html +174 -0
- package/doc/variables/models.MeasurementEventArgs-1.html +174 -0
- package/doc/variables/models.MeasurementSetup-1.html +174 -0
- package/doc/variables/models.MessageLoggerSettings-1.html +174 -0
- package/doc/variables/models.MessageLoggerStatus-1.html +174 -0
- package/doc/variables/models.NodeStatus-1.html +174 -0
- package/doc/variables/models.NodeStatuses-1.html +174 -0
- package/doc/variables/models.OnlineStatus-1.html +174 -0
- package/doc/variables/models.PeriodicTransmissionSettings-1.html +174 -0
- package/doc/variables/models.RequestLinMessageRequest-1.html +174 -0
- package/doc/variables/models.ScheduleTable-1.html +174 -0
- package/doc/variables/models.ScheduleTableEntry-1.html +174 -0
- package/doc/variables/models.SendLinWakeupFrameRequest-1.html +174 -0
- package/doc/variables/models.SendMessageRequest-1.html +174 -0
- package/doc/variables/models.ServiceExtensionSettings-1.html +174 -0
- package/doc/variables/models.SetLogLevelRequest-1.html +174 -0
- package/doc/variables/models.SetMeasurementSetupRequest-1.html +174 -0
- package/doc/variables/models.SetSignalDataToMessageDataRequest-1.html +174 -0
- package/doc/variables/models.SetSignalDataToMessageDataResponse-1.html +174 -0
- package/doc/variables/models.SignalDefinition-1.html +174 -0
- package/doc/variables/models.SignalDefinition_EnumValuesEntry-1.html +174 -0
- package/doc/variables/models.SignalDefinitions-1.html +174 -0
- package/doc/variables/models.SignalValue-1.html +174 -0
- package/doc/variables/models.SignalValueTrigger-1.html +174 -0
- package/doc/variables/models.SourceNodeProperties-1.html +174 -0
- package/doc/variables/models.StartPeriodicTransmissionRequest-1.html +174 -0
- package/doc/variables/models.StartPeriodicTransmissionResponse-1.html +174 -0
- package/doc/variables/models.TargetNodeProperties-1.html +174 -0
- package/doc/variables/models.TriggerSettings-1.html +174 -0
- package/doc/variables/models.UninstallServiceExtensionRequest-1.html +174 -0
- package/doc/variables/models.UpdateLinMessageRequest-1.html +174 -0
- package/doc/variables/models.WriteFrame-1.html +174 -0
- package/doc/variables/models.defaultUserSettings.html +175 -0
- package/package.json +129 -0
- package/scripts/createCanKingExtension.js +403 -0
- package/scripts/index.js +39 -0
- package/scripts/template/_.eslintrc.cjs +38 -0
- package/scripts/template/_.gitignore +24 -0
- package/scripts/template/_.npmrc +2 -0
- package/scripts/template/_.prettierrc +8 -0
- package/scripts/template/_.vscode/_launch.json +28 -0
- package/scripts/template/_index.html +15 -0
- package/scripts/template/_tsconfig.app.json +27 -0
- package/scripts/template/_tsconfig.json +11 -0
- package/scripts/template/_tsconfig.node.json +13 -0
- package/scripts/template/_vite.config.ts +7 -0
- package/scripts/template/src/App.tsx +12 -0
- package/scripts/template/src/WorkspaceView/index.tsx +47 -0
- package/scripts/template/src/main.css +9 -0
- package/scripts/template/src/main.tsx +19 -0
- package/scripts/template/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const commander = require('@commander-js/extra-typings');
|
|
6
|
+
const execSync = require('child_process').execSync;
|
|
7
|
+
const fs = require('fs-extra');
|
|
8
|
+
const os = require('os');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const semver = require('semver');
|
|
11
|
+
const spawn = require('cross-spawn');
|
|
12
|
+
const validateProjectName = require('validate-npm-package-name');
|
|
13
|
+
|
|
14
|
+
const packageJson = require('../package.json');
|
|
15
|
+
|
|
16
|
+
const kvaserRegistry = 'http://artifact.kvaser.se/artifactory/api/npm/libs-npm';
|
|
17
|
+
|
|
18
|
+
function init() {
|
|
19
|
+
let projectName;
|
|
20
|
+
|
|
21
|
+
const program = new commander.Command(`npx ${packageJson.name}`)
|
|
22
|
+
.description('Script for creating a new CanKing extension project')
|
|
23
|
+
.version(packageJson.version)
|
|
24
|
+
.argument(
|
|
25
|
+
'<project-name>',
|
|
26
|
+
'The project name. A new project folder with this name will be created in the current folder.',
|
|
27
|
+
)
|
|
28
|
+
.action(name => (projectName = name))
|
|
29
|
+
.usage(`${chalk.green('<project-name>')} [options]`)
|
|
30
|
+
.option('--view-name <string>', 'workspace view name', '')
|
|
31
|
+
.option('--desc <string>', 'project description', 'A CanKing GUI extension.')
|
|
32
|
+
.option('--author <string>', 'project author', '')
|
|
33
|
+
.option('--verbose', 'print additional logs')
|
|
34
|
+
.option('--force', 'use installed script even if a newer version exists')
|
|
35
|
+
.option('--show-doc', 'opens the documentation')
|
|
36
|
+
.allowUnknownOption()
|
|
37
|
+
.showHelpAfterError()
|
|
38
|
+
.parse(process.argv);
|
|
39
|
+
|
|
40
|
+
const options = program.opts();
|
|
41
|
+
|
|
42
|
+
if (options.viewName === '') {
|
|
43
|
+
options.viewName = projectName
|
|
44
|
+
.split('-')
|
|
45
|
+
.map(n => n.charAt(0).toUpperCase() + n.slice(1))
|
|
46
|
+
.join('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Set correct register for @kvaser scope
|
|
50
|
+
try {
|
|
51
|
+
execSync(`npm config set @kvaser:registry ${kvaserRegistry}`);
|
|
52
|
+
} catch {}
|
|
53
|
+
|
|
54
|
+
// We first check the registry directly via the API, and if that fails, we try
|
|
55
|
+
// the slower `npm view [package] version` command.
|
|
56
|
+
//
|
|
57
|
+
// This is important for users in environments where direct access to npm is
|
|
58
|
+
// blocked by a firewall, and packages are provided exclusively via a private
|
|
59
|
+
// registry.
|
|
60
|
+
checkForLatestVersion()
|
|
61
|
+
.catch(() => {
|
|
62
|
+
try {
|
|
63
|
+
return execSync('npm view @kvaser/create-canking-extension version').toString().trim();
|
|
64
|
+
} catch (e) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
.then(latest => {
|
|
69
|
+
if (!options.force && latest && semver.lt(packageJson.version, latest)) {
|
|
70
|
+
console.log();
|
|
71
|
+
console.error(
|
|
72
|
+
chalk.yellow(
|
|
73
|
+
`You are running \`create-canking-extension\` ${packageJson.version}, which is behind the latest release (${latest}).\n\n` +
|
|
74
|
+
'We recommend always using the latest version of create-canking-extension if possible.\n\n' +
|
|
75
|
+
'Use --force option to override if you want to use the old version.',
|
|
76
|
+
),
|
|
77
|
+
);
|
|
78
|
+
console.log();
|
|
79
|
+
} else {
|
|
80
|
+
try {
|
|
81
|
+
createExtension(projectName, options.viewName, options.desc, options.author, options.verbose);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.error(chalk.red(e));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function createExtension(name, viewName, description, author, verbose) {
|
|
90
|
+
const root = path.resolve(name);
|
|
91
|
+
const extensionName = path.basename(root);
|
|
92
|
+
|
|
93
|
+
checkExtensionName(extensionName);
|
|
94
|
+
fs.ensureDirSync(name);
|
|
95
|
+
if (!isSafeToCreateProjectIn(root, name)) {
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
console.log();
|
|
99
|
+
|
|
100
|
+
console.log(`Creating a new CanKing extension in ${chalk.green(root)}.`);
|
|
101
|
+
console.log();
|
|
102
|
+
|
|
103
|
+
const packageJson = {
|
|
104
|
+
name: extensionName,
|
|
105
|
+
version: '1.0.0',
|
|
106
|
+
description: description,
|
|
107
|
+
author: author,
|
|
108
|
+
canking: {
|
|
109
|
+
workspaceViewName: viewName,
|
|
110
|
+
types: ['WorkspaceView'],
|
|
111
|
+
},
|
|
112
|
+
private: true,
|
|
113
|
+
license: 'UNLICENSED',
|
|
114
|
+
type: 'module',
|
|
115
|
+
files: ['dist'],
|
|
116
|
+
scripts: {
|
|
117
|
+
start: 'npm-run-all --parallel dev canking',
|
|
118
|
+
startpreview: 'npm-run-all --parallel preview canking',
|
|
119
|
+
dev: 'vite --port 4000',
|
|
120
|
+
canking:
|
|
121
|
+
'cross-env "C:/Program Files/Kvaser CanKing/Kvaser CanKing.exe" --ck-debug-pkg "./package.json" --ck-debug-port 4000',
|
|
122
|
+
build: 'tsc -b && vite build',
|
|
123
|
+
lint: 'eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0',
|
|
124
|
+
prettier: 'prettier --config .prettierrc **/*.ts* --write',
|
|
125
|
+
preview: 'vite preview --port 4000',
|
|
126
|
+
prepack: 'npm run build',
|
|
127
|
+
prebuild: 'rimraf dist',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2) + os.EOL);
|
|
131
|
+
|
|
132
|
+
process.chdir(root);
|
|
133
|
+
|
|
134
|
+
// Copy templates
|
|
135
|
+
fs.copySync(path.join(__dirname, 'template', '_.vscode', '_launch.json'), path.join(root, '.vscode', 'launch.json'));
|
|
136
|
+
fs.copySync(
|
|
137
|
+
path.join(__dirname, 'template', 'src', 'WorkspaceView', 'index.tsx'),
|
|
138
|
+
path.join(root, 'src', 'WorkspaceView', 'index.tsx'),
|
|
139
|
+
);
|
|
140
|
+
fs.copySync(path.join(__dirname, 'template', 'src', 'App.tsx'), path.join(root, 'src', 'App.tsx'));
|
|
141
|
+
fs.copySync(path.join(__dirname, 'template', 'src', 'main.css'), path.join(root, 'src', 'main.css'));
|
|
142
|
+
fs.copySync(path.join(__dirname, 'template', 'src', 'main.tsx'), path.join(root, 'src', 'main.tsx'));
|
|
143
|
+
fs.copySync(path.join(__dirname, 'template', 'src', 'vite-env.d.ts'), path.join(root, 'src', 'vite-env.d.ts'));
|
|
144
|
+
fs.copySync(path.join(__dirname, 'template', '_.eslintrc.cjs'), path.join(root, '.eslintrc.cjs'));
|
|
145
|
+
fs.copySync(path.join(__dirname, 'template', '_.gitignore'), path.join(root, '.gitignore'));
|
|
146
|
+
fs.copySync(path.join(__dirname, 'template', '_.npmrc'), path.join(root, '.npmrc'));
|
|
147
|
+
fs.copySync(path.join(__dirname, 'template', '_.prettierrc'), path.join(root, '.prettierrc'));
|
|
148
|
+
fs.copySync(path.join(__dirname, 'template', '_index.html'), path.join(root, 'index.html'));
|
|
149
|
+
fs.copySync(path.join(__dirname, 'template', '_tsconfig.app.json'), path.join(root, 'tsconfig.app.json'));
|
|
150
|
+
fs.copySync(path.join(__dirname, 'template', '_tsconfig.json'), path.join(root, 'tsconfig.json'));
|
|
151
|
+
fs.copySync(path.join(__dirname, 'template', '_tsconfig.node.json'), path.join(root, 'tsconfig.node.json'));
|
|
152
|
+
fs.copySync(path.join(__dirname, 'template', '_vite.config.ts'), path.join(root, 'vite.config.ts'));
|
|
153
|
+
|
|
154
|
+
installDependencies(verbose)
|
|
155
|
+
.then(() => {
|
|
156
|
+
console.log();
|
|
157
|
+
console.log(`A project for extension ${extensionName} has been created successfully.`);
|
|
158
|
+
console.log();
|
|
159
|
+
})
|
|
160
|
+
.catch(reason => {
|
|
161
|
+
console.log();
|
|
162
|
+
console.log('Aborting installation.');
|
|
163
|
+
console.log(chalk.red('Unexpected error. Please report it as a bug:'));
|
|
164
|
+
console.log(reason);
|
|
165
|
+
console.log();
|
|
166
|
+
|
|
167
|
+
// On 'exit' we will delete these files from target directory.
|
|
168
|
+
const knownGeneratedFiles = [
|
|
169
|
+
'package.json',
|
|
170
|
+
'node_modules',
|
|
171
|
+
'.vscode',
|
|
172
|
+
'src',
|
|
173
|
+
'.eslintrc.cjs',
|
|
174
|
+
'.gitignore',
|
|
175
|
+
'.npmrc',
|
|
176
|
+
'.prettierrc',
|
|
177
|
+
'index.html',
|
|
178
|
+
'tsconfig.app.json',
|
|
179
|
+
'tsconfig.json',
|
|
180
|
+
'tsconfig.node.json',
|
|
181
|
+
'vite.config.ts',
|
|
182
|
+
];
|
|
183
|
+
const currentFiles = fs.readdirSync(path.join(root));
|
|
184
|
+
currentFiles.forEach(file => {
|
|
185
|
+
knownGeneratedFiles.forEach(fileToMatch => {
|
|
186
|
+
// This removes all knownGeneratedFiles.
|
|
187
|
+
if (file === fileToMatch) {
|
|
188
|
+
console.log(`Deleting generated file... ${chalk.cyan(file)}`);
|
|
189
|
+
fs.removeSync(path.join(root, file));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
const remainingFiles = fs.readdirSync(path.join(root));
|
|
194
|
+
if (!remainingFiles.length) {
|
|
195
|
+
// Delete target folder if empty
|
|
196
|
+
console.log(`Deleting ${chalk.cyan(`${extensionName}/`)} from ${chalk.cyan(path.resolve(root, '..'))}`);
|
|
197
|
+
process.chdir(path.resolve(root, '..'));
|
|
198
|
+
fs.removeSync(path.join(root));
|
|
199
|
+
}
|
|
200
|
+
console.log('Done.');
|
|
201
|
+
process.exit(1);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function installDev(dependencies, verbose) {
|
|
206
|
+
return new Promise((resolve, reject) => {
|
|
207
|
+
const command = 'npm';
|
|
208
|
+
const args = ['install', '--no-audit', '--no-fund', '--save-dev'].concat(dependencies);
|
|
209
|
+
|
|
210
|
+
if (verbose) {
|
|
211
|
+
args.push('--verbose');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const child = spawn(command, args, { stdio: 'inherit' });
|
|
215
|
+
child.on('close', code => {
|
|
216
|
+
if (code !== 0) {
|
|
217
|
+
reject({
|
|
218
|
+
command: `${command} ${args.join(' ')}`,
|
|
219
|
+
});
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
resolve();
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function install(dependencies, verbose) {
|
|
228
|
+
return new Promise((resolve, reject) => {
|
|
229
|
+
const command = 'npm';
|
|
230
|
+
const args = ['install', '--no-audit', '--no-fund', '--save'].concat(dependencies);
|
|
231
|
+
|
|
232
|
+
if (verbose) {
|
|
233
|
+
args.push('--verbose');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const child = spawn(command, args, { stdio: 'inherit' });
|
|
237
|
+
child.on('close', code => {
|
|
238
|
+
if (code !== 0) {
|
|
239
|
+
reject({
|
|
240
|
+
command: `${command} ${args.join(' ')}`,
|
|
241
|
+
});
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
resolve();
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function installDependencies(verbose) {
|
|
250
|
+
return Promise.resolve(
|
|
251
|
+
install(
|
|
252
|
+
[
|
|
253
|
+
'@emotion/react@^11.13.3',
|
|
254
|
+
'@emotion/styled@^11.13.0',
|
|
255
|
+
'@fontsource/roboto@^5.1.0',
|
|
256
|
+
'@kvaser/canking-api',
|
|
257
|
+
'@mui/material@^6.1.3',
|
|
258
|
+
'fast-deep-equal@^3.1.3',
|
|
259
|
+
'google-protobuf@^3.21.4',
|
|
260
|
+
'long@^5.2.3',
|
|
261
|
+
'react@^18.3.1',
|
|
262
|
+
'react-dom@^18.3.1',
|
|
263
|
+
'react-router-dom',
|
|
264
|
+
'uuid@^10.0.0',
|
|
265
|
+
],
|
|
266
|
+
verbose,
|
|
267
|
+
),
|
|
268
|
+
).then(() =>
|
|
269
|
+
installDev(
|
|
270
|
+
[
|
|
271
|
+
'@types/google-protobuf@^3.15.12',
|
|
272
|
+
'@types/node@^22.7.5',
|
|
273
|
+
'@types/react@^18.3.11',
|
|
274
|
+
'@types/react-dom@^18.3.1',
|
|
275
|
+
'@types/react-router-dom',
|
|
276
|
+
'@types/uuid@^10.0.0',
|
|
277
|
+
'@typescript-eslint/eslint-plugin@^8.9.0',
|
|
278
|
+
'@typescript-eslint/parser@^8.9.0',
|
|
279
|
+
'@vitejs/plugin-react-swc@^3.7.1',
|
|
280
|
+
'cross-env@^7.0.3',
|
|
281
|
+
'eslint@^9.12.0',
|
|
282
|
+
'eslint-config-prettier@^9.1.0',
|
|
283
|
+
'eslint-plugin-prettier@^5.2.1',
|
|
284
|
+
'eslint-plugin-react@^7.37.1',
|
|
285
|
+
'eslint-plugin-react-hooks@^5.0.0',
|
|
286
|
+
'npm-run-all',
|
|
287
|
+
'prettier@^3.3.3',
|
|
288
|
+
'rimraf@^6.0.1',
|
|
289
|
+
'typescript@^5.6.3',
|
|
290
|
+
'vite@^5.4.9',
|
|
291
|
+
],
|
|
292
|
+
verbose,
|
|
293
|
+
),
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function checkExtensionName(extensionName) {
|
|
298
|
+
const validationResult = validateProjectName(extensionName);
|
|
299
|
+
if (!validationResult.validForNewPackages) {
|
|
300
|
+
console.error(
|
|
301
|
+
chalk.red(
|
|
302
|
+
`Cannot create a project named ${chalk.green(`"${extensionName}"`)} because of npm naming restrictions:\n`,
|
|
303
|
+
),
|
|
304
|
+
);
|
|
305
|
+
[...(validationResult.errors || []), ...(validationResult.warnings || [])].forEach(error => {
|
|
306
|
+
console.error(chalk.red(` * ${error}`));
|
|
307
|
+
});
|
|
308
|
+
console.error(chalk.red('\nPlease choose a different project name.'));
|
|
309
|
+
process.exit(1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Checks if the destination folder is okay to use.
|
|
315
|
+
* @param root The project root folder
|
|
316
|
+
* @param name The project name
|
|
317
|
+
* @returns true if not conflicts exists
|
|
318
|
+
*/
|
|
319
|
+
function isSafeToCreateProjectIn(root, name) {
|
|
320
|
+
const validFiles = [
|
|
321
|
+
'.DS_Store',
|
|
322
|
+
'.git',
|
|
323
|
+
'.gitattributes',
|
|
324
|
+
'.gitignore',
|
|
325
|
+
'.gitlab-ci.yml',
|
|
326
|
+
'.hg',
|
|
327
|
+
'.hgcheck',
|
|
328
|
+
'.hgignore',
|
|
329
|
+
'.idea',
|
|
330
|
+
'.npmignore',
|
|
331
|
+
'.travis.yml',
|
|
332
|
+
'docs',
|
|
333
|
+
'LICENSE',
|
|
334
|
+
'README.md',
|
|
335
|
+
'mkdocs.yml',
|
|
336
|
+
'Thumbs.db',
|
|
337
|
+
];
|
|
338
|
+
// These files should be allowed to remain on a failed install, but then
|
|
339
|
+
// silently removed during the next create.
|
|
340
|
+
const errorLogFilePatterns = ['npm-debug.log'];
|
|
341
|
+
const isErrorLog = file => {
|
|
342
|
+
return errorLogFilePatterns.some(pattern => file.startsWith(pattern));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const conflicts = fs
|
|
346
|
+
.readdirSync(root)
|
|
347
|
+
.filter(file => !validFiles.includes(file))
|
|
348
|
+
// Don't treat log files from previous installation as conflicts
|
|
349
|
+
.filter(file => !isErrorLog(file));
|
|
350
|
+
|
|
351
|
+
if (conflicts.length > 0) {
|
|
352
|
+
console.log(`The directory ${chalk.green(name)} contains files that could conflict:`);
|
|
353
|
+
console.log();
|
|
354
|
+
for (const file of conflicts) {
|
|
355
|
+
try {
|
|
356
|
+
const stats = fs.lstatSync(path.join(root, file));
|
|
357
|
+
if (stats.isDirectory()) {
|
|
358
|
+
console.log(` ${chalk.blue(`${file}/`)}`);
|
|
359
|
+
} else {
|
|
360
|
+
console.log(` ${file}`);
|
|
361
|
+
}
|
|
362
|
+
} catch (e) {
|
|
363
|
+
console.log(` ${file}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
console.log();
|
|
367
|
+
console.log('Either try using a new directory name, or remove the files listed above.');
|
|
368
|
+
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Remove any log files from a previous installation.
|
|
373
|
+
fs.readdirSync(root).forEach(file => {
|
|
374
|
+
if (isErrorLog(file)) {
|
|
375
|
+
fs.removeSync(path.join(root, file));
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
return true;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function checkForLatestVersion() {
|
|
382
|
+
return new Promise((resolve, reject) => {
|
|
383
|
+
https
|
|
384
|
+
.get(`${kvaserRegistry}/-/package/%40kvaser/create-canking-extension/dist-tags`, res => {
|
|
385
|
+
if (res.statusCode === 200) {
|
|
386
|
+
let body = '';
|
|
387
|
+
res.on('data', data => (body += data));
|
|
388
|
+
res.on('end', () => {
|
|
389
|
+
resolve(JSON.parse(body).latest);
|
|
390
|
+
});
|
|
391
|
+
} else {
|
|
392
|
+
reject();
|
|
393
|
+
}
|
|
394
|
+
})
|
|
395
|
+
.on('error', () => {
|
|
396
|
+
reject();
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
module.exports = {
|
|
402
|
+
init,
|
|
403
|
+
};
|
package/scripts/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const lowestMajorNodeVersion = 18;
|
|
6
|
+
const currentNodeVersion = process.versions.node;
|
|
7
|
+
const semver = currentNodeVersion.split('.');
|
|
8
|
+
const major = semver[0];
|
|
9
|
+
|
|
10
|
+
const chalk = require('chalk');
|
|
11
|
+
|
|
12
|
+
if (major < lowestMajorNodeVersion) {
|
|
13
|
+
console.error(
|
|
14
|
+
chalk.red(
|
|
15
|
+
'You are running Node ' +
|
|
16
|
+
currentNodeVersion +
|
|
17
|
+
'.\n' +
|
|
18
|
+
`Create CanKing Extension requires Node ${lowestMajorNodeVersion} or higher. \n` +
|
|
19
|
+
'Please update your version of Node.',
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (process.argv.length === 3 && process.argv[2] === '--show-doc') {
|
|
26
|
+
try {
|
|
27
|
+
(async () => {
|
|
28
|
+
const open = (await import('open')).default;
|
|
29
|
+
const path = require('path');
|
|
30
|
+
const filePath = path.join(__dirname, '../doc/index.html');
|
|
31
|
+
open(filePath);
|
|
32
|
+
})();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error(chalk.red(error));
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
const { init } = require('./createCanKingExtension');
|
|
38
|
+
init();
|
|
39
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: { browser: true, es2020: true },
|
|
4
|
+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:react/recommended'],
|
|
5
|
+
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
6
|
+
parser: '@typescript-eslint/parser',
|
|
7
|
+
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
|
|
8
|
+
rules: {
|
|
9
|
+
'import/no-extraneous-dependencies': 'off',
|
|
10
|
+
'react/react-in-jsx-scope': 'off',
|
|
11
|
+
'react/jsx-filename-extension': 'off',
|
|
12
|
+
'import/extensions': 'off',
|
|
13
|
+
'import/no-unresolved': 'off',
|
|
14
|
+
'import/no-import-module-exports': 'off',
|
|
15
|
+
'no-shadow': 'off',
|
|
16
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
17
|
+
'no-unused-vars': 'off',
|
|
18
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
19
|
+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
20
|
+
quotes: [2, 'single', { avoidEscape: true }],
|
|
21
|
+
'react/prop-types': 'off',
|
|
22
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
23
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
24
|
+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
|
|
25
|
+
},
|
|
26
|
+
settings: {
|
|
27
|
+
react: {
|
|
28
|
+
version: 'detect',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
parserOptions: {
|
|
32
|
+
ecmaVersion: 'latest',
|
|
33
|
+
sourceType: 'module',
|
|
34
|
+
ecmaFeatures: {
|
|
35
|
+
jsx: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
dist
|
|
12
|
+
dist-ssr
|
|
13
|
+
*.local
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
.idea
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.suo
|
|
21
|
+
*.ntvs*
|
|
22
|
+
*.njsproj
|
|
23
|
+
*.sln
|
|
24
|
+
*.sw?
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Dev Server",
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"runtimeExecutable": "npm",
|
|
12
|
+
"runtimeArgs": ["run", "dev"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "CanKing",
|
|
16
|
+
"type": "node",
|
|
17
|
+
"request": "launch",
|
|
18
|
+
"runtimeExecutable": "npm",
|
|
19
|
+
"runtimeArgs": ["run", "canking"]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"compounds": [
|
|
23
|
+
{
|
|
24
|
+
"name": "Debug",
|
|
25
|
+
"configurations": ["Dev Server", "CanKing"]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>CanKing Extension Template</title>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
13
|
+
</body>
|
|
14
|
+
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"useDefineForClassFields": true,
|
|
7
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
8
|
+
"module": "ESNext",
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"moduleDetection": "force",
|
|
17
|
+
"noEmit": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
|
|
20
|
+
/* Linting */
|
|
21
|
+
"strict": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"noFallthroughCasesInSwitch": true
|
|
25
|
+
},
|
|
26
|
+
"include": ["src"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noEmit": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["vite.config.ts"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useSearchParams } from 'react-router-dom';
|
|
2
|
+
import { useProjectData } from '@kvaser/canking-api/hooks';
|
|
3
|
+
import { CanChannelSelectControl } from '@kvaser/canking-api/controls';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
5
|
+
|
|
6
|
+
// If any data should be stored in the project file then add it to this interface
|
|
7
|
+
interface IProjectViewData {
|
|
8
|
+
// This is an example showing how to store the selected channel id to the project file
|
|
9
|
+
channelId: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Define any default values for the project data that will be used when the component is created
|
|
13
|
+
const defaultProjectViewData: IProjectViewData = {
|
|
14
|
+
channelId: '',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// This component is the component that will be loaded into the Workspace view
|
|
18
|
+
function WorkspaceView() {
|
|
19
|
+
// Get this view's unique id from search params
|
|
20
|
+
const [searchParams] = useSearchParams();
|
|
21
|
+
const idString = searchParams.get('id');
|
|
22
|
+
const id = idString !== null ? Number.parseInt(idString, 10) : -1;
|
|
23
|
+
|
|
24
|
+
// Use the useProjectData hook to serialize/deserialize your view data to the project
|
|
25
|
+
const { projectData, setProjectData } = useProjectData<IProjectViewData>(id, defaultProjectViewData);
|
|
26
|
+
|
|
27
|
+
// A callback that will get the new selected channel id and save it to the project data
|
|
28
|
+
const onChannelIdentifierChange = (channelId: string) => {
|
|
29
|
+
const data = { ...projectData };
|
|
30
|
+
data.channelId = channelId;
|
|
31
|
+
setProjectData(data);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Box aria-label="can-channel-select-extension-view">
|
|
36
|
+
<div>Add your elements here!</div>
|
|
37
|
+
<div>This is an example how to use the CanChannelSelectControl:</div>
|
|
38
|
+
<CanChannelSelectControl
|
|
39
|
+
channelIdentifier={projectData.channelId}
|
|
40
|
+
onChannelIdentifierChange={onChannelIdentifierChange}
|
|
41
|
+
hideSectionControl
|
|
42
|
+
/>
|
|
43
|
+
</Box>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default WorkspaceView;
|