Skip to content

Commit 7a85ec2

Browse files
author
undefined
committed
feat: update create-modules script to use ts-node and enhance module creation with OSS files
1 parent c0419df commit 7a85ec2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"release": "pnpm -r run release",
2626
"release:marketplace": "pnpm -r run release:marketplace",
2727
"release-github:widget": "node ./scripts/release/createWidgetRelease.js",
28-
"create-modules": "node ./scripts/release/createNativeModules.js",
28+
"create-modules": "ts-node --project ./scripts/tsconfig.json ./scripts/release/createNativeModules.js",
2929
"build-mpk": "ts-node --project ./scripts/tsconfig.json ./scripts/release/build-mpk.ts",
3030
"version": "ts-node --project ./scripts/tsconfig.json ./scripts/release/BumpVersion.ts",
3131
"validate-staged-widget-versions": "node scripts/validation/validate-versions-staged-files.js",

scripts/release/createNativeModules.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const {
1515
exportModuleWithWidgets,
1616
regex
1717
} = require("./module-automation/commons");
18-
18+
const { getOssFiles, copyFilesToMpk } = require("./module-automation/utils");
1919
const repoRootPath = join(__dirname, "../../");
2020
const [moduleFolderNameInRepo, version] = process.env.TAG.split("-v");
2121

@@ -46,6 +46,7 @@ async function main() {
4646
async function createNativeMobileResourcesModule() {
4747
console.log("Creating the Native Mobile Resource module.");
4848
const moduleFolder = join(repoRootPath, "packages/jsActions", moduleFolderNameInRepo);
49+
const ossFiles = await getOssFiles(moduleFolder, true);
4950
const tmpFolder = join(repoRootPath, "tmp", moduleFolderNameInRepo);
5051
const widgetFolders = await readdir(join(repoRootPath, "packages/pluggableWidgets"));
5152
const nativeWidgetFolders = widgetFolders
@@ -63,7 +64,7 @@ async function createNativeMobileResourcesModule() {
6364
await commitAndCreatePullRequest(moduleInfo);
6465
await updateNativeComponentsTestProject(moduleInfo, tmpFolder, nativeWidgetFolders);
6566
const mpkOutput = await createMPK(tmpFolder, moduleInfo, regex.excludeFiles);
66-
await exportModuleWithWidgets(moduleInfo.moduleNameInModeler, mpkOutput, nativeWidgetFolders);
67+
await exportModuleWithWidgets(moduleInfo.moduleNameInModeler, mpkOutput, nativeWidgetFolders, ossFiles);
6768
await createGithubRelease(moduleInfo, moduleChangelogs, mpkOutput);
6869
if (process.env.CI !== "true") {
6970
try {
@@ -78,6 +79,7 @@ async function createNativeMobileResourcesModule() {
7879
async function createNanoflowCommonsModule() {
7980
console.log("Creating the Nanoflow Commons module.");
8081
const moduleFolder = join(repoRootPath, "packages/jsActions", moduleFolderNameInRepo);
82+
const ossFiles = await getOssFiles(moduleFolder, true);
8183
const tmpFolder = join(repoRootPath, "tmp", moduleFolderNameInRepo);
8284
let moduleInfo = {
8385
...(await getPackageInfo(moduleFolder)),
@@ -91,6 +93,7 @@ async function createNanoflowCommonsModule() {
9193
await commitAndCreatePullRequest(moduleInfo);
9294
await updateNativeComponentsTestProject(moduleInfo, tmpFolder);
9395
const mpkOutput = await createMPK(tmpFolder, moduleInfo, regex.excludeFiles);
96+
await copyFilesToMpk(ossFiles, mpkOutput, moduleInfo.moduleNameInModeler);
9497
await createGithubRelease(moduleInfo, moduleChangelogs, mpkOutput);
9598
if (process.env.CI !== "true") {
9699
try {

0 commit comments

Comments
 (0)