Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-release stabilization #1364

Merged
merged 32 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
935730d
Update PULL_REQUEST_TEMPLATE.md
mihaiblaga89 Nov 27, 2023
b215fd9
Merge pull request #1261 from flexn-io/fix/update_pr_template
pavjacko Nov 28, 2023
6911300
Merge pull request #1260 from flexn-io/release/1.0
mihaiblaga89 Dec 11, 2023
7e73777
Bump follow-redirects from 1.15.3 to 1.15.4
dependabot[bot] Jan 11, 2024
bf95a2e
Merge pull request #1336 from flexn-io/dependabot/npm_and_yarn/follow…
mihaiblaga89 Jan 12, 2024
b757135
fix linter
pavjacko Jan 25, 2024
94411d1
fix/withRNVRNConfig
ElenaDiachenko Jan 25, 2024
26d109f
fix. Improve webpack callback chaining in withRNVNext to execute cust…
magician-margatroid Jan 25, 2024
330148a
fix. Fix typo of parameter for webpack callback.
magician-margatroid Jan 25, 2024
d66bbb9
refactor podfile install checks
pavjacko Jan 25, 2024
ce04940
remove support for cocoapods version older than 1.9
pavjacko Jan 25, 2024
8a96f55
add extra podfile checks
pavjacko Jan 26, 2024
7aae843
fix defaultTargets not working. fix rnv target launch -p ios, fix pod…
pavjacko Jan 26, 2024
fcca1e7
fix npx rnv warning for local bootstrap rnv
pavjacko Jan 26, 2024
6274016
add default log handler
pavjacko Jan 26, 2024
e5dd95c
add telemetry configs, fix root engine path
pavjacko Jan 26, 2024
3c941d3
add telemetry debug option
pavjacko Jan 26, 2024
55e7b99
fix engine plugins messaging
pavjacko Jan 26, 2024
37c4474
Merge branch 'release/1.0' into fix/release-hotfixes
pavjacko Jan 26, 2024
09efcf4
revert accidental removal of deps
pavjacko Jan 26, 2024
eb42003
disable react-native-permissions for tvos
ElenaDiachenko Jan 26, 2024
697f9c6
disable rn-carplay for tvos
pavjacko Jan 26, 2024
c3ab334
Merge branch 'fix/withRNVRNConfig' into fix/release-hotfixes
pavjacko Jan 26, 2024
5319030
fix disabled plugins, fix getSkipLinkingDeps
pavjacko Jan 26, 2024
a8f9092
cleaner error logging. add NO_SPINNER_FULL_ERROR_SUMMARY exec preset
pavjacko Jan 26, 2024
e355f21
better target launch handling
pavjacko Jan 26, 2024
9526796
add proper message
pavjacko Jan 26, 2024
c2b1d8d
make first rnv argument optional in order to allow `rnv` top level co…
pavjacko Jan 26, 2024
3d3fb9b
Merge pull request #1363 from magician-margatroid/fix/custom-next-web…
pavjacko Jan 29, 2024
c24ee8f
Merge branch 'release/1.0'
pavjacko Jan 29, 2024
70e3911
Merge branch 'main' into fix/release-hotfixes
pavjacko Jan 29, 2024
7119d15
fix workspace default check
pavjacko Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 5 additions & 75 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,11 @@
## Description

- Describe the nature of the work / fix
- Small description

## Breaking Changes
## Related issues

- PRs should not introduce breaking changes to existing functionality
- if breaking change cannot be avoided it has to be introduced in 2 phases (release cycles of 0.x.0)
- `0.x.0` Add new functionality + add `DEPRECATED` warning to existing fuctionality
- `0.[x+1].0` Remove deprecated functionality
- GH issues

## I have tested my changes on:
## Npm releases

ReNative project directly:

- [ ] ios simulator
- [ ] ios device
- [ ] android simulator
- [ ] android device
- [ ] web browser
- [ ] tvos simulator
- [ ] tvos device
- [ ] androidtv simulator
- [ ] androidtv device
- [ ] androidwear simulator
- [ ] androidwear device
- [ ] tizen simulator
- [ ] tizen device
- [ ] tizenmobile simulator
- [ ] tizenwatch device
- [ ] webos simulator
- [ ] webos device
- [ ] macos
- [ ] windows
- [ ] chromecast device

New project:

