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

RNV modules #1514

Merged
merged 32 commits into from
May 2, 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
ddbaafd
migrate engines, ints into same name schema, remove hardcoded engine map
pavjacko Apr 9, 2024
0a2a62b
migrate to universal module appraoch
pavjacko Apr 9, 2024
50d0e14
update module creators
pavjacko Apr 9, 2024
1f40096
fix modules prop
pavjacko Apr 10, 2024
8df0e2d
move notes out to docs
pavjacko Apr 12, 2024
1aff02b
feat: infer payload type from extendModules
locksten Apr 15, 2024
71a48cf
Merge branch 'release/1.0' into feat/rnv_modules_infer_extend
pavjacko Apr 16, 2024
3836b1e
update engines to use modules
pavjacko Apr 16, 2024
c2f7cab
update gen types
pavjacko Apr 16, 2024
2dc353e
gen task option creators
pavjacko Apr 17, 2024
2fe6cbf
update types
pavjacko Apr 17, 2024
d6f0e5a
type updates
pavjacko Apr 17, 2024
b486751
add sanity ts tests
pavjacko Apr 17, 2024
ebd6e4c
type fixes
pavjacko Apr 17, 2024
83f50d5
type fixes
pavjacko Apr 18, 2024
b7bee9c
add payload context
pavjacko Apr 18, 2024
c7d8202
update payload types
pavjacko Apr 18, 2024
36dee22
migrate options
pavjacko Apr 18, 2024
16be850
rename files
pavjacko Apr 18, 2024
f0e33da
opts updates
pavjacko Apr 18, 2024
72a0743
initContextPayload
pavjacko Apr 18, 2024
bb64160
infer both payload and opts from modules
locksten Apr 19, 2024
4ff927f
fix inferred types with engine tasks fn
locksten Apr 19, 2024
b2df478
fix createRnvModule type inference
locksten Apr 19, 2024
5c454b5
fix inference sanity tests
locksten Apr 19, 2024
b9628fe
add extra TS tests
pavjacko Apr 19, 2024
eef1d96
fix inference when no modules are extended
locksten Apr 19, 2024
3520f51
add self-reference module option type test
locksten Apr 19, 2024
e50a490
fix rnv core task option mocks
locksten Apr 26, 2024
a4098b4
fix registering engine tasks multiple times
locksten Apr 26, 2024
9baa7ba
Merge pull request #1524 from flexn-io/feat/rnv_modules_infer_2
pavjacko Apr 29, 2024
fa9532c
readd device cli option to withRun preset
locksten Apr 30, 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
3 changes: 3 additions & 0 deletions __mocks__/@rnv/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const _generateContextDefaults = (ctx?: Context): RnvContext => {

// Manual mocks the core functions
rnvcore.createTask = (task) => task;
rnvcore.createTaskOptionsMap = originalCore.createTaskOptionsMap;
rnvcore.createTaskOptionsPreset = originalCore.createTaskOptionsPreset;
rnvcore.RnvTaskOptionPresets = originalCore.RnvTaskOptionPresets;
rnvcore.chalk = () => _chalkCols;
rnvcore.createRnvContext = (ctx?: Context) => {
rnvcore.__MOCK_RNV_CONTEXT = _generateContextDefaults(ctx);
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
doResolve,
exitRnvCore,
registerRnvTasks,
generateRnvTaskMap,
} from '@rnv/core';
import TelemetrySDK from '@rnv/sdk-telemetry';
import { Telemetry } from '@rnv/sdk-telemetry';
Expand All @@ -37,7 +36,7 @@
p.kill();
});
} catch (e) {
console.log(e);

Check warning on line 39 in packages/cli/src/index.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected console statement
}
runningProcesses.length = 0;
};
Expand Down Expand Up @@ -140,7 +139,7 @@

Telemetry.initialize();
// Example of how to register set of tasks manually
registerRnvTasks(generateRnvTaskMap(TelemetrySDK.tasks, { packageName: '@rnv/sdk-telemetry' }));
registerRnvTasks(TelemetrySDK.tasks);
await registerEngine(EngineCore);

