Skip to content

Commit 7169cf8

Browse files
author
Illia Obukhau
committed
build(calendar-web): add calendar-web to workspace
1 parent 451b26e commit 7169cf8

File tree

7 files changed

+83
-40391
lines changed

7 files changed

+83
-40391
lines changed

packages/customWidgets/calendar-web/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9-
## [1.0.14] - 2022-11-16
10-
119
### Changed
1210

1311
- Update moment.js to version 2.29.4

packages/customWidgets/calendar-web/package-lock.json

Lines changed: 0 additions & 40342 deletions
This file was deleted.

packages/customWidgets/calendar-web/package.json

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,71 @@
44
"version": "1.0.14",
55
"description": "Display and manage calendar events",
66
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
7+
"license": "Apache-2.0",
78
"repository": {
89
"type": "git",
910
"url": "https://github.com/mendix/web-widgets.git"
1011
},
11-
"testProject": {
12-
"githubUrl": "https://github.com/mendix/testProjects",
13-
"branchName": "calendar-web"
12+
"mxpackage": {
13+
"name": "Calendar",
14+
"type": "widget",
15+
"mpkName": "Calendar.mpk"
1416
},
15-
"license": "Apache-2.0",
1617
"marketplace": {
1718
"minimumMXVersion": "7.14.1",
18-
"appNumber": 107954
19+
"appNumber": 107954,
20+
"appName": "Calendar"
21+
},
22+
"testProject": {
23+
"githubUrl": "https://github.com/mendix/testProjects",
24+
"branchName": "calendar-web"
1925
},
26+
"packagePath": "com.mendix.widget.custom",
2027
"scripts": {
21-
"format": "echo \"Error: no format specified\" && exit 1",
22-
"lint": "echo \"Error: no lint specified\" && exit 1",
23-
"lint:fix": "echo \"Error: no lint:fix specified\" && exit 1",
24-
"build": "webpack-cli -c webpack.config.dev.js && npm run create-mpk",
25-
"release": "webpack-cli -c webpack.config.prod.js && npm run create-mpk",
26-
"create-mpk": "node ./scripts/create-mpk.js"
28+
"build": "ts-node --project scripts/tsconfig.json scripts/build.ts development",
29+
"create-gh-release": "rui-create-gh-release",
30+
"format": "pluggable-widgets-tools format",
31+
"lint": "eslint --config ../../../.eslintrc.js --ext .jsx,.js,.ts,.tsx src/",
32+
"publish-marketplace": "rui-publish-marketplace",
33+
"release": "ts-node --project scripts/tsconfig.json scripts/build.ts production",
34+
"update-changelog": "rui-update-changelog-widget",
35+
"verify": "rui-verify-package-format"
2736
},
2837
"config": {
2938
"mendixHost": "http://localhost:8080",
3039
"developmentPort": 3000
3140
},
3241
"devDependencies": {
33-
"@mendix/pluggable-widgets-tools": ">=9.0.0",
42+
"@babel/core": "^7.0.0",
43+
"@mendix/pluggable-widgets-tools": "^9.18.0",
44+
"@mendix/release-utils-internal": "workspace:*",
3445
"@types/classnames": "^2.2.6",
3546
"@types/date-arithmetic": "^3.1.2",
47+
"@types/react": "^17.0.52",
3648
"@types/react-big-calendar": "0.20.20",
37-
"@types/react-dnd": "^3.0.2",
38-
"@types/react-dnd-html5-backend": "^3.0.2",
39-
"eslint": "^7.20.0",
40-
"jest": "^26.6.1",
41-
"webpack": "^5.3.2",
42-
"webpack-cli": "^4.1.0",
49+
"@types/react-dom": "^17.0.18",
4350
"babel-loader": "^8.2.1",
44-
"fork-ts-checker-webpack-plugin": "^5.2.1",
4551
"copy-webpack-plugin": "^6.2.1",
46-
"ts-loader": "^8.0.7",
47-
"style-loader": "^2.0.0",
4852
"css-loader": "^5.0.0",
53+
"eslint": "^7.20.0",
54+
"fork-ts-checker-webpack-plugin": "^5.2.1",
55+
"jest": "^26.6.1",
56+
"mendix-client": "^7.15.8",
57+
"react": "~17.0.2",
58+
"react-dom": "~17.0.2",
4959
"sass": "^1.43.4",
5060
"sass-loader": "^12.4.0",
61+
"style-loader": "^2.0.0",
62+
"to-string-loader": "^1.1.6",
63+
"ts-loader": "^8.0.7",
5164
"typescript": "4.5.4",
52-
"mendix-client": "^7.15.8",
53-
"to-string-loader": "^1.1.6"
65+
"webpack": "^5.3.2",
66+
"webpack-cli": "^4.1.0"
5467
},
5568
"dependencies": {
5669
"classnames": "^2.2.6",
5770
"date-arithmetic": "^3.1.0",
58-
"moment": "^2.24.0",
71+
"moment": "^2.29.4",
5972
"react-big-calendar": "0.19.2",
6073
"react-dnd": "2.6.0",
6174
"react-dnd-html5-backend": "^5.0.1"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { cp, mkdir, zip, exec } from "@mendix/release-utils-internal/shell";
2+
import { logStep, removeDist, runWidgetSteps, WidgetStepParams } from "@mendix/release-utils-internal/steps";
3+
import { dirname, join } from "node:path";
4+
5+
const [, , env] = process.argv;
6+
const isProd = env === "production";
7+
const copyToProject = !isProd && process.env.MX_PROJECT_PATH;
8+
9+
async function createMPK({ config }: WidgetStepParams): Promise<void> {
10+
logStep("Create mpk");
11+
const { paths, output } = config;
12+
mkdir("-p", dirname(output.files.mpk));
13+
await zip(join(paths.tmp, "widgets"), output.files.mpk);
14+
}
15+
16+
async function main(): Promise<void> {
17+
await runWidgetSteps({
18+
packagePath: process.cwd(),
19+
steps: [
20+
removeDist,
21+
async () => {
22+
logStep("Bundling");
23+
const wpc = isProd ? "webpack.config.prod.js" : "webpack.config.dev.js";
24+
await exec(`webpack -c ${wpc}`);
25+
},
26+
createMPK,
27+
async ({ config }) => {
28+
if (copyToProject) {
29+
logStep("Copy widget to targetProject");
30+
const dir = join(config.paths.targetProject, "widgets");
31+
mkdir("-p", dir);
32+
cp(config.output.files.mpk, dir);
33+
}
34+
}
35+
]
36+
});
37+
}
38+
39+
main().catch(err => {
40+
console.error(err);
41+
process.exit(1);
42+
});

packages/customWidgets/calendar-web/scripts/create-mpk.js

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@mendix/release-utils-internal/tsconfig"
3+
}

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
packages:
22
- "packages/*/*"
33
- "automation/*"
4-
- "!packages/customWidgets/*"
4+
- "!packages/customWidgets/signature-web"
55
- "!packages/tools/custom-widgets-utils-internal"

0 commit comments

Comments
 (0)