-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1113 from flexn-io/feat/rn-upgrade-ts-3
ReNative major refactor
- Loading branch information
Showing
637 changed files
with
18,006 additions
and
21,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,8 @@ buck-out/ | |
# Testing | ||
/packages/**/coverage | ||
/packages/**/dist | ||
/packages/**/lib | ||
|
||
.expo | ||
coverage | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
LOAD FILES TO MEMORY (MIGHT TAKE SEVERAL ROUNDS?) | ||
|
||
generate abstract runtime definitions | ||
generate all injections | ||
|
||
CREATE ABSTRACT CONTEXT INFO | ||
|
||
GENERATE / COPY NEW FILES | ||
|
||
copy over template files (.tpl files to be injected ) | ||
|
||
rnv | ||
|
||
@rnv/cli | ||
@rnv/core | ||
@rnv/sdk-tizen | ||
@rnv/sdk-webos | ||
@rnv/sdk-apple | ||
|
||
import { executeRnv } from '@rnv/core' | ||
|
||
await executeRnv({ | ||
commandAsString: 'rnv run -p ios', | ||
commandAsObject: { | ||
command: 'run', | ||
}, | ||
cwd: '', | ||
errorHandler: async ({}) => { | ||
return true; | ||
}, | ||
inputHandler: async ({}) => { | ||
|
||
}, | ||
logger: ({}) => { | ||
|
||
} | ||
|
||
}); | ||
|
||
- make build hooks typescript (with autocomplete) | ||
- split rnv into cli & core | ||
- move sdkManger to separate sdk packages | ||
- rethink templateFile injection system | ||
- renative.json: engines.engine-rn.platforms.ios.template.ignoreFiles: [] | ||
- merge engine-rn + tvos + macos???? | ||
|
||
templateFiles: { | ||
'ios/Info.plist': { | ||
isTemplate: source.endsWith('.tpl'), | ||
source: 'ios/Info.plist.tpl', | ||
dest: 'ios/Info.plist', | ||
injections: { | ||
'{{NAME}}': 'myApp' | ||
} | ||
}, | ||
'ios/image.png': { | ||
source: 'ios/image.png', | ||
dest: 'ios/image.png' | ||
} | ||
} | ||
|
||
if isTemplate = true && injections = undefined => use global injections | ||
if isTemplate = true && injections = {...} => use local injections | ||
|
||
reading config files 17 times in the first half of an rnv run :D | ||
a plugin that was removed from renative.json still has it's orchestra-plugins/builds and renative.plugins.json overrides applied |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// __mocks__/@rnv/core.ts | ||
const rnvcore: any = jest.createMockFromModule('@rnv/core'); | ||
|
||
const configPropMocks = { | ||
scheme: 'debug', | ||
bundleAssets: false, | ||
}; | ||
|
||
const _chalkCols: any = { | ||
white: (v) => v, | ||
green: (v) => v, | ||
red: (v) => v, | ||
yellow: (v) => v, | ||
default: (v) => v, | ||
gray: (v) => v, | ||
grey: (v) => v, | ||
blue: (v) => v, | ||
cyan: (v) => v, | ||
magenta: (v) => v, | ||
}; | ||
_chalkCols.rgb = () => (v) => v; | ||
_chalkCols.bold = _chalkCols; | ||
const _chalkMono = { | ||
..._chalkCols, | ||
}; | ||
|
||
rnvcore.getEngineRunnerByPlatform = () => ({ | ||
getOriginalPlatformTemplatesDir: () => 'sometemptdir', | ||
}); | ||
rnvcore.executeTask = jest.fn(); | ||
rnvcore.shouldSkipTask = () => false; | ||
rnvcore.generatePlatformChoices = () => []; | ||
rnvcore.executeAsync = jest.fn(); | ||
rnvcore.removeDirs = jest.fn(); | ||
rnvcore.fsExistsSync = () => true; | ||
rnvcore.fsReaddirSync = () => []; | ||
rnvcore.getRealPath = () => ''; | ||
rnvcore.copyFolderContentsRecursiveSync = jest.fn(); | ||
|
||
rnvcore.getConfigProp = (c, platform, key) => configPropMocks[key]; | ||
rnvcore.confirmActiveBundler = () => null; | ||
rnvcore.getAppFolder = () => null; | ||
|
||
rnvcore.logToSummary = jest.fn(); | ||
rnvcore.logTask = jest.fn(); | ||
rnvcore.logDebug = jest.fn(); | ||
rnvcore.logInfo = jest.fn(); | ||
rnvcore.logError = jest.fn(); | ||
rnvcore.logWarning = jest.fn(); | ||
rnvcore.logSuccess = jest.fn(); | ||
rnvcore.logSummary = jest.fn(); | ||
rnvcore.chalk = () => _chalkMono; | ||
|
||
// Common: { | ||
// getConfigProp: (c, platform, key) => configPropMocks[key], | ||
// confirmActiveBundler: () => null, | ||
// getAppFolder: () => null, | ||
// }, | ||
// Logger: { | ||
// logToSummary: jest.fn(), | ||
// logTask: jest.fn(), | ||
// logDebug: jest.fn(), | ||
// logInfo: jest.fn(), | ||
// logError: jest.fn(), | ||
// logWarning: jest.fn(), | ||
// logSuccess: jest.fn(), | ||
// logSummary: jest.fn(), | ||
// chalk: () => _chalkMono, | ||
// }, | ||
// FileUtils: { | ||
// fsExistsSync: () => null, | ||
// copyFileSync: () => null, | ||
// }, | ||
// Constants: { | ||
// PARAMS: { | ||
// withBase: () => [], | ||
// withRun: () => [], | ||
// withConfigure: () => [], | ||
// }, | ||
// IOS: 'ios', | ||
// }, | ||
// TaskManager: { | ||
// executeTask: () => null, | ||
// executeOrSkipTask: () => null, | ||
// shouldSkipTask: () => false, | ||
// }, | ||
// Exec: { | ||
// executeAsync: () => null, | ||
// }, | ||
// ObjectUtils: { | ||
// isObject: () => null, | ||
// }, | ||
// PluginManager: { | ||
// parsePlugins: () => null, | ||
// }, | ||
// ProjectManager: { | ||
// copyAssetsFolder: () => null, | ||
// copyBuildsFolder: () => null, | ||
// parseFonts: () => null, | ||
// }, | ||
// Resolver: { | ||
// doResolve: () => null, | ||
// doResolvePath: () => null, | ||
// }, | ||
// Prompt: { | ||
// isSystemWin: () => null, | ||
// }, | ||
// Utils: { | ||
// inquirerPrompt: () => null, | ||
// }, | ||
// PlatformManager: { | ||
// isPlatformActive: () => null, | ||
// logErrorPlatform: () => null, | ||
// }, | ||
// RuntimeManager: { | ||
// updateRenativeConfigs: () => null, | ||
// }, | ||
// SDKManager: { | ||
// Apple: { | ||
// launchAppleSimulator: () => null, | ||
// }, | ||
// Android: {}, | ||
// }, | ||
|
||
module.exports = rnvcore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// __mocks__/@rnv/sdk-apple.ts | ||
const sdkApple: any = jest.createMockFromModule('@rnv/sdk-apple'); | ||
|
||
sdkApple.launchAppleSimulator = () => null; | ||
|
||
module.exports = sdkApple; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// __mocks__/axios.ts | ||
const axios: any = jest.createMockFromModule('axios'); | ||
|
||
axios.get = () => true; | ||
|
||
module.exports = axios; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// __mocks__/child_process.ts | ||
|
||
const child_process: any = jest.createMockFromModule('child_process'); | ||
|
||
child_process.spawn = jest.fn(); | ||
|
||
module.exports = child_process; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// __mocks__/inquirer.ts | ||
const inquirer: any = jest.createMockFromModule('inquirer'); | ||
|
||
inquirer.prompt = () => true; | ||
|
||
module.exports = inquirer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// __mocks__/rnv.ts | ||
const rnv: any = jest.createMockFromModule('rnv'); | ||
|
||
module.exports = rnv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// __mocks__/rnv.ts | ||
const shelljs: any = jest.createMockFromModule('shelljs'); | ||
|
||
shelljs.mkdir = () => { | ||
//NOOP | ||
}; | ||
|
||
module.exports = shelljs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
node_modules | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Pavel Jacko | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cli | ||
|
Oops, something went wrong.