Sorry, the diff of this file is not supported yet
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="Encoding"> | ||
| <file url="PROJECT" charset="UTF-8" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="JavaScriptLibraryMappings"> | ||
| <file url="file://$PROJECT_DIR$" libraries="{json2pb node_modules}" /> | ||
| <includedPredefinedLibrary name="ECMAScript 6" /> | ||
| </component> | ||
| </project> |
Sorry, the diff of this file is not supported yet
| <component name="libraryTable"> | ||
| <library name="json2pb node_modules" type="javaScript"> | ||
| <properties> | ||
| <option name="frameworkName" value="node_modules" /> | ||
| <sourceFilesUrls> | ||
| <item url="file://$PROJECT_DIR$/node_modules" /> | ||
| </sourceFilesUrls> | ||
| </properties> | ||
| <CLASSES> | ||
| <root url="file://$PROJECT_DIR$/node_modules" /> | ||
| </CLASSES> | ||
| <SOURCES /> | ||
| </library> | ||
| </component> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="JavaScriptSettings"> | ||
| <option name="languageLevel" value="ES6" /> | ||
| </component> | ||
| <component name="ProjectLevelVcsManager" settingsEditedManually="false"> | ||
| <OptionsSetting value="true" id="Add" /> | ||
| <OptionsSetting value="true" id="Remove" /> | ||
| <OptionsSetting value="true" id="Checkout" /> | ||
| <OptionsSetting value="true" id="Update" /> | ||
| <OptionsSetting value="true" id="Status" /> | ||
| <OptionsSetting value="true" id="Edit" /> | ||
| <ConfirmationsSetting value="0" id="Add" /> | ||
| <ConfirmationsSetting value="0" id="Remove" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ProjectModuleManager"> | ||
| <modules> | ||
| <module fileurl="file://$PROJECT_DIR$/.idea/json2pb.iml" filepath="$PROJECT_DIR$/.idea/json2pb.iml" /> | ||
| </modules> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="VcsDirectoryMappings"> | ||
| <mapping directory="$PROJECT_DIR$" vcs="Git" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ProjectTasksOptions" suppressed-tasks="Babel" /> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ChangeListManager"> | ||
| <list default="true" id="de11125e-41a9-41cb-934b-99adb42f048e" name="Default" comment=""> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" /> | ||
| </list> | ||
| <ignored path="json2pb.iws" /> | ||
| <ignored path=".idea/workspace.xml" /> | ||
| <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | ||
| <option name="TRACKING_ENABLED" value="true" /> | ||
| <option name="SHOW_DIALOG" value="false" /> | ||
| <option name="HIGHLIGHT_CONFLICTS" value="true" /> | ||
| <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | ||
| <option name="LAST_RESOLUTION" value="IGNORE" /> | ||
| </component> | ||
| <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> | ||
| <component name="CreatePatchCommitExecutor"> | ||
| <option name="PATCH_PATH" value="" /> | ||
| </component> | ||
| <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> | ||
| <component name="FavoritesManager"> | ||
| <favorites_list name="json2pb" /> | ||
| </component> | ||
| <component name="FileEditorManager"> | ||
| <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> | ||
| <file leaf-file-name="json2pb" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/bin/json2pb"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="16" column="33" selection-start-line="16" selection-start-column="33" selection-end-line="16" selection-end-column="33" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="json2pb.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/src/json2pb.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="29" column="102" selection-start-line="29" selection-start-column="102" selection-end-line="29" selection-end-column="102" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="packer.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/src/packer.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="70" column="0" selection-start-line="70" selection-start-column="0" selection-end-line="70" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="README.md" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/README.md"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="-1.3571428"> | ||
| <caret line="99" column="0" selection-start-line="99" selection-start-column="0" selection-end-line="99" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="example.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/examples/example.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" /> | ||
| <folding> | ||
| <element signature="e#0#41#0" expanded="false" /> | ||
| </folding> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="package.json" pinned="false" current-in-tab="true"> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.07480315"> | ||
| <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| </leaf> | ||
| </component> | ||
| <component name="FileTemplateManagerImpl"> | ||
| <option name="RECENT_TEMPLATES"> | ||
| <list> | ||
| <option value="JavaScript File" /> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="Git.Settings"> | ||
| <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> | ||
| </component> | ||
| <component name="IdeDocumentHistory"> | ||
| <option name="CHANGED_PATHS"> | ||
| <list> | ||
| <option value="$PROJECT_DIR$/src/jparser.js" /> | ||
| <option value="$PROJECT_DIR$/bin/json2pb" /> | ||
| <option value="$PROJECT_DIR$/src/packer.js" /> | ||
| <option value="$PROJECT_DIR$/src/json2pb.js" /> | ||
| <option value="$PROJECT_DIR$/examples/example.js" /> | ||
| <option value="$PROJECT_DIR$/package.json" /> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="JsBuildToolGruntFileManager" detection-done="true" /> | ||
| <component name="JsBuildToolPackageJson" detection-done="true"> | ||
| <package-json value="$PROJECT_DIR$/package.json" /> | ||
| </component> | ||
| <component name="JsGulpfileManager"> | ||
| <detection-done>true</detection-done> | ||
| </component> | ||
| <component name="ProjectFrameBounds"> | ||
| <option name="x" value="-8" /> | ||
| <option name="y" value="-8" /> | ||
| <option name="width" value="1936" /> | ||
| <option name="height" value="1056" /> | ||
| </component> | ||
| <component name="ProjectLevelVcsManager" settingsEditedManually="false"> | ||
| <OptionsSetting value="true" id="Add" /> | ||
| <OptionsSetting value="true" id="Remove" /> | ||
| <OptionsSetting value="true" id="Checkout" /> | ||
| <OptionsSetting value="true" id="Update" /> | ||
| <OptionsSetting value="true" id="Status" /> | ||
| <OptionsSetting value="true" id="Edit" /> | ||
| <ConfirmationsSetting value="1" id="Add" /> | ||
| <ConfirmationsSetting value="0" id="Remove" /> | ||
| </component> | ||
| <component name="ProjectView"> | ||
| <navigator currentView="ProjectPane" proportions="" version="1"> | ||
| <flattenPackages /> | ||
| <showMembers /> | ||
| <showModules /> | ||
| <showLibraryContents /> | ||
| <hideEmptyPackages /> | ||
| <abbreviatePackageNames /> | ||
| <autoscrollToSource /> | ||
| <autoscrollFromSource /> | ||
| <sortByType /> | ||
| <manualOrder /> | ||
| <foldersAlwaysOnTop value="true" /> | ||
| </navigator> | ||
| <panes> | ||
| <pane id="Scratches" /> | ||
| <pane id="ProjectPane"> | ||
| <subPane> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="src" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="examples" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="json2pb" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="bin" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| </subPane> | ||
| </pane> | ||
| <pane id="Scope" /> | ||
| </panes> | ||
| </component> | ||
| <component name="PropertiesComponent"> | ||
| <property name="last_opened_file_path" value="$PROJECT_DIR$" /> | ||
| <property name="WebServerToolWindowFactoryState" value="false" /> | ||
| <property name="settings.editor.selected.configurable" value="Settings.JavaScript" /> | ||
| <property name="JavaScriptPreferStrict" value="false" /> | ||
| <property name="JavaScriptWeakerCompletionTypeGuess" value="true" /> | ||
| <property name="settings.editor.splitter.proportion" value="0.2" /> | ||
| <property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" /> | ||
| <property name="HbShouldOpenHtmlAsHb" value="" /> | ||
| <property name="restartRequiresConfirmation" value="false" /> | ||
| </component> | ||
| <component name="RunManager" selected="Node.js.example.js"> | ||
| <configuration default="false" name="json2pb" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-node="C:/Program Files/nodejs/node" path-to-js-file="json2pb" application-parameters="-n json2pb -p D:\github\json2pb\examples\motion.proto D:\github\json2pb\examples\motion.json" working-dir="$PROJECT_DIR$/bin"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="false" name="example.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-node="C:/Program Files/nodejs/node" path-to-js-file="example.js" working-dir="$PROJECT_DIR$/examples"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file=""> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir=""> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="cucumber.js" factoryName="Cucumber.js"> | ||
| <option name="cucumberJsArguments" value="" /> | ||
| <option name="executablePath" /> | ||
| <option name="filePath" /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> | ||
| <node-options /> | ||
| <gulpfile /> | ||
| <tasks /> | ||
| <arguments /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.npm" factoryName="npm"> | ||
| <command value="run-script" /> | ||
| <scripts /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha"> | ||
| <node-options /> | ||
| <working-directory>$PROJECT_DIR$</working-directory> | ||
| <pass-parent-env>true</pass-parent-env> | ||
| <envs /> | ||
| <ui>bdd</ui> | ||
| <extra-mocha-options /> | ||
| <test-kind>DIRECTORY</test-kind> | ||
| <test-directory /> | ||
| <recursive>false</recursive> | ||
| <method /> | ||
| </configuration> | ||
| <list size="2"> | ||
| <item index="0" class="java.lang.String" itemvalue="Node.js.json2pb" /> | ||
| <item index="1" class="java.lang.String" itemvalue="Node.js.example.js" /> | ||
| </list> | ||
| <recent_temporary> | ||
| <list size="2"> | ||
| <item index="0" class="java.lang.String" itemvalue="Node.js.example.js" /> | ||
| <item index="1" class="java.lang.String" itemvalue="Node.js.json2pb" /> | ||
| </list> | ||
| </recent_temporary> | ||
| </component> | ||
| <component name="ShelveChangesManager" show_recycled="false" /> | ||
| <component name="TaskManager"> | ||
| <task active="true" id="Default" summary="Default task"> | ||
| <changelist id="de11125e-41a9-41cb-934b-99adb42f048e" name="Default" comment="" /> | ||
| <created>1461421569310</created> | ||
| <option name="number" value="Default" /> | ||
| <updated>1461421569310</updated> | ||
| </task> | ||
| <servers /> | ||
| </component> | ||
| <component name="ToolWindowManager"> | ||
| <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" /> | ||
| <editor active="true" /> | ||
| <layout> | ||
| <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24791667" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | ||
| <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4027484" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | ||
| <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| </layout> | ||
| </component> | ||
| <component name="VcsContentAnnotationSettings"> | ||
| <option name="myLimit" value="2678400000" /> | ||
| </component> | ||
| <component name="XDebuggerManager"> | ||
| <breakpoint-manager> | ||
| <option name="time" value="47" /> | ||
| </breakpoint-manager> | ||
| <watches-manager /> | ||
| </component> | ||
| <component name="editorHistoryManager"> | ||
| <entry file="file://$PROJECT_DIR$/bin/json2pb"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="16" column="0" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/src/json2pb.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="85" column="0" selection-start-line="85" selection-start-column="0" selection-end-line="85" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/src/packer.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/node_modules/protobufjs/dist/protobuf.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.7075099"> | ||
| <caret line="5156" column="23" selection-start-line="5156" selection-start-column="13" selection-end-line="5156" selection-end-column="23" /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/bin/json2pb"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="16" column="33" selection-start-line="16" selection-start-column="33" selection-end-line="16" selection-end-column="33" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/src/json2pb.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="29" column="102" selection-start-line="29" selection-start-column="102" selection-end-line="29" selection-end-column="102" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/src/packer.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="70" column="0" selection-start-line="70" selection-start-column="0" selection-end-line="70" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/README.md"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="-1.3571428"> | ||
| <caret line="99" column="0" selection-start-line="99" selection-start-column="0" selection-end-line="99" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/examples/example.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.0"> | ||
| <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" /> | ||
| <folding> | ||
| <element signature="e#0#41#0" expanded="false" /> | ||
| </folding> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state vertical-scroll-proportion="0.07480315"> | ||
| <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </component> | ||
| </project> |
| /** | ||
| * Created by randy on 2016/4/24. | ||
| */ | ||
| ProtoBuf = require("protobufjs"), | ||
| fs = require('fs'); | ||
| var builder = ProtoBuf.newBuilder({ convertFieldsToCamelCase: false }); | ||
| ProtoBuf.loadProtoFile(__dirname + '/motion.proto', builder); | ||
| var root = builder.build(''); | ||
| var buffer = fs.readFileSync(__dirname + '/motion.pb'); | ||
| var motion = root.motion.decode(buffer); | ||
| console.log(motion.encodeJSON()); |
Sorry, the diff of this file is not supported yet
| syntax = "proto3"; | ||
| message motion_row { | ||
| int32 motion_id = 1; | ||
| string name = 2; | ||
| repeated string privileges = 3; | ||
| string type = 4; | ||
| string category = 5; | ||
| } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| /** | ||
| * Created by randy on 2016/4/17. | ||
| */ | ||
| 'use strict'; | ||
| var fs = require('co-fs'), | ||
| path = require('path'), | ||
| util = require('util'), | ||
| pkg = require('../package.json'); | ||
| var packer = module.exports = { }; | ||
| packer.tag = '_message'; | ||
| packer.root = null; | ||
| packer.stack = []; | ||
| packer.json2pb = function*(obj) { | ||
| packer.stack.push(obj); | ||
| var message_name = obj[packer.tag]; | ||
| if((message_name == undefined) || (message_name == null)) { | ||
| throw new Error(util.format('[%s] not exists.', packer.tag)); | ||
| } | ||
| var T = packer.root[message_name]; | ||
| if((T == undefined) || (T == null)) { | ||
| throw new Error(util.format('Message [%s] not exists.', message_name)); | ||
| } | ||
| var pbo = new T(); | ||
| for(var field of pbo.$type.children) | ||
| { | ||
| var fjo = obj[field.name]; | ||
| if(field.required) { | ||
| if(fjo == undefined) { | ||
| throw new Error(util.format('Missing required field [%s].', field.name)); | ||
| } | ||
| } | ||
| if(fjo == undefined) { | ||
| continue; | ||
| } | ||
| var field_type = field.resolvedType; | ||
| if(field.repeated) { | ||
| for(var entity of fjo) { | ||
| var fpbo = null; | ||
| if(field_type == null) { | ||
| fpbo = entity; | ||
| } else if(field_type.className == "Message") { | ||
| fpbo = yield packer.json2pb(entity); | ||
| } | ||
| if(fpbo == null) { | ||
| throw new Error('Object parse failed.'); | ||
| } | ||
| pbo[field.name].push(fpbo) | ||
| } | ||
| } else { | ||
| var fpbo = null; | ||
| if(field_type == null) { | ||
| fpbo = fjo; | ||
| } else if(field_type.className == "Message") { | ||
| fpbo = yield packer.json2pb(fjo); | ||
| } | ||
| if(fpbo == null) { | ||
| throw new Error('Object parse failed.'); | ||
| } | ||
| pbo[field.name] = fpbo; | ||
| } | ||
| } | ||
| packer.stack.pop(); | ||
| return pbo; | ||
| }; |
| syntax = "proto3"; | ||
| package json2pb; | ||
| import "motion_row.proto"; | ||
| message motion_row { | ||
| int32 motion_id = 1; | ||
| string name = 2; | ||
| repeated string privileges = 3; | ||
| string type = 4; | ||
| string category = 5; | ||
| } | ||
@@ -12,0 +5,0 @@ message motion { |
+1
-1
| { | ||
| "name": "json2pb", | ||
| "version": "1.1.2", | ||
| "version": "1.1.4", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Randy Liu <randyliu@foxmail.com>", |
+98
-1
| # json2pb | ||
| Json2pb is a command line tool for converting json files to protobuf encoding file. | ||
| Json2pb是一个可以把json对象转换为Protobuf编码的命令行工具。 | ||
| 如果每一个json对象都含有_message字段来说明这个对象的类型 | ||
| 那么把Json对象用Protobuf打包只需要输入:json2pb -pmotion.proto motion.json | ||
| *想要把csv文件打包的朋友们, 可以先用[evalcsv](https://github.com/randyliu/evalcsv.git)把csv文件转换为json对象。* | ||
| Install | ||
| ------- | ||
| 1. Install [node.js](https://nodejs.org) | ||
| 2. Install with [npm](https://npmjs.org/package/json2pb) | ||
| ``` | ||
| npm install -g json2pb | ||
| ``` | ||
| Usage | ||
| ----- | ||
| Usage: json2pb [options] files | ||
| Options: | ||
| -h, --help Display this information. | ||
| -v, --version Print the compiler version. | ||
| -t, --tag The tag of storing message name, default is _message | ||
| -n, --namespace Set the namespace to be built. | ||
| -p, --proto Specify the .proto file for searching class name. | ||
| Example | ||
| ------- | ||
| - 每一个json对象必须含有一个_message字段来说明这个对象的类型。 | ||
| motion.json: | ||
| { | ||
| "_message": "motion", | ||
| "rows": [ | ||
| { | ||
| "motion_id": 11001, | ||
| "name": "跪姿肩部下沉", | ||
| "privileges": [ | ||
| "owner", | ||
| "admin", | ||
| "user", | ||
| "guest" | ||
| ], | ||
| "type": "热身", | ||
| "category": "胸", | ||
| "_message": "motion_row" | ||
| }, | ||
| { | ||
| "motion_id": 11002, | ||
| "name": "直体肩部下沉", | ||
| "privileges": [ | ||
| "owner", | ||
| "admin", | ||
| "user", | ||
| "guest" | ||
| ], | ||
| "type": "热身", | ||
| "category": "胸", | ||
| "_message": "motion_row" | ||
| } | ||
| ] | ||
| } | ||
| motion.proto: | ||
| syntax = "proto3"; | ||
| message motion_row { | ||
| int32 motion_id = 1; | ||
| string name = 2; | ||
| repeated string privileges = 3; | ||
| string type = 4; | ||
| string category = 5; | ||
| } | ||
| message motion { | ||
| repeated motion_row rows = 1; | ||
| } | ||
| command line: | ||
| json2pb -pmotion.proto motion.json | ||
| Author | ||
| ------ | ||
| [@randyliu](http://github.com/randyliu) | ||
| Licence | ||
| ------- | ||
| [See the MIT License](https://opensource.org/licenses/MIT) |
+36
-45
| 'use strict'; | ||
| var mod_getopt = require('posix-getopt'), | ||
| pkg = require('../package.json'), | ||
| path = require('path'), | ||
| jparser = require('./jparser.js'), | ||
| ProtoBuf = require("protobufjs"), | ||
| packer = require('./packer.js'), | ||
| cofs = require('co-fs'), | ||
| ejs = require('ejs'); | ||
| var namespace = pkg['name']; | ||
| var json2pb = module.exports = {}; | ||
| var json2proto = module.exports = {}; | ||
| function version() | ||
@@ -25,19 +24,17 @@ { | ||
| { | ||
| console.error("Usage: %s [options] file", pkg['name']); | ||
| console.error("Usage: %s [options] files", pkg['name']); | ||
| console.error("Options:"); | ||
| console.error(" -h, --help Display this information."); | ||
| console.error(" -v, --version Print the compiler version."); | ||
| console.error(" -o, --output Set the output file name."); | ||
| console.error(" -a, --auto Automatically generate a title for unnamed object."); | ||
| console.error(" -p, --prefix Set the class name prefix, default prefix is %s", pkg['name']); | ||
| console.error(" -n, --namespace Set the namespace, default namespace is %s", namespace); | ||
| console.error(" -t, --title_tag Specify the title_tag for searching class name, default title is \"_title\"."); | ||
| console.error(" -t, --tag The tag of storing message name, default is %s", packer.tag); | ||
| console.error(" -n, --namespace Set the namespace to be built."); | ||
| console.error(" -p, --proto Specify the .proto file for searching class name."); | ||
| } | ||
| json2proto.main = function*(argv) { | ||
| json2pb.main = function*(argv) { | ||
| var parser, option; | ||
| var output_file = null; | ||
| var builder = ProtoBuf.newBuilder({ convertFieldsToCamelCase: false }); | ||
| parser = new mod_getopt.BasicParser('v(version)h(help)t:(title)n:(namespace)p:(prefix)a(auto)o:(output)', argv); | ||
| parser = new mod_getopt.BasicParser('v(version)h(help)t:(tag)n:(namespace)p:(proto)', argv); | ||
| var namespace = ''; | ||
| while ((option = parser.getopt()) !== undefined) { | ||
@@ -51,16 +48,10 @@ switch (option.option) { | ||
| return 0; | ||
| case 'p': | ||
| jparser.prefix = option.optarg; | ||
| break; | ||
| case 'n': | ||
| namespace = option.optarg; | ||
| break; | ||
| case 'a': | ||
| jparser.auto = true; | ||
| break; | ||
| case 't': | ||
| jparser.title_tag = option.optarg; | ||
| packer.tag = option.optarg; | ||
| break; | ||
| case 'o': | ||
| output_file = option.optarg; | ||
| case 'p': | ||
| ProtoBuf.loadProtoFile(option.optarg, builder); | ||
| break; | ||
@@ -74,30 +65,30 @@ default: | ||
| if (parser.optind() >= argv.length) { | ||
| usage('missing required argument: "input"'); | ||
| console.error('Missing required argument: "input"'); | ||
| usage(); | ||
| return 1; | ||
| } | ||
| packer.root = builder.build(namespace); | ||
| if(packer.root == null) | ||
| { | ||
| console.error('Missing --proto=[protobuf .proto file].'); | ||
| usage(); | ||
| return 1; | ||
| } | ||
| //1.推测结构体名和确定类型。 | ||
| for(var i = parser.optind(); i < argv.length; ++i) { | ||
| var object = yield jparser.parse(argv[i]); | ||
| if(jparser.auto) { | ||
| var inf = argv[i]; | ||
| var outf = null; | ||
| if(inf.substring(inf.length - 5, inf.length) == '.json') { | ||
| //Json Object with Title | ||
| outf = inf.substring(0, inf.length - 5) + '.jot'; | ||
| } else { | ||
| outf = inf + '.jot'; | ||
| } | ||
| yield cofs.writeFile(outf, JSON.stringify(object), 'utf8'); | ||
| var input_file = argv[i]; | ||
| var output_file = null; | ||
| if (input_file.substring(input_file.length - 5, input_file.length) == '.json') { | ||
| output_file = input_file.substring(0, input_file.length - 5) + '.pb'; | ||
| } else { | ||
| output_file = input_file + '.pb'; | ||
| } | ||
| } | ||
| if(output_file != null) { | ||
| var schema = { | ||
| namespace : namespace, | ||
| definitions : jparser.definitions() | ||
| }; | ||
| var str = yield cofs.readFile(path.join(__dirname, '../ejs', 'protobuf.ejs'), 'utf8'); | ||
| var proto = ejs.render(str, { schema }); | ||
| yield cofs.writeFile(output_file, proto, 'utf8'); | ||
| var str = yield cofs.readFile(input_file, 'utf8'); | ||
| var obj = JSON.parse(str); | ||
| var pbobj = yield packer.json2pb(obj); | ||
| var byteBuffer = pbobj.encode(); | ||
| var buffer = byteBuffer.toBuffer(); | ||
| yield cofs.writeFile(output_file, buffer); | ||
| yield cofs.chmod(output_file, 438); | ||
@@ -104,0 +95,0 @@ } |
-292
| /** | ||
| * Created by randy on 2016/4/17. | ||
| */ | ||
| 'use strict'; | ||
| var INT32_MIN = -2147483648; | ||
| var INT32_MAX = 2147483647; | ||
| var UINT32_MAX = 4294967295; | ||
| var INT64_MIN = -9223372036854775808; | ||
| var INT64_MAX = 9223372036854775807; | ||
| var UINT64_MAX = 18446744073709551615; | ||
| var reserved_words = new Set(["boolean", "string", "number", "array"]); | ||
| var fs = require('co-fs'), | ||
| path = require('path'), | ||
| pkg = require('../package.json'); | ||
| var jparser = module.exports = {}; | ||
| jparser.symbol_sequence = []; | ||
| jparser.symbols = new Map(); | ||
| jparser.auto = false; | ||
| jparser.title_tag = "_title"; | ||
| jparser.prefix = pkg['name']; | ||
| function getTitle(object, root) { | ||
| var title = object[jparser.title_tag]; | ||
| if(reserved_words.has(title)) { | ||
| throw new Error(); | ||
| } | ||
| if(title == undefined) { | ||
| if(jparser.auto) { | ||
| title = root; | ||
| } else { | ||
| throw new Error(); | ||
| } | ||
| } | ||
| if((title == undefined) || (title == null)) { | ||
| throw new Error(); | ||
| } | ||
| return title; | ||
| } | ||
| function getHash(object) { | ||
| if(object[jparser.title_tag] != undefined) { | ||
| return object[jparser.title_tag]; | ||
| } | ||
| var t = ''; | ||
| for(var key in object) { | ||
| if(key == jparser.title_tag) { | ||
| continue; | ||
| } | ||
| t += '_' + key; | ||
| } | ||
| return t; | ||
| } | ||
| //通过值和路径来推测类型 | ||
| function getProperty(value) { | ||
| var property = {}; | ||
| if(typeof value == "boolean") { | ||
| property.type = "boolean"; | ||
| } else if(typeof value == "string") { | ||
| property.type = "string"; | ||
| property.string_length = value.length; | ||
| } else if(typeof value == "number") { | ||
| property.type = "number"; | ||
| property.min_number = value; | ||
| property.max_number = value; | ||
| property.is_integer = Number.isInteger(value); | ||
| } else if(typeof value == "object") { | ||
| if(value instanceof Array) { | ||
| property.type = "array"; | ||
| property.array_length = value.length; | ||
| if(value.length <= 0) { | ||
| throw new Error(); | ||
| } | ||
| if(value[0] instanceof Array) { | ||
| throw new Error(); | ||
| } | ||
| //value[0]已经被search过 | ||
| property.array_type = getProperty(value[0]); | ||
| for(var i = 1; i < value.length; ++i) { | ||
| if(value[i] == null) { | ||
| continue; | ||
| } | ||
| var p = getProperty(value[i]); | ||
| updateProperty(property.array_type, p); | ||
| } | ||
| if((property.array_type == undefined) || (property.array_type == null)){ | ||
| throw new Error(); | ||
| } | ||
| } else { | ||
| //value已经被search过 | ||
| property.type = value[jparser.title_tag]; | ||
| if((property.type == undefined) || (property.type == null)) { | ||
| throw new Error(); | ||
| } | ||
| } | ||
| } | ||
| return property; | ||
| } | ||
| //把target的类型更新为更大的类型 | ||
| function updateProperty(target, property) { | ||
| if(property.type == "string") { | ||
| if(property.string_length > target.string_length) { | ||
| target.string_length = property.string_length; | ||
| } | ||
| } else if(property.type == "number") { | ||
| if(property.min_number < target.min_number) { | ||
| target.min_number = property.min_number; | ||
| } | ||
| if(property.max_number > target.max_number) { | ||
| target.max_number = property.max_number; | ||
| } | ||
| if(!property.is_integer) { | ||
| target.is_integer = false; | ||
| } | ||
| } else if(property.type == "array") { | ||
| if(property.array_length > target.array_length) { | ||
| target.array_length = property.array_length; | ||
| } | ||
| //数组内不可以包含数组 | ||
| updateProperty(target.array_type, property.array_type) | ||
| } | ||
| } | ||
| function search(object, root) { | ||
| var hash = ''; | ||
| var title = null; | ||
| if(object[jparser.title_tag] == undefined) { | ||
| if(!jparser.auto) { | ||
| throw new Error(); | ||
| } | ||
| title = root; | ||
| object[jparser.title_tag] = title; | ||
| for(var key in object) { | ||
| hash += '_' + key; | ||
| } | ||
| } else { | ||
| title = object[jparser.title_tag]; | ||
| hash = object[jparser.title_tag]; | ||
| } | ||
| //每个object都必须有一个成员_title | ||
| var symbol = { | ||
| title : title, | ||
| properties : {} | ||
| }; | ||
| if(jparser.symbols.has(hash)) { | ||
| symbol = jparser.symbols.get(hash); | ||
| } else { | ||
| jparser.symbol_sequence.push(hash); | ||
| jparser.symbols.set(hash, symbol); | ||
| } | ||
| for(var id in object) { | ||
| //跳过内置字段 | ||
| if(id == jparser.title_tag) { | ||
| continue; | ||
| } | ||
| var value = object[id]; | ||
| if(value == null) { | ||
| continue; | ||
| } | ||
| if(typeof value == "object") { | ||
| if(value instanceof Array) { | ||
| for(var i = 0; i < value.length; ++i) { | ||
| if(value[i] == null) { | ||
| continue; | ||
| } | ||
| if(typeof value[i] == "object") { | ||
| //不支持数组嵌套 | ||
| if(value[i] instanceof Array) { | ||
| throw new Error(); | ||
| } | ||
| search(value[i], root + '_' + id); | ||
| } | ||
| } | ||
| } else { | ||
| search(value, root + '_' + id); | ||
| } | ||
| } | ||
| var property = getProperty(value); | ||
| if(symbol.properties[id] == null) { | ||
| symbol.properties[id] = property; | ||
| } else { | ||
| //字段不可以同时保存string, number, array, object | ||
| if(property.type != symbol.properties[id].type) { | ||
| throw new Error(); | ||
| } | ||
| updateProperty(symbol.properties[id], property); | ||
| } | ||
| } | ||
| } | ||
| function getType(property) { | ||
| var type = null; | ||
| if(property.type == "number") { | ||
| var t = null; | ||
| if(property.is_integer) { | ||
| if((INT32_MIN <= property.min_number) && (property.max_number <= INT32_MAX)) { | ||
| t = "int32"; | ||
| } else if((0 <= property.min_number) && (property.max_number <= UINT32_MAX)) { | ||
| t = "uint32"; | ||
| } else if((INT64_MIN <= property.min_number) && (property.max_number <= INT64_MAX)) { | ||
| t = "int64"; | ||
| } else if((0 <= property.min_number) && (property.max_number <= UINT64_MAX)) { | ||
| t = "uint64"; | ||
| } else { | ||
| t = "double"; | ||
| } | ||
| } else { | ||
| t = "double"; | ||
| } | ||
| type = { type : t }; | ||
| } else if(property.type == "boolean") { | ||
| type = { type : "boolean" }; | ||
| } else if(property.type == "string") { | ||
| type = { type : "string" , string_length : property.string_length}; | ||
| } else if(property.type == "array") { | ||
| type = { | ||
| type : "array", | ||
| array_length : property.array_length, | ||
| array_type : getType(property.array_type) | ||
| }; | ||
| } else { | ||
| type = { | ||
| type : property.type, | ||
| is_object : true | ||
| }; | ||
| } | ||
| return type; | ||
| } | ||
| jparser.definitions = function() { | ||
| var definitions = []; | ||
| for(var hash of jparser.symbol_sequence) { | ||
| var symbol = jparser.symbols.get(hash); | ||
| var definition = { | ||
| title : symbol.title, | ||
| properties : [ | ||
| ] | ||
| }; | ||
| for(var name in symbol.properties) { | ||
| var p = symbol.properties[name]; | ||
| definition.properties.push({ | ||
| name : name, | ||
| type : getType(p) | ||
| }); | ||
| } | ||
| definitions.push(definition); | ||
| } | ||
| return definitions; | ||
| }; | ||
| jparser.parse = function*(file) { | ||
| var data = yield fs.readFile(file, 'utf8'); | ||
| var json = JSON.parse(data); | ||
| if((json == null) || (typeof json != "object") || (json instanceof Array)) { | ||
| console.error('File[%s] not a json object.', file); | ||
| throw new Error(); | ||
| } | ||
| var extName = path.extname(file); | ||
| var fileName = path.basename(file); | ||
| var root = fileName.substring(0, fileName.indexOf(extName)); | ||
| search(json, jparser.prefix + '_' + root); | ||
| //返回处理好的json对象 | ||
| return json; | ||
| }; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
37894
133.12%25
150%100
3233.33%161
-54.26%1
Infinity%1
Infinity%