await executeRnvCore();
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export const logSummary = (opts?: { header?: string; headerStyle?: 'success' | '
// if (ctx.platform) {
// addon = ` ($.platforms.${ctx.platform}.engine)`;
// }
str += printIntoBox(`Engine: ${currentChalk.gray(ctx.runtime?.engine?.config?.id || '')}`);
str += printIntoBox(`Engine: ${currentChalk.gray(ctx.runtime?.engine?.id || '')}`);
}
if (ctx.runtime?.currentTemplate) {
str += printIntoBox(`Template: ${currentChalk.gray(ctx.runtime?.currentTemplate)}`);
Expand Down Expand Up @@ -587,7 +587,7 @@ export const logError = (e: Error | string | unknown, opts?: { skipAnalytics: bo
const extra = {
command: getCurrentCommand(),
version: ctx.rnvVersion,
engine: ctx.runtime?.engine?.config?.id,
engine: ctx.runtime?.engine?.id,
platform: ctx.platform,
bundleAssets: !!ctx.runtime?.bundleAssets,
os: ctx.process?.platform,
Expand Down
10 changes: 0 additions & 10 deletions packages/config-templates/renative.templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
"description": "Advanced multiplatform template using flexn Create SDK"
}
},
"engineIdMap": {
"engine-lightning": "@rnv/engine-lightning",
"engine-rn": "@rnv/engine-rn",
"engine-rn-electron": "@rnv/engine-rn-electron",
"engine-rn-macos": "@rnv/engine-rn-macos",
"engine-rn-next": "@rnv/engine-rn-next",
"engine-rn-tvos": "@rnv/engine-rn-tvos",
"engine-rn-web": "@rnv/engine-rn-web",
"engine-rn-windows": "@rnv/engine-rn-windows"
},
"engineTemplates": {
"@rnv/engine-rn": {
"version": "1.0.0-rc.17",
Expand Down
20 changes: 6 additions & 14 deletions packages/core/jsonSchema/renative-1.0.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5078,8 +5078,9 @@
"integration": {
"type": "object",
"properties": {
"packageName": {
"type": "string"
"name": {
"type": "string",
"description": "Name of the integration (best to use name of the actual package)"
}
},
"additionalProperties": false
Expand All @@ -5090,16 +5091,13 @@
"custom": {
"$ref": "#/definitions/zodExt"
},
"id": {
"name": {
"type": "string",
"description": "ID of engine"
},
"packageName": {
"type": "string"
"description": "Name of the engine (best to use name of the actual package)"
},
"engineExtension": {
"type": "string",
"description": "Engine extension ised by rnv during compilation"
"description": "Engine extension used by rnv during compilation"
},
"overview": {
"type": "string",
Expand Down Expand Up @@ -5528,12 +5526,6 @@
"projectTemplates": {
"$ref": "#/definitions/zodProjectTemplates"
},
"engineIdMap": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"engineTemplates": {
"type": "object",
"additionalProperties": {
Expand Down
9 changes: 3 additions & 6 deletions packages/core/jsonSchema/rnv.engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
"custom": {
"description": "Object used to extend your renative with custom props. This allows renative json schema to be validated"
},
"id": {
"name": {
"type": "string",
"description": "ID of engine"
},
"packageName": {
"type": "string"
"description": "Name of the engine (best to use name of the actual package)"
},
"engineExtension": {
"type": "string",
"description": "Engine extension ised by rnv during compilation"
"description": "Engine extension used by rnv during compilation"
},
"overview": {
"type": "string",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/jsonSchema/rnv.integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"rnv.integration": {
"type": "object",
"properties": {
"packageName": {
"type": "string"
"name": {
"type": "string",
"description": "Name of the integration (best to use name of the actual package)"
},
"$schema": {
"type": "string",
Expand Down
Loading
Loading