diff --git a/packages/app-harness/src/entry/index.web.ts b/packages/app-harness/src/entry/index.web.ts deleted file mode 100644 index 84b9253e09..0000000000 --- a/packages/app-harness/src/entry/index.web.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from '../app'; - -ReactDOM.render(React.createElement(App), document.getElementById('root')); diff --git a/packages/app-harness/src/entry/index.web.tsx b/packages/app-harness/src/entry/index.web.tsx new file mode 100644 index 0000000000..94a59dd08d --- /dev/null +++ b/packages/app-harness/src/entry/index.web.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from '../app'; + +const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); +root.render( + + + +); diff --git a/packages/cli/src/logger/index.ts b/packages/cli/src/logger/index.ts index 6cee718cd2..98ad95cca0 100644 --- a/packages/cli/src/logger/index.ts +++ b/packages/cli/src/logger/index.ts @@ -10,6 +10,7 @@ import { RnvApiChalk, RnvApiChalkFn, } from '@rnv/core'; +import path from 'path'; const ICN_ROCKET = isSystemWin ? 'RNV' : '🚀'; // const ICN_UNICORN = isSystemWin ? 'unicorn' : '🦄'; @@ -239,27 +240,27 @@ export const logSummary = (header = '✔ SUMMARY') => { // str += printIntoBox(`ReNative Version: ${_highlightColor(ctx.rnvVersion)}`); if (ctx.files?.project?.package?.name && ctx.files?.project?.package?.version) { - str += printIntoBox(`Project Name ($package.name): ${_highlightColor(ctx.files.project.package.name)}`); str += printIntoBox( - `Project Version ($package.version): ${_highlightColor(ctx.files.project.package.version)}` + `Project: ${currentChalk.gray(`${ctx.files.project.package.name}@${ctx.files.project.package.version}`)}` ); + // str += printIntoBox(`Project Version: ${currentChalk.gray(ctx.files.project.package.version)}`); } if (ctx.buildConfig?.workspaceID) { - str += printIntoBox(`Workspace ($.workspaceID): ${_highlightColor(ctx.buildConfig.workspaceID)}`); + str += printIntoBox(`Workspace: ${currentChalk.gray(ctx.buildConfig.workspaceID)}`); } if (ctx.platform) { str += printIntoBox(`Platform (-p): ${_highlightColor(ctx.platform)}`); } if (ctx.runtime?.engine) { - let addon = ''; - if (ctx.platform) { - addon = ` ($.platforms.${ctx.platform}.engine)`; - } - str += printIntoBox(`Engine${addon}: ${_highlightColor(ctx.runtime?.engine?.config?.id || '')}`); + // let addon = ''; + // if (ctx.platform) { + // addon = ` ($.platforms.${ctx.platform}.engine)`; + // } + str += printIntoBox(`Engine: ${currentChalk.gray(ctx.runtime?.engine?.config?.id || '')}`); } if (ctx.runtime?.activeTemplate) { - str += printIntoBox(`Template: ${_highlightColor(ctx.runtime?.activeTemplate)}`); + str += printIntoBox(`Template: ${currentChalk.gray(ctx.runtime?.activeTemplate)}`); } if (ctx.buildConfig?._meta?.currentAppConfigId) { str += printIntoBox(`App Config (-c): ${_highlightColor(ctx.buildConfig._meta?.currentAppConfigId)}`); @@ -282,7 +283,9 @@ export const logSummary = (header = '✔ SUMMARY') => { str += printIntoBox(`Reset Project and Assets (-R): ${_highlightColor(!!ctx.program?.resetHard)}`); } if (ctx.runtime?.supportedPlatforms?.length) { - const plats = ctx.runtime.supportedPlatforms.map((v) => `${v.platform}${v.isConnected ? '' : '(ejected)'}`); + const plats = ctx.runtime.supportedPlatforms.map( + (v) => `${currentChalk.gray(v.platform)}${v.isConnected ? '' : '(ejected)'}` + ); str += printArrIntoBox(plats, 'Supported Platforms: '); } @@ -292,7 +295,9 @@ export const logSummary = (header = '✔ SUMMARY') => { } if (ctx.timeEnd) { - str += printIntoBox(`Executed Time: ${_msToTime(ctx.timeEnd.getTime() - ctx.timeStart.getTime())}`); + str += printIntoBox( + `Executed Time: ${currentChalk.gray(_msToTime(ctx.timeEnd.getTime() - ctx.timeStart.getTime()))}` + ); } // str += printIntoBox(''); @@ -301,8 +306,9 @@ export const logSummary = (header = '✔ SUMMARY') => { // str += printIntoBox(''); if (ctx.runtime?.platformBuildsProjectPath) { - str += printIntoBox('Project location:'); - str += printIntoBox(`${currentChalk.bold(_sanitizePaths(ctx.runtime.platformBuildsProjectPath || ''))}`); + str += printIntoBox( + `Project location: ${currentChalk.gray(_sanitizePaths(ctx.runtime.platformBuildsProjectPath || ''))}` + ); } str += printBoxEnd(); @@ -326,9 +332,20 @@ const _getCurrentTask = () => { return ctx._currentTask ? currentChalk.grey(`○ ${ctx._currentTask}:`) : ''; }; -const CWD = process.cwd(); -const CWD_UP = CWD.split('/').slice(0, -1).join('/'); -const CWD_UP_UP = CWD.split('/').slice(0, -2).join('/'); +const CWD_ARR: { path: string; relative: string }[] = []; + +const _generateRelativePaths = () => { + const cwd = process.cwd(); + const cwdArr = cwd.split(path.sep); + let relativeUp = '.'; + for (let i = 1; i < cwdArr.length; i++) { + const absoluteUp = path.join(cwd, relativeUp).normalize(); + CWD_ARR.push({ path: absoluteUp, relative: relativeUp }); + relativeUp += i > 1 ? '/..' : '.'; + } +}; + +_generateRelativePaths(); const _sanitizePaths = (msg: string) => { // const ctx = getContext(); @@ -339,10 +356,13 @@ const _sanitizePaths = (msg: string) => { // } if (msg?.replace) { - return msg - .replace(new RegExp(CWD, 'g'), '.') - .replace(new RegExp(CWD_UP, 'g'), '..') - .replace(new RegExp(CWD_UP_UP, 'g'), '../..'); + CWD_ARR.forEach((v) => { + msg = msg.replace(new RegExp(v.path, 'g'), v.relative); + }); + // return msg + // .replace(new RegExp(CWD, 'g'), '.') + // .replace(new RegExp(CWD_UP, 'g'), '..') + // .replace(new RegExp(CWD_UP_UP, 'g'), '../..'); } return msg; }; @@ -583,7 +603,7 @@ export const logEnd = (code: number) => { export const logAppInfo = (c: RnvContext) => { if (!_jsonOnly) { - logInfo(`Current App Config: ${currentChalk.bold(c.runtime.appId)}`); + logInfo(`Current app config: ${currentChalk.bold(c.runtime.appId)}`); } }; diff --git a/packages/core/jsonSchema/rnv.app.json b/packages/core/jsonSchema/rnv.app.json index 85d14cdab5..a7e3afa27f 100644 --- a/packages/core/jsonSchema/rnv.app.json +++ b/packages/core/jsonSchema/rnv.app.json @@ -3239,349 +3239,356 @@ "additionalProperties": { "anyOf": [ { - "type": "object", - "properties": { - "disabled": { - "type": "boolean", - "default": false, - "description": "Marks plugin disabled" - }, - "props": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom props passed to plugin" - }, - "version": { - "type": "string", - "description": "Version of plugin. Typically package version" - }, - "deprecated": { - "type": "string", - "description": "Marks your plugin deprecated with warning showing in the console during rnv commands" - }, - "source": { - "type": "string", - "description": "Will define custom scope for your plugin config to extend from.\n\nNOTE: custom scopes can be defined via paths.pluginTemplates.[CUSTOM_SCOPE].{}" - }, - "disableNpm": { - "type": "boolean", - "description": "Will skip including plugin in package.json and installing it via npm/yarn etc" - }, - "skipMerge": { - "type": "boolean", - "description": "Will not attempt to merge with existing plugin configuration (ie. coming form renative pluginTemplates)\n\nNOTE: if set to `true` you need to configure your plugin object fully" - }, - "npm": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Object of npm dependencies of this plugin. These will be injected into package.json" - }, - "pluginDependencies": { - "type": "object", - "additionalProperties": { - "type": [ - "string", - "null" - ] - }, - "description": "List of other Renative plugins this plugin depends on" - }, - "webpackConfig": { - "type": "object", - "properties": { - "modulePaths": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "moduleAliases": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "projectPath": { - "type": "string" - } - }, - "required": [ - "projectPath" - ], - "additionalProperties": false - } - ] - } - } - ] - }, - "nextTranspileModules": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "description": "Allows you to configure webpack bahaviour per each individual plugin" - }, - "disablePluginTemplateOverrides": { - "type": "boolean", - "description": "Disables plugin overrides for selected plugin" - }, - "fontSources": { - "type": "array", - "items": { - "type": "string" - } - }, - "android": { + "anyOf": [ + { "type": "object", "properties": { "disabled": { "type": "boolean", "default": false, - "description": "Marks plugin platform disabled" + "description": "Marks plugin disabled" }, - "forceLinking": { - "type": "boolean", - "default": false, - "description": "Packages that cannot be autolinked yet can still be added to MainApplication PackageList dynamically by setting this to true" + "props": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom props passed to plugin" }, - "path": { + "version": { "type": "string", - "description": "Enables you to pass custom path to plugin. If undefined, the default `node_modules/[plugin-name]` will be used." + "description": "Version of plugin. Typically package version" }, - "projectName": { - "type": "string" + "deprecated": { + "type": "string", + "description": "Marks your plugin deprecated with warning showing in the console during rnv commands" }, - "skipLinking": { - "type": "boolean" + "source": { + "type": "string", + "description": "Will define custom scope for your plugin config to extend from.\n\nNOTE: custom scopes can be defined via paths.pluginTemplates.[CUSTOM_SCOPE].{}" }, - "skipImplementation": { - "type": "boolean" + "disableNpm": { + "type": "boolean", + "description": "Will skip including plugin in package.json and installing it via npm/yarn etc" }, - "implementation": { - "type": "string" + "skipMerge": { + "type": "boolean", + "description": "Will not attempt to merge with existing plugin configuration (ie. coming form renative pluginTemplates)\n\nNOTE: if set to `true` you need to configure your plugin object fully" }, - "package": { - "type": "string" + "npm": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Object of npm dependencies of this plugin. These will be injected into package.json" }, - "templateAndroid": { + "pluginDependencies": { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "null" + ] + }, + "description": "List of other Renative plugins this plugin depends on" + }, + "webpackConfig": { "type": "object", "properties": { - "gradle_properties": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/gradle_properties" - }, - "build_gradle": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/build_gradle" - }, - "app_build_gradle": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/app_build_gradle" - }, - "AndroidManifest_xml": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/AndroidManifest_xml" - }, - "strings_xml": { - "type": "object", - "properties": { - "children": { + "modulePaths": { + "anyOf": [ + { + "type": "boolean" + }, + { "type": "array", "items": { - "type": "object", - "properties": { - "tag": { - "type": "string" - }, - "name": { + "type": "string" + } + } + ] + }, + "moduleAliases": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "type": "string" }, - "child_value": { - "type": "string" + { + "type": "object", + "properties": { + "projectPath": { + "type": "string" + } + }, + "required": [ + "projectPath" + ], + "additionalProperties": false } - }, - "required": [ - "tag", - "name", - "child_value" - ], - "additionalProperties": false + ] } } - }, - "additionalProperties": false + ] }, - "MainActivity_java": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/MainActivity_java" - }, - "MainApplication_java": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/MainApplication_java" + "nextTranspileModules": { + "type": "array", + "items": { + "type": "string" + } } }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "androidtv": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "androidwear": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "firetv": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "ios": { - "type": "object", - "properties": { - "disabled": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/disabled" - }, - "forceLinking": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/forceLinking" - }, - "path": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/path" - }, - "git": { - "type": "string", - "description": "Alternative git url for pod instead of version" - }, - "commit": { - "type": "string", - "description": "Alternative git commit reference string" + "additionalProperties": false, + "description": "Allows you to configure webpack bahaviour per each individual plugin" }, - "version": { - "type": "string", - "description": "Version of pod" + "disablePluginTemplateOverrides": { + "type": "boolean", + "description": "Disables plugin overrides for selected plugin" }, - "podNames": { + "fontSources": { "type": "array", "items": { "type": "string" } }, - "podName": { - "type": "string" + "android": { + "type": "object", + "properties": { + "disabled": { + "type": "boolean", + "default": false, + "description": "Marks plugin platform disabled" + }, + "forceLinking": { + "type": "boolean", + "default": false, + "description": "Packages that cannot be autolinked yet can still be added to MainApplication PackageList dynamically by setting this to true" + }, + "path": { + "type": "string", + "description": "Enables you to pass custom path to plugin. If undefined, the default `node_modules/[plugin-name]` will be used." + }, + "projectName": { + "type": "string" + }, + "skipLinking": { + "type": "boolean" + }, + "skipImplementation": { + "type": "boolean" + }, + "implementation": { + "type": "string" + }, + "package": { + "type": "string" + }, + "templateAndroid": { + "type": "object", + "properties": { + "gradle_properties": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/gradle_properties" + }, + "build_gradle": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/build_gradle" + }, + "app_build_gradle": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/app_build_gradle" + }, + "AndroidManifest_xml": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/AndroidManifest_xml" + }, + "strings_xml": { + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "name": { + "type": "string" + }, + "child_value": { + "type": "string" + } + }, + "required": [ + "tag", + "name", + "child_value" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "MainActivity_java": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/MainActivity_java" + }, + "MainApplication_java": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/android/properties/templateAndroid/properties/MainApplication_java" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false }, - "staticFrameworks": { - "type": "array", - "items": { - "type": "string" - } + "androidtv": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" }, - "templateXcode": { + "androidwear": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" + }, + "firetv": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" + }, + "ios": { "type": "object", "properties": { - "Podfile": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/Podfile" + "disabled": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/disabled" + }, + "forceLinking": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/forceLinking" + }, + "path": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/path" + }, + "git": { + "type": "string", + "description": "Alternative git url for pod instead of version" + }, + "commit": { + "type": "string", + "description": "Alternative git commit reference string" + }, + "version": { + "type": "string", + "description": "Version of pod" + }, + "podNames": { + "type": "array", + "items": { + "type": "string" + } }, - "project_pbxproj": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/project_pbxproj" + "podName": { + "type": "string" }, - "AppDelegate_mm": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_mm" + "staticFrameworks": { + "type": "array", + "items": { + "type": "string" + } + }, + "templateXcode": { + "type": "object", + "properties": { + "Podfile": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/Podfile" + }, + "project_pbxproj": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/project_pbxproj" + }, + "AppDelegate_mm": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_mm" + }, + "AppDelegate_h": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_h" + }, + "Info_plist": { + "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/Info_plist" + } + }, + "additionalProperties": false }, - "AppDelegate_h": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_h" + "isStatic": { + "type": "boolean" }, - "Info_plist": { - "$ref": "#/definitions/rnv.app/properties/platforms/properties/ios/properties/templateXcode/properties/Info_plist" + "buildType": { + "type": "string", + "enum": [ + "dynamic", + "static" + ], + "description": "Build type of the pod" } }, "additionalProperties": false }, - "isStatic": { - "type": "boolean" + "tvos": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/ios" }, - "buildType": { - "type": "string", - "enum": [ - "dynamic", - "static" - ], - "description": "Build type of the pod" - } - }, - "additionalProperties": false - }, - "tvos": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/ios" - }, - "tizen": { - "type": "object", - "properties": { - "disabled": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/disabled" + "tizen": { + "type": "object", + "properties": { + "disabled": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/disabled" + }, + "forceLinking": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/forceLinking" + }, + "path": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/path" + } + }, + "additionalProperties": false + }, + "tizenmobile": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "tizenwatch": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "webos": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "web": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "webtv": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "chromecast": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "kaios": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "macos": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" }, - "forceLinking": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/forceLinking" + "linux": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" }, - "path": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/path" + "windows": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "xbox": { + "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" } }, "additionalProperties": false }, - "tizenmobile": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "tizenwatch": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "webos": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "web": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "webtv": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "chromecast": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "kaios": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "macos": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "linux": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "windows": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "xbox": { - "$ref": "#/definitions/rnv.app/properties/plugins/additionalProperties/anyOf/0/properties/tizen" + { + "type": "string" } - }, - "additionalProperties": false + ] }, { - "type": "string" + "type": "null" } ] }, diff --git a/packages/core/jsonSchema/rnv.project.json b/packages/core/jsonSchema/rnv.project.json index 6798d6ec83..02aa405c72 100644 --- a/packages/core/jsonSchema/rnv.project.json +++ b/packages/core/jsonSchema/rnv.project.json @@ -19,6 +19,28 @@ "type": "boolean", "description": "Mark if your project is part of monorepo" }, + "useTemplate": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "excludedPaths": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "version" + ], + "additionalProperties": false + }, "isTemplate": { "type": "boolean" }, @@ -393,6 +415,104 @@ "runtime": { "description": "This object will be automatically injected into `./platfromAssets/renative.runtime.json` making it possible to inject the values directly to JS source code" }, + "templateConfig": { + "type": "object", + "properties": { + "includedPaths": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Defines list of all file/dir paths you want to include in template" + }, + "bootstrapQuestions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "value": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + "required": [ + "title", + "value" + ], + "additionalProperties": false + } + }, + "configProp": { + "type": "object", + "properties": { + "prop": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "required": [ + "prop", + "key" + ], + "additionalProperties": false + }, + "type": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "type", + "title" + ], + "additionalProperties": false + }, + "description": "Defines list of custom bootstrap questions" + }, + "packageTemplate": { + "type": "object", + "properties": { + "dependencies": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "devDependencies": { + "$ref": "#/definitions/rnv.project/properties/templateConfig/properties/packageTemplate/properties/dependencies" + }, + "peerDependencies": { + "$ref": "#/definitions/rnv.project/properties/templateConfig/properties/packageTemplate/properties/dependencies" + }, + "optionalDependencies": { + "$ref": "#/definitions/rnv.project/properties/templateConfig/properties/packageTemplate/properties/dependencies" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "description": "Used in `renative.template.json` allows you to define template behaviour." + }, "skipAutoUpdate": { "type": "boolean", "description": "Enables the equivalent to passing --skipDependencyCheck parameter on every rnv run so you don't have to use it" @@ -3594,349 +3714,356 @@ "additionalProperties": { "anyOf": [ { - "type": "object", - "properties": { - "disabled": { - "type": "boolean", - "default": false, - "description": "Marks plugin disabled" - }, - "props": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Custom props passed to plugin" - }, - "version": { - "type": "string", - "description": "Version of plugin. Typically package version" - }, - "deprecated": { - "type": "string", - "description": "Marks your plugin deprecated with warning showing in the console during rnv commands" - }, - "source": { - "type": "string", - "description": "Will define custom scope for your plugin config to extend from.\n\nNOTE: custom scopes can be defined via paths.pluginTemplates.[CUSTOM_SCOPE].{}" - }, - "disableNpm": { - "type": "boolean", - "description": "Will skip including plugin in package.json and installing it via npm/yarn etc" - }, - "skipMerge": { - "type": "boolean", - "description": "Will not attempt to merge with existing plugin configuration (ie. coming form renative pluginTemplates)\n\nNOTE: if set to `true` you need to configure your plugin object fully" - }, - "npm": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Object of npm dependencies of this plugin. These will be injected into package.json" - }, - "pluginDependencies": { - "type": "object", - "additionalProperties": { - "type": [ - "string", - "null" - ] - }, - "description": "List of other Renative plugins this plugin depends on" - }, - "webpackConfig": { - "type": "object", - "properties": { - "modulePaths": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "moduleAliases": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "projectPath": { - "type": "string" - } - }, - "required": [ - "projectPath" - ], - "additionalProperties": false - } - ] - } - } - ] - }, - "nextTranspileModules": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "description": "Allows you to configure webpack bahaviour per each individual plugin" - }, - "disablePluginTemplateOverrides": { - "type": "boolean", - "description": "Disables plugin overrides for selected plugin" - }, - "fontSources": { - "type": "array", - "items": { - "type": "string" - } - }, - "android": { + "anyOf": [ + { "type": "object", "properties": { "disabled": { "type": "boolean", "default": false, - "description": "Marks plugin platform disabled" + "description": "Marks plugin disabled" }, - "forceLinking": { - "type": "boolean", - "default": false, - "description": "Packages that cannot be autolinked yet can still be added to MainApplication PackageList dynamically by setting this to true" + "props": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom props passed to plugin" }, - "path": { + "version": { "type": "string", - "description": "Enables you to pass custom path to plugin. If undefined, the default `node_modules/[plugin-name]` will be used." + "description": "Version of plugin. Typically package version" }, - "projectName": { - "type": "string" + "deprecated": { + "type": "string", + "description": "Marks your plugin deprecated with warning showing in the console during rnv commands" }, - "skipLinking": { - "type": "boolean" + "source": { + "type": "string", + "description": "Will define custom scope for your plugin config to extend from.\n\nNOTE: custom scopes can be defined via paths.pluginTemplates.[CUSTOM_SCOPE].{}" }, - "skipImplementation": { - "type": "boolean" + "disableNpm": { + "type": "boolean", + "description": "Will skip including plugin in package.json and installing it via npm/yarn etc" }, - "implementation": { - "type": "string" + "skipMerge": { + "type": "boolean", + "description": "Will not attempt to merge with existing plugin configuration (ie. coming form renative pluginTemplates)\n\nNOTE: if set to `true` you need to configure your plugin object fully" }, - "package": { - "type": "string" + "npm": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Object of npm dependencies of this plugin. These will be injected into package.json" }, - "templateAndroid": { + "pluginDependencies": { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "null" + ] + }, + "description": "List of other Renative plugins this plugin depends on" + }, + "webpackConfig": { "type": "object", "properties": { - "gradle_properties": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/gradle_properties" - }, - "build_gradle": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/build_gradle" - }, - "app_build_gradle": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/app_build_gradle" - }, - "AndroidManifest_xml": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/AndroidManifest_xml" - }, - "strings_xml": { - "type": "object", - "properties": { - "children": { + "modulePaths": { + "anyOf": [ + { + "type": "boolean" + }, + { "type": "array", "items": { - "type": "object", - "properties": { - "tag": { - "type": "string" - }, - "name": { + "type": "string" + } + } + ] + }, + "moduleAliases": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "type": "string" }, - "child_value": { - "type": "string" + { + "type": "object", + "properties": { + "projectPath": { + "type": "string" + } + }, + "required": [ + "projectPath" + ], + "additionalProperties": false } - }, - "required": [ - "tag", - "name", - "child_value" - ], - "additionalProperties": false + ] } } - }, - "additionalProperties": false - }, - "MainActivity_java": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/MainActivity_java" + ] }, - "MainApplication_java": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/MainApplication_java" + "nextTranspileModules": { + "type": "array", + "items": { + "type": "string" + } } }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "androidtv": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "androidwear": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "firetv": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android" - }, - "ios": { - "type": "object", - "properties": { - "disabled": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/disabled" - }, - "forceLinking": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/forceLinking" - }, - "path": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/path" - }, - "git": { - "type": "string", - "description": "Alternative git url for pod instead of version" + "additionalProperties": false, + "description": "Allows you to configure webpack bahaviour per each individual plugin" }, - "commit": { - "type": "string", - "description": "Alternative git commit reference string" - }, - "version": { - "type": "string", - "description": "Version of pod" + "disablePluginTemplateOverrides": { + "type": "boolean", + "description": "Disables plugin overrides for selected plugin" }, - "podNames": { + "fontSources": { "type": "array", "items": { "type": "string" } }, - "podName": { - "type": "string" + "android": { + "type": "object", + "properties": { + "disabled": { + "type": "boolean", + "default": false, + "description": "Marks plugin platform disabled" + }, + "forceLinking": { + "type": "boolean", + "default": false, + "description": "Packages that cannot be autolinked yet can still be added to MainApplication PackageList dynamically by setting this to true" + }, + "path": { + "type": "string", + "description": "Enables you to pass custom path to plugin. If undefined, the default `node_modules/[plugin-name]` will be used." + }, + "projectName": { + "type": "string" + }, + "skipLinking": { + "type": "boolean" + }, + "skipImplementation": { + "type": "boolean" + }, + "implementation": { + "type": "string" + }, + "package": { + "type": "string" + }, + "templateAndroid": { + "type": "object", + "properties": { + "gradle_properties": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/gradle_properties" + }, + "build_gradle": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/build_gradle" + }, + "app_build_gradle": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/app_build_gradle" + }, + "AndroidManifest_xml": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/AndroidManifest_xml" + }, + "strings_xml": { + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "name": { + "type": "string" + }, + "child_value": { + "type": "string" + } + }, + "required": [ + "tag", + "name", + "child_value" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "MainActivity_java": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/MainActivity_java" + }, + "MainApplication_java": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/android/properties/templateAndroid/properties/MainApplication_java" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false }, - "staticFrameworks": { - "type": "array", - "items": { - "type": "string" - } + "androidtv": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" }, - "templateXcode": { + "androidwear": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" + }, + "firetv": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android" + }, + "ios": { "type": "object", "properties": { - "Podfile": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/Podfile" + "disabled": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/disabled" + }, + "forceLinking": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/forceLinking" + }, + "path": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/path" + }, + "git": { + "type": "string", + "description": "Alternative git url for pod instead of version" + }, + "commit": { + "type": "string", + "description": "Alternative git commit reference string" + }, + "version": { + "type": "string", + "description": "Version of pod" + }, + "podNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "podName": { + "type": "string" + }, + "staticFrameworks": { + "type": "array", + "items": { + "type": "string" + } + }, + "templateXcode": { + "type": "object", + "properties": { + "Podfile": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/Podfile" + }, + "project_pbxproj": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/project_pbxproj" + }, + "AppDelegate_mm": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_mm" + }, + "AppDelegate_h": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_h" + }, + "Info_plist": { + "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/Info_plist" + } + }, + "additionalProperties": false }, - "project_pbxproj": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/project_pbxproj" + "isStatic": { + "type": "boolean" }, - "AppDelegate_mm": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_mm" + "buildType": { + "type": "string", + "enum": [ + "dynamic", + "static" + ], + "description": "Build type of the pod" + } + }, + "additionalProperties": false + }, + "tvos": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/ios" + }, + "tizen": { + "type": "object", + "properties": { + "disabled": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/disabled" }, - "AppDelegate_h": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/AppDelegate_h" + "forceLinking": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/forceLinking" }, - "Info_plist": { - "$ref": "#/definitions/rnv.project/properties/platforms/properties/ios/properties/templateXcode/properties/Info_plist" + "path": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/android/properties/path" } }, "additionalProperties": false }, - "isStatic": { - "type": "boolean" + "tizenmobile": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" }, - "buildType": { - "type": "string", - "enum": [ - "dynamic", - "static" - ], - "description": "Build type of the pod" - } - }, - "additionalProperties": false - }, - "tvos": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/ios" - }, - "tizen": { - "type": "object", - "properties": { - "disabled": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/disabled" + "tizenwatch": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "webos": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "web": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" }, - "forceLinking": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/forceLinking" + "webtv": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" }, - "path": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/android/properties/path" + "chromecast": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "kaios": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "macos": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "linux": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "windows": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" + }, + "xbox": { + "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/anyOf/0/properties/tizen" } }, "additionalProperties": false }, - "tizenmobile": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "tizenwatch": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "webos": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "web": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "webtv": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "chromecast": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "kaios": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "macos": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "linux": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "windows": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" - }, - "xbox": { - "$ref": "#/definitions/rnv.project/properties/plugins/additionalProperties/anyOf/0/properties/tizen" + { + "type": "string" } - }, - "additionalProperties": false + ] }, { - "type": "string" + "type": "null" } ] }, diff --git a/packages/core/jsonSchema/rnv.template.json b/packages/core/jsonSchema/rnv.template.json index b567f779ff..29840ca4f2 100644 --- a/packages/core/jsonSchema/rnv.template.json +++ b/packages/core/jsonSchema/rnv.template.json @@ -217,9 +217,6 @@ "additionalProperties": false } }, - "required": [ - "bootstrapQuestions" - ], "additionalProperties": false, "description": "Used in `renative.template.json` allows you to define template behaviour." }, diff --git a/packages/core/src/engines/index.ts b/packages/core/src/engines/index.ts index c4a8858ea2..aa9a254f61 100644 --- a/packages/core/src/engines/index.ts +++ b/packages/core/src/engines/index.ts @@ -21,6 +21,7 @@ const ENGINE_CORE = 'engine-core'; export const registerEngine = async (engine: RnvEngine, platform?: RnvPlatform, engConfig?: RnvEngineTemplate) => { const c = getContext(); logDefault(`registerEngine:${engine.config.id}`); + c.runtime.enginesById[engine.config.id] = engine; c.runtime.enginesByIndex.push(engine); @@ -139,6 +140,7 @@ export const registerMissingPlatformEngines = async (c: RnvContext, taskInstance export const registerAllPlatformEngines = async (c: RnvContext) => { logDefault('registerAllPlatformEngines'); + if (!c.buildConfig?.defaults?.supportedPlatforms?.forEach) { c.runtime.hasAllEnginesRegistered = true; return true; @@ -378,6 +380,7 @@ export const loadEngines = async (c: RnvContext, failOnMissingDeps?: boolean): P } } else { readyEngines.push(k); + logInfo(`Load engine: ${k} ${chalk().gray(`(${engineRootPath})`)}`); engineConfigs.push({ key: k, engineRootPath, @@ -471,8 +474,10 @@ const _resolvePkgPath = (c: RnvContext, packageName: string) => { const _registerPlatformEngine = async (c: RnvContext, platform: RnvPlatform | boolean): Promise => { // Only register active platform engine to be faster + if (platform === true || !platform) return; const selectedEngineTemplate = getEngineTemplateByPlatform(c, platform); + if (selectedEngineTemplate) { const existingEngine = c.runtime.enginesById[selectedEngineTemplate.id]; if (!existingEngine) { @@ -521,7 +526,9 @@ export const hasEngineTask = (task: string, tasks: RnvTaskMap, isProjectScope?: isProjectScope ? !!getEngineTask(task, tasks) : getEngineTask(task, tasks)?.isGlobalScope; export const getEngineSubTasks = (task: string, tasks: RnvTaskMap, exactMatch?: boolean) => - Object.values(tasks).filter((v) => (exactMatch ? v.task.split(' ')[0] === task : v.task.startsWith(task))); + Object.values(tasks).filter((v) => + exactMatch ? v.task.split(' ')[0] === task : v.task.split(' ')[0].startsWith(task) + ); export const getEngineRunner = (c: RnvContext, task: string, customTasks?: RnvTaskMap, failOnMissingEngine = true) => { if (customTasks?.[task]) { diff --git a/packages/core/src/plugins/index.ts b/packages/core/src/plugins/index.ts index 96eed6942a..639a7d2c3e 100644 --- a/packages/core/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -619,18 +619,10 @@ const _overridePlugin = (c: RnvContext, pluginsPath: string, dir: string) => { } if (flavourSource && fsExistsSync(flavourSource)) { - logInfo( - `${chalk().bold(dest.split('node_modules').pop())} overriden by: ${chalk().bold( - flavourSource.split('node_modules').pop() - )}` - ); + logInfo(`${chalk().gray(dest)} overriden by: ${chalk().gray(flavourSource.split('node_modules').pop())}`); copyFolderContentsRecursiveSync(flavourSource, dest, false); } else if (fsExistsSync(source)) { - logInfo( - `${chalk().bold(dest.split('node_modules').pop())} overriden by: ${chalk().bold( - source.split('node_modules').pop() - )}` - ); + logInfo(`${chalk().gray(dest)} overriden by: ${chalk().gray(source.split('node_modules').pop())}`); copyFolderContentsRecursiveSync(source, dest, false); // fsReaddirSync(pp).forEach((dir) => { // copyFileSync(path.resolve(pp, file), path.resolve(c.paths.project.dir, 'node_modules', dir)); @@ -707,9 +699,7 @@ export const overrideFileContents = (dest: string, override: Record 0) { logInfo( - `Found custom assetSources at ${chalk().bold( + `Found custom assetSources at ${chalk().gray( validAssetSources.join('/n') )}. Will be used to generate assets.` ); diff --git a/packages/core/src/runner.ts b/packages/core/src/runner.ts index 616f0a64c1..063b8d3c2b 100644 --- a/packages/core/src/runner.ts +++ b/packages/core/src/runner.ts @@ -4,7 +4,7 @@ import { loadIntegrations } from './integrations'; import { checkAndMigrateProject } from './migrator'; import { checkAndBootstrapIfRequired } from './projects'; import { configureRuntimeDefaults } from './context/runtime'; -import { findSuitableTask, initializeTask } from './tasks'; +import { findSuitableGlobalTask, findSuitableTask, initializeTask } from './tasks'; import { updateRenativeConfigs } from './plugins'; export const executeRnvCore = async () => { @@ -18,9 +18,17 @@ export const executeRnvCore = async () => { if (c.program.npxMode) { return; } + + // Special Case for engine-core tasks + // they don't require other engines to be loaded if isGlobalScope = true + // ie rnv link + const initTask = await findSuitableGlobalTask(); + if (initTask?.task && initTask.isGlobalScope) { + return initializeTask(c, initTask?.task); + } + await loadIntegrations(c); const result = await loadEngines(c); - // If false make sure we reload configs as it means it's freshly installed if (!result) { await updateRenativeConfigs(c); @@ -34,6 +42,7 @@ export const executeRnvCore = async () => { // Some tasks might require all engines to be present (ie rnv platform list) const taskInstance = await findSuitableTask(c); + if (c.command && !taskInstance?.ignoreEngines) { await registerMissingPlatformEngines(c, taskInstance); } diff --git a/packages/core/src/schema/configFiles/project.ts b/packages/core/src/schema/configFiles/project.ts index cb9ad25368..f2c93023a2 100644 --- a/packages/core/src/schema/configFiles/project.ts +++ b/packages/core/src/schema/configFiles/project.ts @@ -1,6 +1,6 @@ import { AnyZodObject, z } from 'zod'; import { CommonSchema } from '../common'; -import { Ext, ExtendTemplate, PlatformsKeys, Runtime } from '../shared'; +import { Ext, ExtendTemplate, PlatformsKeys, Runtime, TemplateConfig } from '../shared'; import { PlatformsSchema } from '../platforms'; import { PluginsSchema } from '../plugins'; @@ -205,6 +205,12 @@ const Paths = z }) .describe('Define custom paths for RNV to look into'); +const UseTemplate = z.object({ + name: z.string(), + version: z.string(), + excludedPaths: z.optional(z.array(z.string())), +}); + //LEVEl 0 (ROOT) const RootProjectBaseFragment = { @@ -212,6 +218,7 @@ const RootProjectBaseFragment = { projectVersion: z.string(), projectName: ProjectName, isMonorepo: z.optional(IsMonoRepo), + useTemplate: z.optional(UseTemplate), isTemplate: z.boolean().optional(), defaults: z.optional(DefaultsSchema), pipes: z.optional(Pipes), @@ -229,6 +236,7 @@ const RootProjectBaseFragment = { integrations: z.optional(Integrations), env: z.optional(Env), runtime: z.optional(Runtime), + templateConfig: TemplateConfig.optional(), skipAutoUpdate: z .boolean() .optional() diff --git a/packages/core/src/schema/configFiles/template.ts b/packages/core/src/schema/configFiles/template.ts index 6530e4b484..b859513ced 100644 --- a/packages/core/src/schema/configFiles/template.ts +++ b/packages/core/src/schema/configFiles/template.ts @@ -1,54 +1,11 @@ import { z } from 'zod'; import { DefaultsSchema, EnginesSchema } from './project'; - -const NpmDep = z.record(z.string(), z.string()); - -const BootstrapQuestionsSchema = z - .array( - z.object({ - options: z - .array( - z.object({ - title: z.string(), - value: z.object({}), - }) - ) - .optional(), - configProp: z - .object({ - prop: z.string(), - key: z.string(), - }) - .optional(), - type: z.string(), - title: z.string(), - }) - ) - .describe('Defines list of custom bootstrap questions'); +import { TemplateConfig } from '../shared'; export const RootTemplateSchema = z.object({ defaults: z.optional(DefaultsSchema), engines: z.optional(EnginesSchema), - templateConfig: z - .object({ - includedPaths: z - .array(z.string()) - .describe('Defines list of all file/dir paths you want to include in template') - .optional(), - bootstrapQuestions: BootstrapQuestionsSchema, - packageTemplate: z.optional( - z.object({ - dependencies: z.optional(NpmDep), - devDependencies: z.optional(NpmDep), - peerDependencies: z.optional(NpmDep), - optionalDependencies: z.optional(NpmDep), - name: z.string().optional(), - version: z.string().optional(), - }) - ), - }) - .describe('Used in `renative.template.json` allows you to define template behaviour.') - .optional(), + templateConfig: TemplateConfig.optional(), }); // { diff --git a/packages/core/src/schema/plugins/index.ts b/packages/core/src/schema/plugins/index.ts index e120b08767..649d021794 100644 --- a/packages/core/src/schema/plugins/index.ts +++ b/packages/core/src/schema/plugins/index.ts @@ -57,7 +57,7 @@ export type _PluginPlatformMergedSchemaType = z.infer; export const PluginsSchema = z - .record(z.string(), z.union([PluginSchema, z.string()])) + .record(z.string(), z.union([PluginSchema, z.string()]).nullable()) .describe( 'Define all plugins available in your project. you can then use `includedPlugins` and `excludedPlugins` props to define active and inactive plugins per each app config' ); diff --git a/packages/core/src/schema/shared/index.ts b/packages/core/src/schema/shared/index.ts index 628a792401..6d66722325 100644 --- a/packages/core/src/schema/shared/index.ts +++ b/packages/core/src/schema/shared/index.ts @@ -41,3 +41,48 @@ export const BuildSchemeFragment = { ) ), }; + +const NpmDep = z.record(z.string(), z.string()); + +const BootstrapQuestionsSchema = z + .array( + z.object({ + options: z + .array( + z.object({ + title: z.string(), + value: z.object({}), + }) + ) + .optional(), + configProp: z + .object({ + prop: z.string(), + key: z.string(), + }) + .optional(), + type: z.string(), + title: z.string(), + }) + ) + .describe('Defines list of custom bootstrap questions'); + +export const TemplateConfig = z + .object({ + includedPaths: z + .array(z.string()) + .describe('Defines list of all file/dir paths you want to include in template') + .optional(), + bootstrapQuestions: BootstrapQuestionsSchema.optional(), + packageTemplate: z.optional( + z.object({ + dependencies: z.optional(NpmDep), + devDependencies: z.optional(NpmDep), + peerDependencies: z.optional(NpmDep), + optionalDependencies: z.optional(NpmDep), + name: z.string().optional(), + version: z.string().optional(), + }) + ), + }) + .describe('Used in `renative.template.json` allows you to define template behaviour.'); diff --git a/packages/core/src/tasks/index.ts b/packages/core/src/tasks/index.ts index 8f1846c14e..f967955a79 100644 --- a/packages/core/src/tasks/index.ts +++ b/packages/core/src/tasks/index.ts @@ -30,6 +30,11 @@ export const registerCustomTask = async (_c: RnvContext, task: RnvTask) => { export const initializeTask = async (c: RnvContext, task: string) => { logDefault('initializeTask', task); + logInfo( + `Current engine: ${chalk().bold(c.runtime.engine?.config.id)} ${chalk().grey( + `(${c.runtime.engine?.rootPath})` + )}` + ); c.runtime.task = task; executedTasks = {}; @@ -118,6 +123,21 @@ export const getAllSuitableTasks = (c: RnvContext): Record { + const c = getContext(); + if (!c.command) return undefined; + let task = ''; + + if (c.command) task = c.command; + if (c.subCommand) task += ` ${c.subCommand}`; + + c.runtime.engine = getEngineRunner(c, task, undefined, false); + + const tsk = getEngineTask(task, c.runtime.engine?.tasks); + + return tsk; +}; + export const findSuitableTask = async (c: RnvContext, specificTask?: string): Promise => { logDefault('findSuitableTask'); const REGISTERED_ENGINES = getRegisteredEngines(c); @@ -184,16 +204,15 @@ export const findSuitableTask = async (c: RnvContext, specificTask?: string): Pr if (c.command) task = c.command; if (c.subCommand) task += ` ${c.subCommand}`; - let suitableEngines = REGISTERED_ENGINES.filter((engine) => - hasEngineTask(task, engine.tasks, c.paths.project.configExists) - ); + let suitableEngines = REGISTERED_ENGINES.filter((engine) => { + return hasEngineTask(task, engine.tasks, c.paths.project.configExists); + }); const autocompleteEngines = REGISTERED_ENGINES.filter( (engine) => getEngineSubTasks(task, engine.tasks, true).length ); const isAutoComplete = !suitableEngines.length && !!c.command && !autocompleteEngines.length; - if (!suitableEngines.length) { // Get all supported tasks const supportedSubtasksArr: Array<{ @@ -201,8 +220,11 @@ export const findSuitableTask = async (c: RnvContext, specificTask?: string): Pr taskKey: string; }> = []; REGISTERED_ENGINES.forEach((engine) => { - getEngineSubTasks(task, engine.tasks).forEach((taskInstance) => { + const st = getEngineSubTasks(task, engine.tasks); + + st.forEach((taskInstance) => { const isNotViable = !c.paths.project.configExists && !taskInstance.isGlobalScope; + if (!isNotViable) { const taskKey = isAutoComplete ? taskInstance.task : taskInstance.task.split(' ')[1]; @@ -247,12 +269,13 @@ export const findSuitableTask = async (c: RnvContext, specificTask?: string): Pr }; }); - const message = isAutoComplete - ? `Autocomplete action for "${c.command}"` - : `Pick a subCommand for ${c.command}`; - const subTasks = Object.keys(supportedSubtasks); - if (subTasks.length) { + if (subTasks.length && c.runtime.hasAllEnginesRegistered) { + // Only offer autocomple option if all engines are registered + + const message = isAutoComplete + ? `Autocomplete action for "${c.command}"` + : `Pick a subCommand for ${c.command}`; const { subCommand } = await inquirerPrompt({ type: 'list', name: 'subCommand', @@ -278,10 +301,9 @@ export const findSuitableTask = async (c: RnvContext, specificTask?: string): Pr ); } } - if (CUSTOM_TASKS[task]) { // Custom tasks are executed by core engine - logInfo(`Running custom task ${task}`); + logInfo(`Running custom task ${chalk().bold(task)}`); } else if (!suitableEngines.length) { if (!c.runtime.hasAllEnginesRegistered) { // No platform was specified. we have no option other than load all engines and offer platform list next round @@ -308,11 +330,6 @@ export const findSuitableTask = async (c: RnvContext, specificTask?: string): Pr c.runtime.runtimeExtraProps = c.runtime.engine.runtimeExtraProps; } - logInfo( - `Current Engine: ${chalk().bold(c.runtime.engine?.config.id)} path: ${chalk().grey( - c.runtime.engine?.rootPath - )}` - ); const customTask = CUSTOM_TASKS[task]; if (customTask) { c.runtime.availablePlatforms = customTask.platforms; diff --git a/packages/core/src/templates/index.ts b/packages/core/src/templates/index.ts index ba55fa6225..8837e1fc5f 100644 --- a/packages/core/src/templates/index.ts +++ b/packages/core/src/templates/index.ts @@ -174,15 +174,8 @@ const _configureRenativeConfig = async (c: RnvContext) => { logInfo( `Your ${c.paths.project.config} needs to be updated with ${c.paths.template.configTemplate}. UPDATING...DONE` ); - if (c.files.project.config_original && templateConfig) { - const mergedObj = mergeObjects( - c, - templateConfig, - c.files.project.config_original, - false, - true - ); - + const mergedObj = getProjectTemplateMergedConfig(c, templateConfig); + if (mergedObj) { // Do not override supportedPlatforms mergedObj.defaults = mergedObj.defaults || {}; mergedObj.defaults.supportedPlatforms = c.files.project.config_original?.defaults?.supportedPlatforms; @@ -205,12 +198,28 @@ const _configureRenativeConfig = async (c: RnvContext) => { return true; }; +const getProjectTemplateMergedConfig = (c: RnvContext, templateConfig: ConfigFileTemplate | null) => { + if (c.files.project.config_original && templateConfig) { + const mergedObj = mergeObjects( + c, + templateConfig, + c.files.project.config_original, + false, + true + ); + return mergedObj; + } + return null; +}; + export const configureTemplateFiles = async (c: RnvContext) => { logDefault('configureTemplateFiles'); const templateConfig = readObjectSync(c.paths.template.configTemplate); - const includedPaths = templateConfig?.templateConfig?.includedPaths; + let mergedObj = getProjectTemplateMergedConfig(c, templateConfig); + const includedPaths = mergedObj?.templateConfig?.includedPaths; + if (includedPaths) { includedPaths.forEach((name: string) => { if (c.paths.template.dir) { diff --git a/packages/engine-core/src/buildSchemes.ts b/packages/engine-core/src/buildSchemes.ts index e118956e7a..940ac78dac 100644 --- a/packages/engine-core/src/buildSchemes.ts +++ b/packages/engine-core/src/buildSchemes.ts @@ -55,6 +55,6 @@ export const isBuildSchemeSupported = async (c: RnvContext) => { c.program.scheme = schemeVals[selectedScheme]; c.runtime.scheme = c.program.scheme; } - logInfo(`Current Build Scheme: ${chalk().bold.white(c.runtime.scheme)}`); + logInfo(`Current Build Scheme: ${chalk().bold(c.runtime.scheme)}`); return true; }; diff --git a/packages/engine-core/src/tasks/global/taskNew.ts b/packages/engine-core/src/tasks/global/taskNew.ts index 745231c3ea..617418c176 100644 --- a/packages/engine-core/src/tasks/global/taskNew.ts +++ b/packages/engine-core/src/tasks/global/taskNew.ts @@ -158,7 +158,7 @@ const _prepareProjectOverview = (c: RnvContext, data: NewProjectData) => { data.confirmString = str; }; -type ConfigProp = Required['templateConfig']['bootstrapQuestions'][number]['configProp']; +type ConfigProp = Required['templateConfig']>['bootstrapQuestions'][number]['configProp']; type QuestionResults = Record< string, @@ -169,7 +169,7 @@ type QuestionResults = Record< } >; -type BootstrapQuestions = Required['templateConfig']['bootstrapQuestions']; +type BootstrapQuestions = Required['templateConfig']>['bootstrapQuestions']; const interactiveQuestion = async ( results: QuestionResults, diff --git a/packages/engine-core/src/tasks/linking/taskLink.ts b/packages/engine-core/src/tasks/linking/taskLink.ts index 14ed2a97b6..e5b2b412c9 100644 --- a/packages/engine-core/src/tasks/linking/taskLink.ts +++ b/packages/engine-core/src/tasks/linking/taskLink.ts @@ -21,6 +21,13 @@ const _linkPackage = (c: RnvContext, key: string, folder: string) => { if (fsExistsSync(rnvPathUnlinked)) { logInfo(`${key} is already linked. SKIPPING`); + + try { + fsSymlinkSync(pkgDir, rnvPath); + } catch (e) { + // In case of corrupted symlinks we attempt to relink + // however existing symlinks will throw error + } } else if (fsExistsSync(rnvPath)) { fsRenameSync(rnvPath, rnvPathUnlinked); fsSymlinkSync(pkgDir, rnvPath); diff --git a/packages/engine-lightning/src/tasks/taskRun.ts b/packages/engine-lightning/src/tasks/taskRun.ts index dfde1cef03..4d72e9e842 100644 --- a/packages/engine-lightning/src/tasks/taskRun.ts +++ b/packages/engine-lightning/src/tasks/taskRun.ts @@ -39,6 +39,7 @@ const Task: RnvTask = { fn: taskRun, fnHelp: taskRunHelp, task: RnvTaskName.run, + isPriorityOrder: true, // dependencies: { // before: RnvTaskName.configure, // }, diff --git a/packages/engine-rn-electron/src/tasks/taskRun.ts b/packages/engine-rn-electron/src/tasks/taskRun.ts index 1218e7bc48..fb161c6469 100644 --- a/packages/engine-rn-electron/src/tasks/taskRun.ts +++ b/packages/engine-rn-electron/src/tasks/taskRun.ts @@ -35,6 +35,7 @@ const Task: RnvTask = { description: 'Run your electron app on your machine', fn: taskRun, task: RnvTaskName.run, + isPriorityOrder: true, options: RnvTaskOptionPresets.withBase(RnvTaskOptionPresets.withConfigure(RnvTaskOptionPresets.withRun())), platforms: ['macos', 'windows', 'linux'], }; diff --git a/packages/engine-rn-macos/src/tasks/taskRun.ts b/packages/engine-rn-macos/src/tasks/taskRun.ts index a7fa02d3c8..17beabe10f 100644 --- a/packages/engine-rn-macos/src/tasks/taskRun.ts +++ b/packages/engine-rn-macos/src/tasks/taskRun.ts @@ -54,6 +54,7 @@ const Task: RnvTask = { fn: taskRun, fnHelp: taskRunHelp, task: RnvTaskName.run, + isPriorityOrder: true, // dependencies: { // before: RnvTaskName.configure, // }, diff --git a/packages/engine-rn-next/src/tasks/taskRun.ts b/packages/engine-rn-next/src/tasks/taskRun.ts index 59ade12d14..605ed9b9b6 100644 --- a/packages/engine-rn-next/src/tasks/taskRun.ts +++ b/packages/engine-rn-next/src/tasks/taskRun.ts @@ -32,6 +32,7 @@ const Task: RnvTask = { description: 'Run your app in browser', fn: taskRun, task: RnvTaskName.run, + isPriorityOrder: true, options: RnvTaskOptionPresets.withBase(RnvTaskOptionPresets.withConfigure(RnvTaskOptionPresets.withRun())), platforms: ['web', 'chromecast'], }; diff --git a/packages/engine-rn-tvos/renative.engine.json b/packages/engine-rn-tvos/renative.engine.json index cb1c63e82d..53f5a92c1e 100644 --- a/packages/engine-rn-tvos/renative.engine.json +++ b/packages/engine-rn-tvos/renative.engine.json @@ -9,8 +9,7 @@ "react-art": "source:rnv", "react-dom": "source:rnv", "react-native": "source:rnv", - "react-native-tvos": "source:rnv", - "react-native-web": "source:rnv" + "react-native-tvos": "source:rnv" }, "npm": { "devDependencies": {} diff --git a/packages/engine-rn-tvos/src/tasks/taskRun.ts b/packages/engine-rn-tvos/src/tasks/taskRun.ts index ba195971c1..25343be9f7 100644 --- a/packages/engine-rn-tvos/src/tasks/taskRun.ts +++ b/packages/engine-rn-tvos/src/tasks/taskRun.ts @@ -73,6 +73,7 @@ const Task: RnvTask = { fn: taskRun, fnHelp: taskRunHelp, task: RnvTaskName.run, + isPriorityOrder: true, // dependencies: { // before: RnvTaskName.configure, // }, diff --git a/packages/engine-rn-web/src/tasks/taskRun.ts b/packages/engine-rn-web/src/tasks/taskRun.ts index 08e3f0f1f8..db2895c5d6 100644 --- a/packages/engine-rn-web/src/tasks/taskRun.ts +++ b/packages/engine-rn-web/src/tasks/taskRun.ts @@ -128,6 +128,7 @@ const Task: RnvTask = { description: 'Run your app in browser', fn: taskRun, task: RnvTaskName.run, + isPriorityOrder: true, options: RnvTaskOptionPresets.withBase(RnvTaskOptionPresets.withConfigure(RnvTaskOptionPresets.withRun())), platforms: ['web', 'webtv', 'tizen', 'webos', 'tizenmobile', 'tizenwatch', 'kaios', 'chromecast'], }; diff --git a/packages/engine-rn-windows/src/tasks/taskRun.ts b/packages/engine-rn-windows/src/tasks/taskRun.ts index bf2027fd49..e10a54eaca 100644 --- a/packages/engine-rn-windows/src/tasks/taskRun.ts +++ b/packages/engine-rn-windows/src/tasks/taskRun.ts @@ -40,6 +40,7 @@ const Task: RnvTask = { description: 'Run your app in a window on desktop', fn: taskRun, task: RnvTaskName.run, + isPriorityOrder: true, options: RnvTaskOptionPresets.withBase(RnvTaskOptionPresets.withConfigure(RnvTaskOptionPresets.withRun())), platforms: ['windows', 'xbox'], }; diff --git a/packages/engine-rn/src/tasks/taskRun.ts b/packages/engine-rn/src/tasks/taskRun.ts index d43a36785a..15e40a0241 100644 --- a/packages/engine-rn/src/tasks/taskRun.ts +++ b/packages/engine-rn/src/tasks/taskRun.ts @@ -78,6 +78,7 @@ const Task: RnvTask = { fn: taskRun, fnHelp: taskRunHelp, task: RnvTaskName.run, + isPriorityOrder: true, // dependencies: { // before: RnvTaskName.configure, // }, diff --git a/packages/rnv/pluginTemplates/renative.plugins.json b/packages/rnv/pluginTemplates/renative.plugins.json index 662570b642..803704fe79 100644 --- a/packages/rnv/pluginTemplates/renative.plugins.json +++ b/packages/rnv/pluginTemplates/renative.plugins.json @@ -1,12 +1,37 @@ { "$schema": "../../../.rnv/schema/rnv.plugins.json", + "comments": [ + "This is the main configuration file for RNV plugins. It allows you to define which plugins you want to use and their versions.", + "It also acts as override against @flexn/plugins" + ], "pluginTemplates": { "@rnv/renative": { - "version": "1.0.0-rc.12", - "webpack": { - "moduleAliases": true, + "version": "1.0.0-rc.12" + }, + "react-native-tvos": { + "version": "0.73.1-3" + }, + "react-native-web": { + "version": "0.19.9", + "webpackConfig": { "modulePaths": true } + }, + "next": { + "version": "14.1.0", + "disablePluginTemplateOverrides": true + }, + "react-native": { + "version": "0.73.4" + }, + "@react-native-community/cli-platform-ios": { + "version": "11.3.7", + "disablePluginTemplateOverrides": false, + "disableNpm": true + }, + "react-native-gesture-handler": { + "version": "2.14.1", + "disablePluginTemplateOverrides": true } } } diff --git a/packages/template-starter/renative.json b/packages/template-starter/renative.json index 5a9ddca580..8b87fd95c3 100644 --- a/packages/template-starter/renative.json +++ b/packages/template-starter/renative.json @@ -135,40 +135,16 @@ } }, "plugins": { - "@rnv/renative": { - "source": "rnv", - "webpackConfig": { - "modulePaths": true - } - }, + "@rnv/renative": "source:rnv", "react": "source:rnv", "react-art": "source:rnv", "react-dom": "source:rnv", - "react-native-gesture-handler": { - "version": "2.14.1", - "disablePluginTemplateOverrides": true - }, - "@react-native-community/cli-platform-ios": { - "version": "11.3.7", - "disablePluginTemplateOverrides": false, - "disableNpm": true - }, - "react-native": { - "version": "0.73.4" - }, - "next": { - "version": "14.1.0", - "disablePluginTemplateOverrides": true - }, - "react-native-web": { - "version": "0.19.9", - "webpackConfig": { - "modulePaths": true - } - }, - "react-native-tvos": { - "version": "0.73.1-3" - } + "react-native-gesture-handler": "source:rnv", + "@react-native-community/cli-platform-ios": "source:rnv", + "react-native": "source:rnv", + "next": "source:rnv", + "react-native-web": "source:rnv", + "react-native-tvos": "source:rnv" }, "permissions": { "ios": {}, diff --git a/packages/template-starter/src/entry/index.web.ts b/packages/template-starter/src/entry/index.web.ts deleted file mode 100644 index 84b9253e09..0000000000 --- a/packages/template-starter/src/entry/index.web.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from '../app'; - -ReactDOM.render(React.createElement(App), document.getElementById('root')); diff --git a/packages/template-starter/src/entry/index.web.tsx b/packages/template-starter/src/entry/index.web.tsx new file mode 100644 index 0000000000..94a59dd08d --- /dev/null +++ b/packages/template-starter/src/entry/index.web.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from '../app'; + +const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); +root.render( + + + +);