Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Feb 29, 2024
1 parent f01c8a0 commit 4626a75
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.cargo
target
.direnv
result/
result*
10 changes: 7 additions & 3 deletions .templates/app/web-app/flake.nix.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{{#merge previous_file_content}}
{{#match_scope "inputs {"}}
scaffolding.url = "holochain-open-dev/templates";
{{/match_scope}}
{{#match_scope "devShells.default = pkgs.mkShell {"}}
inputsFrom = [ holochain-flake.devShells.${system}.holonix ];
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ];

packages = with pkgs; [
nodejs-18_x
nodejs_20
cargo-nextest
binaryen
] ++ [
inputs'.scaffolding.packages.hc-scaffold-app-template
];
{{/match_scope}}
{{/merge}}
4 changes: 2 additions & 2 deletions .templates/app/web-app/tests/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
},
"dependencies": {
"@msgpack/msgpack": "^2.7.0",
"@holochain/client": "^0.16.2",
"@holochain/client": "^0.17.0-dev.7",
"@holochain/tryorama": "{{tryorama_version}}",
"@holochain-open-dev/stores": "^0.7.2",
"@holochain-open-dev/stores": "^0.8.11",
"@holochain-open-dev/utils": "^0.16.0",
"typescript": "^4.9.4",
"vitest": "^0.28.4"
Expand Down
2 changes: 1 addition & 1 deletion .templates/app/web-app/ui/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"localize:build": "lit-localize build"
},
"dependencies": {
"@holochain/client": "^0.16.7",
"@holochain/client": "^0.17.0-dev.7",
"@holochain-open-dev/elements": "^0.8.4",
"@holochain-open-dev/profiles": "^0.17.3",
"@holochain-open-dev/stores": "^0.8.11",
Expand Down
2 changes: 1 addition & 1 deletion .templates/app/web-app/ui/src/holochain-app.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class HolochainApp extends LitElement {
_myProfile!: StoreSubscriber<AsyncStatus<EntryRecord<Profile> | undefined>>;

async firstUpdated() {
this._client = await AppAgentWebsocket.connect(new URL('ws://localhost'), '{{app_name}}');
this._client = await AppAgentWebsocket.connect('{{app_name}}');

await this.initStores(this._client);

Expand Down
11 changes: 7 additions & 4 deletions .templates/module/web-app/flake.nix.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{#merge previous_file_content}}
{{#match_scope "inputs {"}}
scaffolding.url = "holochain-open-dev/templates";
{{/match_scope}}
{{#match_scope "devShells.default = pkgs.mkShell {"}}
inputsFrom = [ holochain-flake.devShells.${system}.holonix ];
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ];

packages = with pkgs; [
nodejs-18_x
nodejs_20
cargo-nextest
binaryen
] ++ [
inputs'.scaffolding.packages.hc-scaffold-module-template
];
{{/match_scope}}
{{/merge}}

4 changes: 2 additions & 2 deletions .templates/module/web-app/tests/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
},
"dependencies": {
"@msgpack/msgpack": "^2.7.0",
"@holochain/client": "^0.16.2",
"@holochain/client": "^0.17.0-dev.7",
"@holochain/tryorama": "{{tryorama_version}}",
"@holochain-open-dev/stores": "^0.7.2",
"@holochain-open-dev/stores": "^0.8.11",
"@holochain-open-dev/utils": "^0.16.0",
"typescript": "^4.9.4",
"vitest": "^0.28.4"
Expand Down
2 changes: 1 addition & 1 deletion .templates/module/web-app/ui/demo/index.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class DemoApp extends LitElement {
}
async firstUpdated() {
this._client = await AppAgentWebsocket.connect(new URL('ws://localhost'), '{{app_name}}');
this._client = await AppAgentWebsocket.connect('{{app_name}}');
await this.initStores(this._client);
Expand Down
2 changes: 1 addition & 1 deletion .templates/module/web-app/ui/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"./locales/*": "./locales/*"
},
"dependencies": {
"@holochain/client": "^0.16.2",
"@holochain/client": "^0.17.0-dev.7",
"@holochain-open-dev/elements": "^0.8.2",
"@holochain-open-dev/profiles": "^0.16.1",
"@holochain-open-dev/stores": "^0.8.2",
Expand Down
56 changes: 28 additions & 28 deletions flake.lock

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

46 changes: 8 additions & 38 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,45 +37,15 @@
];
};

packages.hc-scaffold-template-app = pkgs.runCommand "hc-scaffold" {
buildInputs = [ pkgs.makeWrapper ];
src = ./.;
} ''
mkdir $out
# Link every top-level folder from pkgs.hello to our new target
ln -s ${inputs'.scaffolding.packages.default}/* $out
# Except the bin folder
rm $out/bin
mkdir $out/bin
# We create the bin folder ourselves and link every binary in it
ln -s ${inputs'.scaffolding.packages.default}/bin/* $out/bin
# Except the hello binary
rm $out/bin/hc-scaffold
cp $src/.templates/app -R $out/.template
# Because we create this ourself, by creating a wrapper
makeWrapper ${inputs'.scaffolding.packages.default}/bin/hc-scaffold $out/bin/hc-scaffold \
--add-flags "--template $out/.template"
'';
packages.hc-scaffold-app-template = inputs.scaffolding.lib.wrapCustomTemplate {
inherit pkgs system;
customTemplatePath = ./.templates/app;
};

packages.hc-scaffold-template-module= pkgs.runCommand "hc-scaffold" {
buildInputs = [ pkgs.makeWrapper ];
src = ./.;
} ''
mkdir $out
# Link every top-level folder from pkgs.hello to our new target
ln -s ${inputs'.scaffolding.packages.default}/* $out
# Except the bin folder
rm $out/bin
mkdir $out/bin
# We create the bin folder ourselves and link every binary in it
ln -s ${inputs'.scaffolding.packages.default}/bin/* $out/bin
# Except the hello binary
rm $out/bin/hc-scaffold
cp $src/.templates/module -R $out/template
# Because we create this ourself, by creating a wrapper
makeWrapper ${inputs'.scaffolding.packages.default}/bin/hc-scaffold $out/bin/hc-scaffold \
--add-flags "--template $out/template"
'';
packages.hc-scaffold-module-template = inputs.scaffolding.lib.wrapCustomTemplate {
inherit pkgs system;
customTemplatePath = ./.templates/module;
};

};
};
Expand Down

0 comments on commit 4626a75

Please sign in to comment.