diff --git a/.vscode/GDevelopExtensions.code-snippets b/.vscode/GDevelopExtensions.code-snippets index 20c668d2cd..3f153bd394 100644 --- a/.vscode/GDevelopExtensions.code-snippets +++ b/.vscode/GDevelopExtensions.code-snippets @@ -75,7 +75,7 @@ "\t)", "\t.getCodeExtraInformation()", "\t.setIncludeFile('Extensions/${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/$2/}/${9:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}tools}.js')", - "\t.setFunctionName('gdjs.${7:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}.}');", + "\t.setFunctionName('gdjs.evtTools.${7:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}.}');", "", "$0" ] @@ -97,7 +97,7 @@ "\t)", "\t.getCodeExtraInformation()", "\t.setIncludeFile('Extensions/${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/$2/}/${8:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}tools}.js')", - "\t.setFunctionName('gdjs.${6:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}.}');", + "\t.setFunctionName('gdjs.evtTools.${6:${TM_DIRECTORY/(.*)[\\\\\\/](.*)[\\\\\\/]?$/${2:/downcase}/}.}');", "", "$0" ] diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 30832b8342..310f58aa12 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,104 +1,98 @@ { - "configurations": [ - { - "name": "Mac", - "includePath": [ - "${workspaceRoot}", - "${workspaceRoot}/GDCpp", - "${workspaceRoot}/GDJS", - "${workspaceRoot}/Extensions", - "${workspaceRoot}/Core", - "${workspaceRoot}/ExtLibs/SFML/include", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", - "/usr/local/include", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", - "/usr/include", - "${workspaceRoot}" - ], - "defines": [ - "GD_IDE_ONLY", - "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", - "GD_API=/* Macro used to export classes on Windows, please ignore */", - "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" - ], - "intelliSenseMode": "clang-x64", - "browse": { - "path": [ - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", - "/usr/local/include", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", - "/usr/include", - "${workspaceRoot}" - ], - "limitSymbolsToIncludedHeaders": true, - "databaseFilename": "" - }, - "macFrameworkPath": [ - "/System/Library/Frameworks", - "/Library/Frameworks" - ], - "compilerPath": "/usr/bin/clang", - "cStandard": "c11", - "cppStandard": "c++17" - }, - { - "name": "Linux", - "includePath": [ - "${workspaceRoot}", - "${workspaceRoot}/GDCpp", - "${workspaceRoot}/GDJS", - "${workspaceRoot}/Extensions", - "${workspaceRoot}/Core", - "${workspaceRoot}/ExtLibs/SFML/include", - "/usr/include", - "/usr/local/include", - "${workspaceRoot}" - ], - "defines": [ - "GD_IDE_ONLY", - "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", - "GD_API=/* Macro used to export classes on Windows, please ignore */", - "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" - ], - "intelliSenseMode": "clang-x64", - "browse": { - "path": [ - "/usr/include", - "/usr/local/include", - "${workspaceRoot}" - ], - "limitSymbolsToIncludedHeaders": true, - "databaseFilename": "" - } - }, - { - "name": "Win32", - "includePath": [ - "${workspaceRoot}", - "${workspaceRoot}/GDCpp", - "${workspaceRoot}/GDJS", - "${workspaceRoot}/Extensions", - "${workspaceRoot}/Core", - "${workspaceRoot}/ExtLibs/SFML/include", - "${workspaceRoot}" - ], - "defines": [ - "_DEBUG", - "UNICODE", - "GD_IDE_ONLY", - "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", - "GD_API=/* Macro used to export classes on Windows, please ignore */", - "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" - ], - "intelliSenseMode": "msvc-x64", - "browse": { - "path": [ - "${workspaceRoot}" - ], - "limitSymbolsToIncludedHeaders": true, - "databaseFilename": "" - } - } - ], - "version": 4 + "configurations": [ + { + "name": "Mac", + "includePath": [ + "${workspaceRoot}", + "${workspaceRoot}/GDCpp", + "${workspaceRoot}/GDJS", + "${workspaceRoot}/Extensions", + "${workspaceRoot}/Core", + "${workspaceRoot}/ExtLibs/SFML/include", + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", + "/usr/local/include", + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", + "/usr/include", + "${workspaceRoot}" + ], + "defines": [ + "EMSCRIPTEN", + "GD_IDE_ONLY", + "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", + "GD_API=/* Macro used to export classes on Windows, please ignore */", + "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" + ], + "intelliSenseMode": "clang-x64", + "browse": { + "path": [ + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", + "/usr/local/include", + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", + "/usr/include", + "${workspaceRoot}" + ], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + }, + "macFrameworkPath": ["/System/Library/Frameworks", "/Library/Frameworks"], + "compilerPath": "/usr/bin/clang", + "cStandard": "c11", + "cppStandard": "c++17" + }, + { + "name": "Linux", + "includePath": [ + "${workspaceRoot}", + "${workspaceRoot}/GDCpp", + "${workspaceRoot}/GDJS", + "${workspaceRoot}/Extensions", + "${workspaceRoot}/Core", + "${workspaceRoot}/ExtLibs/SFML/include", + "/usr/include", + "/usr/local/include", + "${workspaceRoot}" + ], + "defines": [ + "EMSCRIPTEN", + "GD_IDE_ONLY", + "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", + "GD_API=/* Macro used to export classes on Windows, please ignore */", + "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" + ], + "intelliSenseMode": "clang-x64", + "browse": { + "path": ["/usr/include", "/usr/local/include", "${workspaceRoot}"], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + } + }, + { + "name": "Win32", + "includePath": [ + "${workspaceRoot}", + "${workspaceRoot}/GDCpp", + "${workspaceRoot}/GDJS", + "${workspaceRoot}/Extensions", + "${workspaceRoot}/Core", + "${workspaceRoot}/ExtLibs/SFML/include", + "${workspaceRoot}" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "EMSCRIPTEN", + "GD_IDE_ONLY", + "GD_CORE_API=/* Macro used to export classes on Windows, please ignore */", + "GD_API=/* Macro used to export classes on Windows, please ignore */", + "GD_EXTENSION_API=/* Macro used to export classes on Windows, please ignore */" + ], + "intelliSenseMode": "msvc-x64", + "browse": { + "path": ["${workspaceRoot}"], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + } + } + ], + "version": 4 } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 319637dff1..0a05538dfa 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,8 @@ { - "recommendations": [ - "esbenp.prettier-vscode", - "xaver.clang-format", - "ms-vscode.cpptools", - "flowtype.flow-for-vscode" - ] -} \ No newline at end of file + "recommendations": [ + "esbenp.prettier-vscode", + "xaver.clang-format", + "ms-vscode.cpptools", + "flowtype.flow-for-vscode" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 562cc64077..a5b91a958e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,15 +1,16 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "pwa-chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}", + "preLaunchTask": "Start development server" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index b8b143e2ac..f61b4af0d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -114,6 +114,7 @@ "Binaries/*build*": true, "Binaries/Output": true, "ExtLibs/SFML": true, + "GDJS/Runtime-dist": true, "docs": true, "newIDE/electron-app/dist": true, "newIDE/app/build": true, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0098fbd883..f42a556a92 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,66 +1,100 @@ { "version": "2.0.0", "tasks": [ - { - "type": "npm", - "script": "start", - "path": "newIDE/app/", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [], - "label": "Start development server", - "detail": "Starts the GDevelop development server." - }, - { - "type": "npm", - "script": "build", - "path": "GDevelop.js/", - "group": "build", - "problemMatcher": [], - "label": "Build GDevelop.js", - "detail": "Builds GDCore for newIDE." - }, - { - "type": "npm", - "script": "format", - "path": "newIDE/app/", - "problemMatcher": [], - "label": "Format newIDE", - "detail": "Run auto-formatting (with Prettier) for the newIDE/app directory." - }, - { - "type": "npm", - "script": "test", - "path": "newIDE/app/", - "group": { - "kind": "test", - "isDefault": true - }, - "problemMatcher": [], - "label": "Run newIDE tests", - "detail": "Run tests for newIDE." - }, - { - "type": "typescript", - "tsconfig": "GDJS/tsconfig.json", - "option": "watch", - "problemMatcher": [ - "$tsc-watch" - ], - "group": "test", - "label": "GDJS TS Check", - "detail": "Runs a types check on the GDJS Runtime." - }, - { - "type": "npm", - "script": "test", - "path": "GDJS/", - "group": "test", - "problemMatcher": [], - "label": "Run GDJS tests", - "detail": "Run tests for GDJS." - } -] + { + "type": "npm", + "script": "start", + "path": "newIDE/app/", + "group": "build", + "label": "Start development server", + "detail": "Starts the GDevelop development server.", + "problemMatcher": [ + { + "owner": "cra", + "fileLocation": ["relative", "${workspaceFolder}/newIDE/app"], + "source": "create-react-app", + "applyTo": "allDocuments", + "pattern": [ + { + "regexp": "^([^\\s].*?)$", + "file": 1 + }, + { + "regexp": "^ Line\\s+(\\d+):\\s+(.*)\\s\\s+(.*)$", + "line": 1, + "message": 2, + "code": 3, + "loop": true + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": "^(?:Compiled with warnings\\.|Compiled successfully!)$", + "endsPattern": "^(?:Search for the keywords to learn more about each warning\\.|Note that the development build is not optimized\\.)$" + } + } + ], + "presentation": { + "reveal": "silent" + }, + "isBackground": true, + "runOptions": { "instanceLimit": 1, "runOn": "folderOpen" } + }, + { + "type": "npm", + "script": "start", + "path": "newIDE/electron-app/", + "group": "build", + "problemMatcher": [], + "label": "Start electron app", + "detail": "Starts the development local version of GDevelop." + }, + { + "type": "npm", + "script": "build", + "path": "GDevelop.js/", + "group": "build", + "problemMatcher": [], + "label": "Build GDevelop.js", + "detail": "Builds GDCore for newIDE." + }, + { + "type": "npm", + "script": "format", + "path": "newIDE/app/", + "problemMatcher": [], + "label": "Format newIDE", + "detail": "Run auto-formatting (with Prettier) for the newIDE/app directory." + }, + { + "type": "npm", + "script": "test", + "path": "newIDE/app/", + "group": { + "kind": "test", + "isDefault": true + }, + "problemMatcher": [], + "label": "Run newIDE tests", + "detail": "Run tests for newIDE." + }, + { + "type": "typescript", + "tsconfig": "GDJS/tsconfig.json", + "option": "watch", + "problemMatcher": ["$tsc-watch"], + "group": "test", + "label": "GDJS TS Check", + "detail": "Runs a types check on the GDJS Runtime." + }, + { + "type": "npm", + "script": "test", + "path": "GDJS/", + "group": "test", + "problemMatcher": [], + "label": "Run GDJS tests", + "detail": "Run tests for GDJS." + } + ] } diff --git a/newIDE/README.md b/newIDE/README.md index 28b8932f0b..33ce145f25 100644 --- a/newIDE/README.md +++ b/newIDE/README.md @@ -42,15 +42,7 @@ cd newIDE/app && npm start # Be sure to have this running in another terminal, b # In a new terminal: cd newIDE/electron-app npm install # or yarn - -#For macOS: -npm run electron-mac - -#For Windows: -npm run electron-win - -#For Linux: -npm run electron-linux +npm run start # or yarn start ``` ### Quick Install and Run diff --git a/newIDE/app/package.json b/newIDE/app/package.json index 5620b7db41..3c7df70516 100644 --- a/newIDE/app/package.json +++ b/newIDE/app/package.json @@ -87,9 +87,7 @@ "make-version-metadata": "cd scripts && node make-version-metadata.js", "make-service-worker": "cd scripts && node make-service-worker.js", "start": "npm run import-resources && npm run make-version-metadata && react-scripts start", - "electron-win": "cd ../electron-app && node node_modules/electron/cli.js app", - "electron-linux": "cd ../electron-app && ./node_modules/electron/dist/electron app", - "electron-mac": "cd ../electron-app && ./node_modules/electron/dist/Electron.app/Contents/MacOS/Electron app", + "electron-app": "cd ../electron-app && npm run start", "build": "npm run import-resources && npm run make-version-metadata && react-scripts build && npm run make-service-worker", "format": "prettier --write \"src/!(locales)/**/*.js\"", "check-format": "prettier --list-different \"src/!(locales)/**/*.js\"", diff --git a/newIDE/electron-app/package.json b/newIDE/electron-app/package.json index 4224ca01e0..c444e0067a 100644 --- a/newIDE/electron-app/package.json +++ b/newIDE/electron-app/package.json @@ -14,9 +14,7 @@ "build": "node scripts/build.js", "format": "prettier --write --ignore-path .gitignore \"**/*.js\"", "check-format": "prettier --list-different --ignore-path .gitignore \"**/*.js\"", - "electron-win": "node node_modules/electron/cli.js app", - "electron-linux": "./node_modules/electron/dist/electron app", - "electron-mac": "./node_modules/electron/dist/Electron.app/Contents/MacOS/Electron app", + "start": "electron app", "reload-extensions": "cd ../app/scripts && node import-GDJS-Runtime.js", "import-zipped-electron-extensions": "node scripts/import-zipped-electron-extension.js ReactDeveloperTools app/extensions/" },