- [ ] ios simulator
- [ ] ios device
- [ ] android simulator
- [ ] android device
- [ ] web browser
- [ ] tvos simulator
- [ ] tvos device
- [ ] androidtv simulator
- [ ] androidtv device
- [ ] androidwear simulator
- [ ] androidwear device
- [ ] tizen simulator
- [ ] tizen device
- [ ] tizenmobile simulator
- [ ] tizenwatch device
- [ ] webos simulator
- [ ] webos device
- [ ] macos
- [ ] windows
- [ ] chromecast device

Existing Project created with previous version of renative:

- [ ] ios simulator
- [ ] ios device
- [ ] android simulator
- [ ] android device
- [ ] web browser
- [ ] tvos simulator
- [ ] tvos device
- [ ] androidtv simulator
- [ ] androidtv device
- [ ] androidwear simulator
- [ ] androidwear device
- [ ] tizen simulator
- [ ] tizen device
- [ ] tizenmobile simulator
- [ ] tizenwatch device
- [ ] webos simulator
- [ ] webos device
- [ ] macos
- [ ] windows
- [ ] chromecast device
n/a
13 changes: 12 additions & 1 deletion packages/app-harness/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
},
"podName": "react-native-splash-screen"
},
"tvos": {
"disabled": true
},
"version": "3.3.0"
},
"react-native-carplay": {
Expand All @@ -52,9 +55,17 @@
},
"podName": "react-native-carplay"
},
"tvos": {
"disabled": true
},
"version": "2.3.0"
},
"react-native-permissions": "3.10.1",
"react-native-permissions": {
"tvos": {
"disabled": true
},
"version": "3.10.1"
},
"react-native": {
"android": {
"implementation": "// TEST"
Expand Down
13 changes: 13 additions & 0 deletions packages/app-harness/src/app/index.tvos.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Text, View } from 'react-native';

const App = () => {
return (
<View>
<Text>ReNative Harness</Text>
<Text>{`hermes: ${typeof HermesInternal === 'object' && HermesInternal !== null ? 'yes' : 'no'}`}</Text>
</View>
);
};

export default App;
4 changes: 3 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const run = () => {
cmd += `-${param.shortcut}, `;
}
cmd += `--${param.key}`;

if (param.value) {
if (param.isRequired) {
cmd += ` <${param.value}>`;
Expand All @@ -46,7 +47,8 @@ export const run = () => {
program.option(cmd, param.description);
});

program.arguments('<cmd> [option]').action((cmd, option) => {
// Make both arguments optional un order to allow `$ rnv` top level command
program.arguments('[cmd] [option]').action((cmd, option) => {
cmdValue = cmd;
cmdOption = option;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const logSummary = (header = 'SUMMARY') => {

if (_jsonOnly) return;

if (ctx.paths.project.configExists && !ctx.paths.IS_NPX_MODE) {
if (ctx.paths.project.configExists && !ctx.paths.IS_NPX_MODE && !ctx.paths.IS_LINKED) {
logAndSave(chalk().yellow('You are trying to run global rnv command in your current project.'), true);
logAndSave(chalk().yellow('This might lead to unexpected behaviour.'), true);
logAndSave(chalk().yellow('Run your rnv command with npx prefix:'), true);
Expand Down
34 changes: 32 additions & 2 deletions packages/core/src/api/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,43 @@ const spinner: any = () => ({
text: '',
});

const logger: any = {};
const defaultLog: any = (v: string) => {
console.log(`DEFAULT LOGGER: ${v}`);
};
const defaultGetString = () => '';
const defaultGetBool = () => false;

export const generateApiDefaults = (): RnvApi => ({
isDefault: true,
doResolve,
getConfigProp: getConfigProp,
logger,
logger: {
printArrIntoBox: defaultLog,
getCurrentCommand: defaultGetString,
isInfoEnabled: defaultGetBool,
logAndSave: defaultLog,
chalk: defaultLog,
logAppInfo: defaultLog,
logComplete: defaultLog,
logDebug: defaultLog,
logEnd: defaultLog,
logError: defaultLog,
logExitTask: defaultLog,
logHook: defaultLog,
logInfo: defaultLog,
logInitialize: defaultLog,
logInitTask: defaultLog,
logRaw: defaultLog,
logSuccess: defaultLog,
logSummary: defaultLog,
logTask: defaultLog,
logToSummary: defaultLog,
logWarning: defaultLog,
logWelcome: defaultLog,
printBoxEnd: defaultLog,
printBoxStart: defaultLog,
printIntoBox: defaultLog,
},
analytics: {
captureEvent: () => {
//NOOP
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/configs/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'path';
import { chalk, logTask, logDebug, logInfo, logWarning } from '../logger';
import { RnvContext } from '../context/types';
import { generateOptions, inquirerPrompt } from '../api';
import { ConfigFileWorkspaces } from '../schema/configFiles/types';
import { ConfigFileWorkspace, ConfigFileWorkspaces } from '../schema/configFiles/types';

export const createWorkspace = async (c: RnvContext, workspaceID: string, workspacePath: string) => {
const cnf = c.files.rnv.configWorkspaces;
Expand Down Expand Up @@ -123,4 +123,10 @@ export const loadWorkspacesConfigSync = () => {
};
writeFileSync(c.paths.rnv.configWorkspaces, c.files.rnv.configWorkspaces);
}

const defWsPath = c.paths.GLOBAL_RNV_CONFIG;

if (defWsPath && fsExistsSync(defWsPath)) {
c.files.defaultWorkspace.config = readObjectSync<ConfigFileWorkspace>(defWsPath) || {};
}
};
2 changes: 2 additions & 0 deletions packages/core/src/context/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const generateRnvConfigFileObj = () => {
};

const runtime: RnvContext['runtime'] = {
plugins: {},
pluginVersions: {},
enginesByPlatform: {},
missingEnginePlugins: {},
enginesByIndex: [],
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/context/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { NpmPackageFile } from '../configs/types';
import { ConfigFileBuildConfig } from '../schema/configFiles/buildConfig';
import type { ParamKeys } from '../tasks/constants';
import { ExecaChildProcess } from 'execa';
import { RnvPlugin } from '../plugins/types';

export type CreateContextOptions = {
program: RnvContextProgram;
Expand Down Expand Up @@ -137,6 +138,8 @@ export type RnvContextRuntime = {
task?: string;
selectedWorkspace?: string;
target?: string;
plugins: Record<string, RnvPlugin>;
pluginVersions: Record<string, string>;
};

export type RuntimePropKey = keyof RnvContextRuntime;
Expand Down
15 changes: 8 additions & 7 deletions packages/core/src/engines/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ export const loadEnginePluginDeps = async (c: RnvContext, engineConfigs: Array<R
}
});
if (hasAddedPlugins) {
const engines = Object.keys(addedPlugins);
const allPlugins = Object.keys(originalProjectPlugins);
const engineKeys = engineConfigs.map((v) => v.key);
const addedPluginsKeys = Object.keys(addedPlugins);

// const allPlugins = Object.keys(originalProjectPlugins);
logInfo(
`Engines: ${chalk().yellow(engines.join(','))} require plugins ${chalk().white(
allPlugins.join(',')
`Engines: ${chalk().yellow(engineKeys.join(','))} require plugins ${chalk().white(
addedPluginsKeys.join(',')
)} to be added to ${chalk().white(c.paths.project.config)}`
);
const confirm = await inquirerPrompt({
Expand All @@ -202,7 +204,7 @@ export const loadEnginePluginDeps = async (c: RnvContext, engineConfigs: Array<R
If you don't want to use this dependency make sure you remove platform which requires this engine from supportedPlatforms`,
});
if (confirm) {
logInfo(`Adding ${allPlugins.join(',')}. ...DONE`);
logInfo(`Adding ${addedPluginsKeys.join(',')}. ...DONE`);
// Prepare original file to be decorated (as addon plugins as we can't edit template itself)
cnf.plugins = originalProjectPlugins;
writeRenativeConfigFile(c, c.paths.project.config, cnf);
Expand Down Expand Up @@ -448,7 +450,6 @@ const _resolvePkgPath = (c: RnvContext, packageName: string) => {
// In the instances of running linked rnv instead of installed one load local packages
try {
let pkgPathLocal = require.resolve(packageName, { paths: [path.join(c.paths.rnv.dir, '..')] });
//TODO: this needs to be changed to support ts libs
pkgPathLocal = pkgPathLocal
.replace('/dist/index.js', '')
.replace('\\dist\\index.js', '')
Expand Down Expand Up @@ -556,4 +557,4 @@ export const getEngineRunner = (c: RnvContext, task: string, customTasks?: RnvTa
return undefined;
};

export const getRegisteredEngines = (c: RnvContext) => c.runtime.enginesByIndex;
export const getRegisteredEngines = (c: RnvContext) => c.runtime.enginesByIndex;
30 changes: 20 additions & 10 deletions packages/core/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ export const parsePlugins = (
c: RnvContext,
platform: RnvPlatform,
pluginCallback: PluginCallback,
ignorePlatformObjectCheck?: boolean
ignorePlatformObjectCheck?: boolean,
includeDisabledPlugins?: boolean
) => {
logTask('parsePlugins');
if (c.buildConfig && platform) {
Expand All @@ -391,34 +392,43 @@ export const parsePlugins = (

if (plugin) {
const pluginPlat = plugin[platform] || {};

const handleActivePlugin = () => {
if (pluginCallback) {
c.runtime.plugins[key] = plugin;
if (plugin.version) {
c.runtime.pluginVersions[key] = plugin.version;
}
pluginCallback(plugin, pluginPlat, key);
}
};

// NOTE: we do not want to disable plugin just because object is missing. instead we will let people to do it explicitly
// {
// skipLinking: true,
// disabled: true,
// enabled: false,
// };
//TODO: consider supportedPlatforms for plugins
if (ignorePlatformObjectCheck) {
// totalIncludedPlugins++;
pluginCallback(plugin, pluginPlat, key);
handleActivePlugin();
} else if (pluginPlat) {
const isPluginDisabled = plugin.disabled === true;
//DEPreCATED
const isPluginPlatDisabled =
pluginPlat.disabled === true || pluginPlat.enabled === false;
const isPluginPlatDisabled = pluginPlat.disabled === true;
if (!isPluginDisabled && !isPluginPlatDisabled) {
if (plugin.deprecated) {
logWarning(plugin.deprecated);
}
if (pluginCallback) {
// totalIncludedPlugins++;
pluginCallback(plugin, pluginPlat, key);
}
handleActivePlugin();
} else {
if (isPluginDisabled) {
logInfo(`Plugin ${key} is marked disabled. skipping.`);
} else if (isPluginPlatDisabled) {
logInfo(`Plugin ${key} is marked disabled for platform ${platform} skipping.`);
}
if (includeDisabledPlugins) {
handleActivePlugin();
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/schema/configFiles/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ const EnableHookRebuild = z
'If set to true in `./renative.json` build hooks will be compiled at each rnv command run. If set to `false` (default) rebuild will be triggered only if `dist` folder is missing, `-r` has been passed or you run `rnv hooks run` directly making your rnv commands faster'
);

const EnableAnalytics = z.boolean().describe('Enable or disable sending analytics to improve ReNative');

const ProjectName = z
.string()
.describe(
Expand Down Expand Up @@ -226,7 +224,6 @@ const RootProjectBaseFragment = {
custom: z.optional(Ext),
enableHookRebuild: z.optional(EnableHookRebuild),
monoRoot: z.optional(MonoRoot),
enableAnalytics: z.optional(EnableAnalytics),
extendsTemplate: z.optional(ExtendTemplate),
tasks: z.optional(Tasks),
integrations: z.optional(Integrations),
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/schema/configFiles/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ const SDKsSchema = z
export const RootWorkspaceSchema = z.object({
defaultTargets: z.optional(DefaultTargets),
sdks: z.optional(SDKsSchema),
projectTemplates: z.record(z.string(), z.object({})),
projectTemplates: z.record(z.string(), z.object({})).optional(),
disableTelemetry: z
.boolean()
.optional()
.describe('Opt-out from renative telemetry program. More info at https://renative.org/telemetry'),
appConfigsPath: z
.string()
.optional()
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/schema/plugins/fragments/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const PluginBaseFragment = {
webpackConfig: z.optional(Webpack), //Should this be at root plugin???
disablePluginTemplateOverrides: z.optional(DisablePluginTemplateOverrides),
fontSources: z.array(z.string()).optional(),
// enabled: z.optional(Enabled), //DEPRECATED => disabled
// 'no-npm': z.optional(NoNpm),//DEPRECATED => disableNpm
// plugins: z.optional(PluginDependencies), //DEPRECATED => pluginDependencies
// webpack: z.optional(Webpack), //Should this be at root plugin??? // DEPRECATED
Expand Down
Loading
Loading