Skip to content

Commit 5839ff4

Browse files
committed
Updated widget path
1 parent 04d18bc commit 5839ff4

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "codeeditor",
33
"widgetName": "CodeEditor",
44
"version": "1.0.0",
5-
"description": "Embeddable code editor widget, powered by Ace editor.",
5+
"description": "Ace code editor, as a Mendix pluggable widget.",
66
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
77
"author": "Carter Moorse",
88
"engines": {
@@ -14,7 +14,7 @@
1414
"mendixHost": "http://localhost:8080",
1515
"developmentPort": 3000
1616
},
17-
"packagePath": "mendix",
17+
"packagePath": "carterm",
1818
"scripts": {
1919
"start": "pluggable-widgets-tools start:server",
2020
"dev": "pluggable-widgets-tools start:web",

rollup.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ import path from "node:path";
99
import { fileURLToPath } from "node:url";
1010

1111

12+
// Get list of modules from 'ace-builds'
1213
const files = Object.fromEntries(
13-
globSync("node_modules/ace-builds/src-noconflict/**/*.js").map(file => [
14-
// This remove `src/` as well as the file extension from each
15-
// file, so e.g. src/nested/foo.js becomes nested/foo
14+
globSync("node_modules/ace-builds/src-min-noconflict/**/*.js").map(file => [
15+
// Remove the 'node_modules/ace-builds' path from the filepath. e.g.
16+
// 'node_module/ace-builds/src-noconflict/ace.js' becomes 'src-noconflict/ace.js'
1617
path.relative(
1718
"node_modules/ace-builds",
1819
file.slice(0, file.length - path.extname(file).length)
1920
),
20-
// This expands the relative paths to absolute paths, so e.g.
21-
// src/nested/foo becomes /project/src/nested/foo.js
21+
// Expands the relative paths to absolute paths, so e.g.
22+
// 'src-noconflict/ace.js' becomes 'C:/.../node_module/ace-builds/src-noconflict/ace.js'
2223
fileURLToPath(new URL(file, import.meta.url))
2324
])
2425
);
@@ -29,6 +30,7 @@ const outWidgetDir = join(widgetPackage.replace(/\./g, "/"), widgetName.toLowerC
2930
export default args => {
3031
const config = args.configDefaultConfig;
3132

33+
// Use to debug the output files
3234
// console.log(files);
3335

3436
config.unshift({

src/CodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CodeEditorContainerProps } from "../typings/CodeEditorProps";
88
export default class CodeEditor extends Component<CodeEditorContainerProps> {
99
editorRef: RefObject<AceEditor> = createRef();
1010

11-
static basePath = "widgets/mendix/codeeditor/src-noconflict";
11+
static basePath = "widgets/carterm/codeeditor/src-min-noconflict";
1212

1313
loadAce(filename: string): Promise<HTMLScriptElement | null> {
1414
return new Promise((resolve) => {

src/CodeEditor.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<widget id="mendix.codeeditor.CodeEditor" pluginWidget="true" needsEntityContext="true"
2+
<widget id="carterm.codeeditor.CodeEditor" pluginWidget="true" needsEntityContext="true"
33
offlineCapable="true"
44
supportedPlatform="Web"
55
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../node_modules/mendix/custom_widget.xsd">
77
<name>Code Editor</name>
8-
<description>Embeddable code editor widget, powered by Ace editor.</description>
8+
<description>Ace code editor, as a Mendix pluggable widget.</description>
99
<icon />
1010
<properties>
1111
<propertyGroup caption="General">

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<widgetFile path="CodeEditor.xml"/>
66
</widgetFiles>
77
<files>
8-
<file path="mendix/codeeditor"/>
8+
<file path="carterm/codeeditor"/>
99
</files>
1010
</clientModule>
1111
</package>

0 commit comments

Comments
 (0)