Skip to content

Commit

Permalink
Merge branch 'allow-variable-type-change' into nix-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
m0lentum committed Jul 5, 2022
2 parents 4685c49 + 56cd4ee commit a868d90
Show file tree
Hide file tree
Showing 1,155 changed files with 9,045 additions and 61,258 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v16
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v16
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
Expand Down
4 changes: 2 additions & 2 deletions carrot_rcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ const save = async (

if (patch.modifications) {
for (const name of Object.keys(current)) {
if (await isEqual(old[name], current[name])) {
if (isEqual(old[name], current[name])) {
continue;
}
switch (await inferType(old[name], current[name])) {
switch (inferType(current[name])) {
case "Boolean":
patch.modifications[name] = {
value: !!current[name],
Expand Down
24 changes: 9 additions & 15 deletions carrot_rcc_lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ export const TZ: string = ((): string => {
return offsetToString(offset);
})();

export const isEqual = async (
old: TypedValue | undefined,
current: any
): Promise<boolean> => {
export const isEqual = (old: TypedValue | undefined, current: any): boolean => {
if (old === undefined) {
return false;
}
switch (await inferType(old, current)) {
const oldType = inferType(old);
const currType = inferType(current);
if (oldType !== currType) {
return false;
}
switch (currType) {
case "File":
return false;
case "Date":
Expand All @@ -60,16 +62,8 @@ export const isEqual = async (
}
};

export const inferType = async (
old: TypedValue | undefined,
current: any
): Promise<string> => {
if (old?.type === "object") {
// We can only save deserialized objects back as JSON
return "Json";
} else if (old?.type) {
return old.type[0].toUpperCase() + old.type.substr(1);
} else if (isBoolean(current)) {
export const inferType = (current: any): string => {
if (isBoolean(current)) {
return "Boolean";
} else if (isDate(current)) {
return "Date";
Expand Down
10 changes: 9 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ in

pkgs.stdenv.mkDerivation rec {
name = "carrot-rcc";
src = gitignoreSource ./.;
# For now, we whitelist source files to prevent vagrant updates causing rebuild
src = builtins.filterSource (path: type:
(baseNameOf path) == "carrot_rcc.ts" ||
(baseNameOf path) == "carrot_rcc_lib.ts" ||
(baseNameOf path) == "Camunda.ts" ||
(baseNameOf path) == "rollup.config.js" ||
(baseNameOf path) == "node-dev-packages.nix" ||
(baseNameOf path) == "package.json" ||
(baseNameOf path) == "package-lock.json" ) ./.;
buildPhase = ''
source $stdenv/setup;
cp -a ${dev_node_modules} node_modules
Expand Down
3 changes: 3 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ let

inherit (unstable)
novnc
# vscode
vscodium;

vscode = pkgs.callPackage ./pkgs/vscode/vscode.nix {};
};

pkgs = import nixpkgs {
Expand Down
29 changes: 15 additions & 14 deletions nix/pkgs/camunda-modeler/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ let
sources = import ../../../nix/sources.nix;

mkElectron = import "${sources."nixpkgs"}/pkgs/development/tools/electron/generic.nix" { inherit stdenv libXScrnSaver makeWrapper fetchurl wrapGAppsHook glib gtk3 unzip atomEnv libuuid at-spi2-atk at-spi2-core libdrm mesa libxkbcommon libxshmfence lib libappindicator-gtk3; };
electron = mkElectron "12.1.2" {
x86_64-linux = "0gc739hk959rh5zscb6iq643bb2ar3cksmrmz3s16qlm7qi1xvg0";
# electron = mkElectron "17.1.2" {
# x86_64-linux = "156aa1360qfx3jpa4liccz2f46l8chrag7zig8g4bz50q7l3az3y";
electron = mkElectron "17.1.0" {
x86_64-linux = "1s18zrmqiiks9nq27nw2s65wcl0rqhxc6b343wg6qdk9b65c4vhh";
};

camunda-modeler-plugins = fetchurl {
Expand Down Expand Up @@ -38,7 +36,7 @@ let

bpmn-js-token-simulation-plugin = fetchurl {
url = "https://github.com/bpmn-io/bpmn-js-token-simulation-plugin/archive/ba7b6c0f4edf0872229da58a20ef96590d9a99a8.tar.gz";
sha256 = "1wp2b2ngard7b47kx9qxl1b26z0ljhvxp07q28kmgks7cxfalz7v";
sha256 = "0gns9pvy393jasvdwhyjgm79wpnmkbycp0hpm1pylif5qgb0df8a";
};

dmn-testing-plugin = fetchurl {
Expand All @@ -53,33 +51,35 @@ let

asar = stdenv.mkDerivation rec {
name = "camunda-modeler-${version}-asar";
version = "5.0.0-alpha.1";
version = "5.0.0";
src = fetchurl {
url = "https://github.com/camunda/camunda-modeler/releases/download/v${version}/camunda-modeler-${version}-linux-x64.tar.gz";
sha256 = "095kklcjcz4llvqxcqylqpk0p42dmqxq1a98vqlgqd993kyvf3y7";
sha256 = "11gkcb209dgnmavn113b91dywh4b1n4i0a7xnhkc4angn8y22amp";
};
nativeBuildInputs = [ nodePackages.asar autoPatchelfHook gcc-unwrapped ];
installPhase = ''
asar extract ./resources/app.asar $out
substituteInPlace $out/lib/index.js \
--replace "let resourcesPaths = [" \
"let resourcesPaths = [\"$out/var/lib/camunda/resources\","
# mv $out/node_modules/grpc/src/node/extension_binary/electron-v12.1-linux-x64-glibc \
# $out/node_modules/grpc/src/node/extension_binary/electron-v17.1-linux-x64-glibc
'';
};

in

stdenv.mkDerivation rec {
name = "camunda-modeler-${version}";
version = "5.0.0-alpha.1";
version = "5.0.0";
src = asar;
unpackPhase = "";
nativeBuildInputs = [ electron makeWrapper nodePackages.asar autoPatchelfHook gcc-unwrapped ];
installPhase = ''
mkdir -p $out/var/lib/camunda/resources/plugins $out/bin
asar pack $src $out/var/lib/camunda/app.asar
cp -a $src build
chmod u+w -R build
substituteInPlace build/lib/index.js \
--replace "let resourcesPaths = [" \
"let resourcesPaths = [\"$out/var/lib/camunda/resources\","
asar pack build $out/var/lib/camunda/app.asar
cd $out/var/lib/camunda/resources/plugins
tar xzvf ${dmn-testing-plugin}
Expand All @@ -98,6 +98,7 @@ stdenv.mkDerivation rec {
tar xzvf ${excel-import-plugin}
mv camunda-modeler-plugins*/camunda-transaction-boundaries-plugin .
rm -r camunda-modeler-plugins*
makeWrapper ${electron}/bin/electron $out/bin/camunda-modeler \
--add-flags "$out/var/lib/camunda/app.asar" \
--prefix PATH : "${adoptopenjdk-jre-hotspot-bin-11}/bin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@
"content": [
{
"content": null,
"created": "2021-09-15T19:00:44.751919Z",
"created": "2022-04-03T15:33:53.219321Z",
"format": null,
"last_modified": "2021-08-12T22:25:05.961344Z",
"last_modified": "2022-04-03T15:21:40.485365Z",
"mimetype": null,
"name": "Plotly.ipynb",
"path": "Plotly.ipynb",
"size": 8034,
"name": "RobotFramework.ipynb",
"path": "RobotFramework.ipynb",
"size": 2838,
"type": "notebook",
"writable": true
},
{
"content": null,
"created": "2021-09-15T19:00:44.752918Z",
"created": "2022-04-03T15:33:53.219321Z",
"format": null,
"last_modified": "2021-08-12T22:29:49.965502Z",
"last_modified": "2022-04-03T15:21:40.485365Z",
"mimetype": null,
"name": "RobotFramework.ipynb",
"path": "RobotFramework.ipynb",
"size": 2838,
"name": "Plotly.ipynb",
"path": "Plotly.ipynb",
"size": 8033,
"type": "notebook",
"writable": true
}
],
"created": "2021-09-15T19:00:44.752918Z",
"created": "2022-04-03T15:33:53.219321Z",
"format": "json",
"last_modified": "2021-09-15T19:00:44.752918Z",
"last_modified": "2022-04-03T15:33:53.219321Z",
"mimetype": null,
"name": "",
"path": "",
"size": null,
"type": "directory",
"writable": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"data": {
"en": {
"displayName": "English",
"nativeName": "English"
}
},
"message": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"data": {},
"message": ""
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a868d90

Please sign in to comment.