Skip to content
Snippets Groups Projects
Verified Commit ba4ce5b9 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: move from devenv to flake.nix (wip)

parent f67212aa
No related branches found
No related tags found
No related merge requests found
Showing
with 914 additions and 1590 deletions
File moved
File moved
{
inputs = {
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devenv.url = "github:cachix/devenv?dir=src/modules";
} // (if builtins.pathExists ./.devenv/flake.json
then builtins.fromJSON (builtins.readFile ./.devenv/flake.json)
else {});
outputs = { nixpkgs, ... }@inputs:
let
devenv = if builtins.pathExists ./.devenv/devenv.json
then builtins.fromJSON (builtins.readFile ./.devenv/devenv.json)
else {};
getOverlays = inputName: inputAttrs:
map (overlay: let
input = inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays.");
in input.overlays.${overlay} or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${nixpkgs.lib.concatStringsSep ", " (builtins.attrNames input.overlays)}"))
inputAttrs.overlays or [];
overlays = nixpkgs.lib.flatten (nixpkgs.lib.mapAttrsToList getOverlays (devenv.inputs or {}));
pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = devenv.allowUnfree or false;
permittedInsecurePackages = devenv.permittedInsecurePackages or [];
};
inherit overlays;
};
lib = pkgs.lib;
importModule = path:
if lib.hasPrefix "./" path
then ./. + (builtins.substring 1 255 path) + "/devenv.nix"
else if lib.hasPrefix "../" path
then throw "devenv: ../ is not supported for imports"
else let
paths = lib.splitString "/" path;
name = builtins.head paths;
input = inputs.${name} or (throw "Unknown input ${name}");
subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}";
devenvpath = "${input}" + subpath + "/devenv.nix";
in if builtins.pathExists devenvpath
then devenvpath
else throw (devenvpath + " file does not exist for input ${name}.");
project = pkgs.lib.evalModules {
specialArgs = inputs // { inherit inputs pkgs; };
modules = [
(inputs.devenv.modules + /top-level.nix)
{ devenv.cliVersion = "0.6.3"; }
] ++ (map importModule (devenv.imports or [])) ++ [
./devenv.nix
(devenv.devenv or {})
(if builtins.pathExists ./devenv.local.nix then ./devenv.local.nix else {})
];
};
config = project.config;
options = pkgs.nixosOptionsDoc {
options = builtins.removeAttrs project.options [ "_module" ];
# Unpack Nix types, e.g. literalExpression, mDoc.
transformOptions =
let isDocType = v: builtins.elem v [ "literalDocBook" "literalExpression" "literalMD" "mdDoc" ];
in lib.attrsets.mapAttrs (_: v:
if v ? _type && isDocType v._type then
v.text
else if v ? _type && v._type == "derivation" then
v.name
else
v
);
};
in {
packages."x86_64-linux" = {
optionsJSON = options.optionsJSON;
inherit (config) info procfileScript procfileEnv procfile;
ci = config.ciDerivation;
};
devenv.containers = config.containers;
devShell."x86_64-linux" = config.shell;
};
}
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="
use devenv
\ No newline at end of file
watch_file ./devenv.nix ./flake.nix ./nix/scripts/update-project.nix ./nix/scripts/build.nix ./nix/scripts/init-project.nix ./nix/scripts/build-stylesheets.nix ./nix/scripts/build-and-publish.nix ./nix/scripts/deploy.nix ./nix/scripts/update-files.nix ./nix/scripts/run-tests.nix ./nix/scripts/clean-up.nix ./nix/scripts/go-task.nix ./nix/config/common-packages.nix ./nix/packages/monster.nix
use flake
image: docker-registry.schukai.com:443/nixos-ci-devenv:latest
variables:
NIXOS_VERSION: "23.11"
NIXPKGS_ALLOW_UNFREE: "1"
NIXPKGS_ALLOW_INSECURE: "1"
GIT_DEPTH: 10
stages:
- test
- deploy
after_script:
- if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi
test:
stage: test
tags:
- nixos
script:
- nix develop --command run-ci-tests
deploy:
stage: deploy
tags:
- nixos
script:
- nix develop --command deploy
after_script:
- nix develop --command clean-up
when: on_success
# Changelog
## [3.65.0] - 2024-04-15
### Add Features
- new toc control [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
- new component field-set [#186](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/186)
### Code Refactoring
- move popper to layout namespace [#190](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/190) [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
## [3.64.1] - 2024-04-07
### Bug Fixes
- monster.mjs
- repair monster.mjs file
### Changes
- update license text
- fix import statements
- add showroot files
- add showroot files
## [3.64.0] - 2024-04-04
### Add Features
- add new panel and rename switch-screen to switch-panel [#184](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/184)
### Changes
- release and publish to npm new version 3.64.0
- fix tests
- new command for create-issue, first step for theme generator
- test runners are now empowered to run selected files [#166](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/166)
## [3.63.3] - 2024-04-01
......@@ -28,21 +37,15 @@
### Bug Fixes
- include state-button [#183](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/183)
### Changes
- release and publish to npm new version 3.63.3
- update devenv
- update issue templates
- update template and create showroom section
## [3.63.2] - 2024-03-28
### Bug Fixes
- colors and more, add igrnore change to savebutton [#181](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/181) [#180](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/180)
- colors and more, add ignore change to save button [#181](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/181) [#180](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/180)
### Changes
- release and publish to npm new version 3.63.2
- reorganize playground
## [3.63.1] - 2024-03-27
......@@ -50,118 +53,77 @@
### Bug Fixes
- [#179](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/179) [#176](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/176)
### Changes
- release and publish to npm new version 3.63.1
## [3.63.0] - 2024-03-25
### Add Features
- add events to dataset methods [#178](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/178)
### Changes
- release and publish to npm new version 3.63.0
## [3.62.0] - 2024-03-25
### Add Features
- add addRow, removeRow and copyRow [#175](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/175) [#176](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/176) [#177](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/177)
### Changes
- release and publish to npm new version 3.62.0
## [3.61.0] - 2024-03-24
### Add Features
- new methods and tidy [#174](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/174) [#173](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/173)
### Changes
- release and publish to npm new version 3.61.0
- update tests and doc
- events
## [3.60.0] - 2024-03-24
### Add Features
- min/max for split screen [#172](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/172)
### Changes
- release and publish to npm new version 3.60.0
## [3.59.1] - 2024-03-23
### Bug Fixes
- console log [#171](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/171)
### Changes
- release and publish to npm new version 3.59.1
## [3.59.0] - 2024-03-23
### Add Features
- new split-screen [#171](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/171)
### Changes
- release and publish to npm new version 3.59.0
- update tests and doc
## [3.58.4] - 2024-03-18
### Bug Fixes
- store lists [#139](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/139)
### Changes
- release and publish to npm new version 3.58.4
## [3.58.3] - 2024-03-18
### Bug Fixes
- datatable colum with [#143](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/143)
### Changes
- release and publish to npm new version 3.58.3
## [3.58.2] - 2024-03-17
### Bug Fixes
- playground missing js and remove flex [#144](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/144)
### Changes
- release and publish to npm new version 3.58.2
## [3.58.1] - 2024-03-17
### Bug Fixes
- toggle-switch layout and text [#170](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/170)
### Changes
- release and publish to npm new version 3.58.1
## [3.58.0] - 2024-03-17
### Add Features
- new select feature emptyValueIfNoOptions [#142](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/142)
### Changes
- release and publish to npm new version 3.58.0
- update deploy script
- lint code
- build-webtest
- lint code
- code format
- release and publish to npm new version 3.57.0
- tests and more
## [3.57.0] - 2024-03-06
......@@ -170,23 +132,14 @@
- [#162](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/162)
- new updaterTransformerMethodsSymbol method [#163](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/163)
- new updaterTransformerMethodsSymbol method [#163](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/163)
### Bug Fixes
- [#165](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/165)
- bind this to callback and fix timing [#158](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/158) [#164](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/164)
- add arrowdown handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
- add arrowdown handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
### Changes
- add arrow down handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
- add arrow down handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
- tests and more
- fix tests
- updates [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
- whitespace [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
- optimize outline [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
- optimize outline [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
- rename internal function [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
- fix missing fs bug
- release and publish to npm new version 3.56.1
### Documentation
- typo [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
......@@ -196,49 +149,33 @@
### Bug Fixes
- [3] is not the right way [#151](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/151)
### Changes
- release and publish to npm new version 3.56.1
## [3.56.0] - 2024-02-26
### Add Features
- update datatable controls [#150](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/150) [#149](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/149) [#148](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/148) [#147](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/147) [#146](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/146) [#145](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/145)
### Changes
- release and publish to npm new version 3.56.0
- format
- format
- [#144](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/144)
## [3.55.6] - 2024-01-26
### Bug Fixes
- wrong font family for tab buttons [#140](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/140)
### Changes
- release and publish to npm new version 3.55.6
## [3.55.5] - 2024-01-24
### Bug Fixes
- predefine order in datatable [#138](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/138)
### Changes
- release and publish to npm new version 3.55.5
## [3.55.4] - 2024-01-24
### Bug Fixes
- add gap to button [#137](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/137)
### Changes
- release and publish to npm new version 3.55.4
- update tests
## [3.55.3] - 2024-01-23
......@@ -247,18 +184,13 @@
- fix loading select [#135](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/135)
- reset config [#136](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/136)
- reset config [#136](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/136)
### Changes
- release and publish to npm new version 3.55.3
## [3.55.2] - 2024-01-22
### Bug Fixes
- double fetch [#134](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/134)
### Changes
- release and publish to npm new version 3.55.2
## [3.55.1] - 2024-01-22
......@@ -267,41 +199,25 @@
- catch errors [#133](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/133)
- catch errors [#133](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/133)
- check parameter [#132](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/132)
### Changes
- release and publish to npm new version 3.55.1
- doc
- lint + formatt
- update nixos to 23-11
## [3.55.0] - 2023-11-29
### Add Features
- various changes [#131](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/131)
### Changes
- release and publish to npm new version 3.55.0
## [3.54.0] - 2023-11-23
### Add Features
- new closeOnSelect feature
### Changes
- release and publish to npm new version 3.54.0
## [3.53.0] - 2023-11-11
### Add Features
- new icons (css) [#130](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/130)
### Changes
- release and publish to npm new version 3.53.0
- tidy code
- tidy code
## [3.52.1] - 2023-11-05
......@@ -309,9 +225,6 @@
- only 10 tabs can be activated [#129](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/129)
- fix some css bugs [#128](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/128)
### Changes
- release and publish to npm new version 3.52.1
## [3.52.0] - 2023-11-03
......@@ -319,37 +232,12 @@
- integrate components, test, example and code [#127](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/127)
- integrate components in monster [#127](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/127)
### Changes
- release and publish to npm new version 3.52.0
- documentation
- update documentation
- add aws doc update to tasks [#126](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/126)
- code tidy and update web test
- code lint
- lint and format
- code tidy
## [3.51.5] - 2023-11-01
### Bug Fixes
- release process
### Changes
- release and publish to npm new version 3.51.5
- restore devDependencies
- update release process
- conversion of the repos to nix packagemanger [#125](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/125)
## [v3.51.4] - 2023-06-19
### Bug Fixes
- case if value === null
### Changes
- update packages
## [v3.51.3] - 2023-06-19
......@@ -369,32 +257,20 @@
- issue [#121](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/121) bug in extractKeys
## [v3.51.0] - 2023-06-15
### Changes
- update doc
## [v3.50.0] - 2023-05-24
### Add Features
- new datetimeformat
### Changes
- update and format
## [v3.49.0] - 2023-05-07
### Changes
- update docs and struct
## [v3.48.0] - 2023-05-07
### Bug Fixes
- tests
### Code Refactoring
- initCustomControlOptionCallback -> initCustomControlCallback
......@@ -407,15 +283,9 @@
## [v3.46.0] - 2023-05-02
### Bug Fixes
- tests
### Changes
- update packages
### Code Refactoring
- attribute and form improvments
- attribute and form improvements
## [v3.44.1] - 2023-05-01
......@@ -425,9 +295,6 @@
## [v3.44.0] - 2023-05-01
### Changes
- doc
### Code Refactoring
- monitor all attribute changes
......@@ -444,23 +311,11 @@
- watch only if Object.keys(self[attributeObserverSymbol].length > 0)
## [v3.42.0] - 2023-04-03
### Changes
- update
## [v3.41.0] - 2023-04-03
### Changes
- update
## [v3.40.0] - 2023-04-03
### Add Features
- attribure observer
- attribute observer
## [v3.39.1] - 2023-04-03
......@@ -478,10 +333,7 @@
### Bug Fixes
- case senstive options work now
### Changes
- doc
- case sensitive options work now
## [v3.38.0] - 2023-04-03
......@@ -522,23 +374,11 @@
- invalid input throws TypeError
## [v3.35.0] - 2023-03-27
### Changes
- tidy and doc
### Documentation
- update
## [v3.34.0] - 2023-03-27
### Add Features
- new function detectRuntimeEnvironment and convertToPixels
### Changes
- update packages
## [v3.33.0] - 2023-03-26
......@@ -554,7 +394,6 @@
### Add Features
- \undefined and \null are special values
- \undefined and \null are special values
## [v3.31.1] - 2023-03-20
......@@ -575,36 +414,24 @@
### Add Features
- add util.findElementWithIdUpwards
### Changes
- update packages
## [v3.29.0] - 2023-03-16
### Add Features
- customevents are composed and should bubble across shadowRoot
### Changes
- update packages
- custom events are composed and should bubble across shadowRoot
## [v3.28.0] - 2023-03-14
### Add Features
- customcontrol.updatei18n can now plural rules
### Changes
- update packages
## [v3.27.0] - 2023-03-14
### Add Features
- add instance getter
### Changes
- update packages
## [v3.26.0] - 2023-03-08
......@@ -612,9 +439,6 @@
- prevent has already defined error
## [v3.25.0] - 2023-03-07
## [v3.24.0] - 2023-03-07
### Add Features
......@@ -626,6 +450,7 @@
### Add Features
- template mapping
### Bug Fixes
- rebuild template insert hack
......@@ -640,13 +465,10 @@
### Add Features
- check if element is in a shadowroot.
- check if element is in a shadowRoot.
## [v3.21.1] - 2023-03-07
### Changes
- update packages
### Code Refactoring
- change fkt name internalTemplateLookUP git s
......@@ -683,11 +505,6 @@
## [v3.16.1] - 2023-02-26
### Changes
- update year
- add pipe and i18n test
## [v3.16.0] - 2023-02-26
### Add Features
......@@ -753,6 +570,7 @@
### Add Features
- add callback configuration to restapi
-
### Changes
- update npm
......@@ -762,7 +580,7 @@
### Bug Fixes
- make exeption messages more readable
- make exception messages more readable
## [v3.10.0] - 2023-02-04
......@@ -781,6 +599,7 @@
### Add Features
- document translations
### Bug Fixes
- optimize i18n: transformer
......@@ -795,11 +614,6 @@
### Add Features
- pathfinder now works with array
### Changes
- code format (rome)
- doc
- docs
## [v3.7.0] - 2023-01-26
......@@ -822,6 +636,7 @@
- check the navigator languages too
- new embed i18n provider
-
### Bug Fixes
- doc
......@@ -836,11 +651,6 @@
### Bug Fixes
- error in the status processing
### Changes
- update makefiles
- update makefiles
- doc
## [v3.4.1] - 2023-01-08
......@@ -853,9 +663,6 @@
### Add Features
- add new layer class Server
### Changes
- remove unused code
## [v3.3.0] - 2023-01-07
......@@ -866,9 +673,6 @@
- new Class
- new Webconnect and Message
- new Webconnect and Message
### Changes
- doc
## [v3.2.0] - 2023-01-06
......@@ -898,20 +702,9 @@
- return error in test
- missing callbacks
### Changes
- tests
- administration changes
- doc
- remove unused import
- doc + tidy
## [v3.0.0] - 2023-01-04
### Changes
- update web tests
## [v2.2.1] - 2023-01-03
### Bug Fixes
......@@ -924,10 +717,6 @@
### Add Features
- internalDataSymbol is now global symbol
### Changes
- update npm packages
- add doc
## [v2.1.1] - 2022-12-30
......@@ -941,81 +730,7 @@
- implement instanceof for multi realm
## [v2.0.16] - 2022-10-31
## [v2.0.15] - 2022-10-31
### Changes
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
- commit save point
## [1.30.1] - 2022-02-06
## [1.31.0] - 2022-02-05
## [1.10.0] - 2021-08-29
## [1.9.0] - 2021-08-17
## 1.8.0 - 2021-08-15
- Initial release
# Information about the task runner can be found here:
# https://taskfile.dev
version: '3'
tasks:
default:
cmds:
- task --list
silent: true
commit:
silent: true
desc: Commit changes to the repository.
aliases:
- c
cmds:
- do-commit
run-dev:
silent: true
desc: Start and run the development server
cmds:
- run-development
run-showroom:
silent: true
desc: Start and run the showroom server
cmds:
- run-showroom
build-and-publish-showroom:
silent: true
desc: Build the showroom to dist/showroom and publish it to the s3 bucket
cmds:
- build-and-publish-showroom
create-new-showroom-page:
silent: true
desc: Create a new showroom page
cmds:
- create-new-showroom-page {{.CLI_ARGS}}
run-theme-generator:
silent: true
desc: Start and run the theme generator
cmds:
- run-theme-generator
create-issue:
silent: true
desc: open an issue in gitlab and create a file in the issues folder
cmds:
- create-issue
build-doc:
silent: true
desc: Build the documentation to dist/doc
aliases:
- bd
cmds:
- build-doc
publish-doc:
silent: true
desc: Publish the documentation to dist/doc
aliases:
- bpd
cmds:
- publish-doc
run-tests:
silent: true
desc: Run the tests
aliases:
- rt
cmds:
- run-tests
run-web-tests:
silent: true
desc: Run the tests
aliases:
- rwt
cmds:
- run-web-tests
format-and-lint-code:
silent: true
desc: Format and lint the code
aliases:
- flc
cmds:
- format-and-lint-code
create-new-component-class:
silent: true
desc: Create a new component class
aliases:
- cnc
cmds:
- create-new-component-class {{.CLI_ARGS}}
build-and-publish:
silent: true
desc: Build the app and publish it to the npm registry
aliases:
- bp
cmds:
- build-and-publish
build-stylesheets:
silent: true
desc: Build the stylesheets javascript files
aliases:
- bs
cmds:
- build-stylesheets
\ No newline at end of file
File moved
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>optimize tree-menu #191</title>
<script src="./191.mjs" type="module"></script>
</head>
<body>
<h1>optimize tree-menu #191</h1>
<p></p>
<ul>
<li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/191">Issue #191</a></li>
<li><a href="/">Back to overview</a></li>
</ul>
<main>
<monster-tree-menu>
<script type="application/json">
{
"data": [
{
"id": 1,
"name": "Item 1",
"children": [
{
"id": 2,
"name": "Item 1.1",
"children": [
{
"id": 3,
"name": "Item 1.1.1"
},
{
"id": 4,
"name": "Item 1.1.2"
}
]
},
{
"id": 5,
"name": "Item 1.2",
"children": [
{
"id": 6,
"name": "Item 1.2.1"
},
{
"id": 7,
"name": "Item 1.2.2"
}
]
}
]
},
{
"id": 8,
"name": "Item 2",
"children": [
{
"id": 9,
"name": "Item 2.1",
"children": [
{
"id": 10,
"name": "Item 2.1.1"
},
{
"id": 11,
"name": "Item 2.1.2"
}
]
},
{
"id": 12,
"name": "Item 2.2",
"children": [
{
"id": 13,
"name": "Item 2.2.1"
},
{
"id": 14,
"name": "Item 2.2.2"
}
]
}
]
}
]
}
</script>
</monster-tree-menu>
</main>
</body>
</html>
/**
* @file development/issues/open/191.mjs
* @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/191
* @description optimize tree-menu
* @issue 191
*/
import "../../../source/components/style/property.pcss";
import "../../../source/components/style/normalize.pcss";
import "../../../source/components/style/typography.pcss";
import "../../../source/components/tree-menu/tree-menu.mjs";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>new show error message control #192</title>
<script src="./192.mjs" type="module"></script>
</head>
<body>
<h1>new show error message control #192</h1>
<p></p>
<ul>
<li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/192">Issue #192</a></li>
<li><a href="/">Back to overview</a></li>
</ul>
<main>
<div id="error-message" data-monster-error="this is the error">This control has an error</div>
<monster-context-error>error1</monster-context-error>
<monster-context-error></monster-context-error>
</main>
</body>
</html>
/**
* @file development/issues/open/192.mjs
* @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/192
* @description new show error message control
* @issue 192
*/
import "../../../source/components/style/property.pcss";
import "../../../source/components/style/normalize.pcss";
import "../../../source/components/style/typography.pcss";
import "../../../source/components/form/context-error.mjs";
import {sourcePath, projectRoot} from "./import.mjs";
import {writeFileSync, readFileSync, mkdirSync, existsSync} from "fs";
import {join} from "path";
import * as espree from "espree";
import estraverse from 'estraverse';
const template = `<h2>Monster</h2>
`;
{
"nodes": {
"bob": {
"inputs": {
"devenv": "devenv",
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"mk-shell-bin": "mk-shell-bin",
"nixpkgs": "nixpkgs_2",
"treefmt-nix": "treefmt-nix",
"versions-tool": "versions-tool"
},
"locked": {
"lastModified": 1706563779,
"narHash": "sha256-F6hgtCgEzy6Rx6sDLti72ZbFvOucnMLQ+yVb7GsqYQ4=",
"ref": "refs/heads/master",
"rev": "7069c6702e8ccafd33f734f6e14f102dfd1b15ae",
"revCount": 114,
"type": "git",
"url": "https://gitlab.schukai.com/oss/bob.git"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/bob.git"
}
},
"devenv": {
"inputs": {
"flake-compat": "flake-compat",
"nix": "nix",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1706018268,
"narHash": "sha256-d24+re0t8b6HYGzAPZCIJed85n23RUFXQa2yuHoW0uQ=",
"owner": "cachix",
"repo": "devenv",
"rev": "ad0ae333b210e31237e1fc4a7ddab71a01785add",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"devenv_2": {
"locked": {
"dir": "src/modules",
"lastModified": 1711986077,
"narHash": "sha256-/1zDeLkrEL77J327q42sicdJ6b704gLP+HPa1Ij09qs=",
"owner": "cachix",
"repo": "devenv",
"rev": "e106743bdbd788742f516b3eaea3e21e7162a38e",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1706551415,
"narHash": "sha256-15s36w8kG2XIdhGBdQVuPiY+gQxWrvcGA9AszmvHBGQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "bffc4be17f13c1e43aac906a62e1a6e5ae369c6b",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-root": {
"locked": {
"lastModified": 1692742795,
"narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=",
"owner": "srid",
"repo": "flake-root",
"rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"bob",
"devenv",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"mk-shell-bin": {
"locked": {
"lastModified": 1677004959,
"narHash": "sha256-/uEkr1UkJrh11vD02aqufCxtbF5YnhRTIKlx5kyvf+I=",
"owner": "rrbutani",
"repo": "nix-mk-shell-bin",
"rev": "ff5d8bd4d68a347be5042e2f16caee391cd75887",
"type": "github"
},
"original": {
"owner": "rrbutani",
"repo": "nix-mk-shell-bin",
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": [
"bob",
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1676545802,
"narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=",
"owner": "domenkozar",
"repo": "nix",
"rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "relaxed-flakes",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1678875422,
"narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1703961334,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1685801374,
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1706373441,
"narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "56911ef3403a9318b7621ce745f5452fb9ef6867",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1705856552,
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1704145853,
"narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d2ea8eab9e400618748ab1a6a108255233b602c",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1711668574,
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1711668574,
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"bob",
"devenv",
"flake-compat"
],
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"bob",
"devenv",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1704725188,
"narHash": "sha256-qq8NbkhRZF1vVYQFt1s8Mbgo8knj+83+QlL5LBnYGpI=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ea96f0c05924341c551a797aaba8126334c505d2",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore_2",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1711981679,
"narHash": "sha256-pnbHEXJOdGkPrHBdkZLv/a2V09On+V3J4aPE/BfAJC8=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "f3bb95498eaaa49a93bacaf196cdb6cf8e872cdf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"bob": "bob",
"devenv": "devenv_2",
"nixpkgs": "nixpkgs_5",
"pre-commit-hooks": "pre-commit-hooks_2",
"version": "version"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1706462057,
"narHash": "sha256-7dG1D4iqqt0bEbBqUWk6lZiSqqwwAO0Hd1L5opVyhNM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "c6153c2a3ff4c38d231e3ae99af29b87f1df5901",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"version": {
"inputs": {
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1704542622,
"narHash": "sha256-HnFuaOXHoxv8tpBvMsEjfhcl/hFNxEY7GbBqoyJ1U8U=",
"ref": "refs/heads/master",
"rev": "6b4f85fe6d934429cf3055bbcd8cf15014730118",
"revCount": 114,
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git"
}
},
"versions-tool": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1704542622,
"narHash": "sha256-HnFuaOXHoxv8tpBvMsEjfhcl/hFNxEY7GbBqoyJ1U8U=",
"ref": "refs/heads/master",
"rev": "6b4f85fe6d934429cf3055bbcd8cf15014730118",
"revCount": 114,
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git"
}
}
},
"root": "root",
"version": 7
}
{
pkgs ? null,
inputs ? null,
phps ? null,
lib ? null,
config ? null,
modulesPath ? null,
...
}: let
currentSystem =
if pkgs.stdenv.system != null
then pkgs.stdenv.system
else builtins.currentSystem;
importJSScript = pkgs.writeTextFile {
name = "import.mjs";
text = ''
// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS FILE DIRECTLY.
export const projectRoot = "${config.devenv.root}";
export const sourcePath = "${config.devenv.root}/source";
export const developmentPath = "${config.devenv.root}/development";
export const pnpxBin = "${pkgs.nodePackages.pnpm}/bin/pnpx";
export const nodeBin = "${pkgs.nodejs_20}/bin/node";
export const license = "/**" + "\n" +
" * Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved." + "\n" +
" * Node module: @schukai/monster" + "\n" +
" *" + "\n" +
" * This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3)." + "\n" +
" * The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html" + "\n" +
" *" + "\n" +
" * For those who do not wish to adhere to the AGPLv3, a commercial license is available." + "\n" +
" * Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms." + "\n" +
" * For more information about purchasing a commercial license, please contact schukai GmbH." + "\n" +
" */" + "\n\n" ;
;
// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS FILE DIRECTLY.
'';
};
commonFunctionsScript = pkgs.writeScript "common-functions" ''
if [ -t 1 ]; then
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RESET='\033[0m'
BOLD='\033[1m'
else
RED=""
GREEN=""
BLUE=""
RESET=""
fi
is_true() {
val="$1"
if [ "$val" = 'true' ] || [ "$val" = '1' ]; then
return 0
else
return 1
fi
}
CURRENT_LEVEL=0
get_padding() {
local padding=""
for ((i=0; i < CURRENT_LEVEL; i++)); do
padding+=" "
done
echo "$padding"
}
increase_level() {
CURRENT_LEVEL=$((CURRENT_LEVEL + 1))
}
decrease_level() {
CURRENT_LEVEL=$((CURRENT_LEVEL - 1))
}
echo_ok() {
padding=$(get_padding)
echo -e "$padding$GREEN✔$RESET $1"
}
echo_delimiter() {
echo " "
}
echo_section() {
decrease_level
padding=$(get_padding)
echo -e "\n\n$padding$BOLD$1$RESET"
increase_level
}
echo_text() {
padding=$(get_padding)
echo -e "$padding$1"
}
echo_fail() {
padding=$(get_padding)
echo -e "$padding$RED✖ $1$RESET"
}
echo_hint() {
padding=$(get_padding)
echo -e "$padding$BLUE→ $1$RESET"
}
echo_step() {
padding=$(get_padding)
echo -e "$padding$BLUE•$RESET $1"
}
convert_multiline_for_nix() {
printf "%s" "$1" | ${pkgs.gnused}/bin/sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/g' | tr -d '\n'
}
if [ -z "$DEBUG_MODE" ]; then
DEBUG_MODE='false'
fi
if [ -n "$CI_JOB_TOKEN" ]; then
CI_MODE='true'
fi
if is_true "$DEBUG_MODE" || is_true "$CI_MODE"; then
set -x
fi
'';
in {
env.APP_NAME = "monster";
env.dddd = "@schukai/monster";
# https://devenv.sh/packages/
packages = with pkgs; [
(inputs.version.packages."${builtins.currentSystem}".default)
(inputs.bob.packages."${builtins.currentSystem}".default)
awscli2
graphviz
plantuml
appimage-run
blackbox
coreutils-full
dbeaver
delve
fd
gawk
gcc12
gdlv
git
glab
gnugrep
gnumake
gnused
go-task
gum
lightningcss
httpie
hurl
jq
libffi
logrotate
meld
memcached
netcat
silicon
nodePackages.pnpm
php82Extensions.xdebug
plantuml-c4
alejandra
procps
ranger
unzip
util-linux
zlib
];
languages = {
go = {enable = true;};
javascript = {
enable = true;
package = pkgs.nodejs_20;
corepack.enable = true;
};
};
difftastic.enable = false;
enterShell = ''
## check if node_modules exists
if [ ! -d node_modules ]; then
echo "node_modules does not exist. Installing dependencies."
${pkgs.nodePackages.pnpm}/bin/pnpm install
fi
${pkgs.nodejs_20}/bin/node ${config.devenv.root}/node_modules/jsdoc-plantuml/fixBrokenNodeJS.js
'';
scripts.format-and-lint-code.exec = ''
${pkgs.nodejs_20}/bin/npx biome format --write ${config.devenv.root}/source/
${pkgs.nodejs_20}/bin/npx biome lint --apply ${config.devenv.root}/source/
'';
scripts.build-changelog.exec = ''
${pkgs.git-chglog}/bin/git-chglog --config ${config.devenv.root}/.chglog/config.yml -o ${config.devenv.root}/CHANGELOG.md
'';
scripts.update-files.exec = ''
#!${pkgs.bash}/bin/bash
source ${commonFunctionsScript}
echo_section "Update files"
create_symlink() {
if ${pkgs.coreutils}/bin/ln -s "$1" "$2" 2>/dev/null; then
echo_ok "$2 created"
else
echo_fail "$2 already exists"
fi
}
update_symlink() {
echo_section "Update $1"
local source_path="$1"
local target_path="$2"
local file_name="$(basename "$target_path")"
local source_dir="$(dirname "$source_path")"
${pkgs.coreutils}/bin/mkdir -p "$source_dir" || true
if [[ ! -d "$source_dir" ]]; then
echo_fail "$source_dir is not a directory. Please remove it manually and run the script again."
exit 1
fi
if [[ -L "$source_path" ]]; then
if [[ "$(readlink "$source_path")" != "$target_path" ]]; then
echo_step "Remove old symlink $file_name"
${pkgs.coreutils}/bin/rm "$source_path"
echo_step "Create new symlink $file_name"
create_symlink "$target_path" "$source_path"
echo_ok "$source_path updated$RESET"
else
echo_ok "$source_path is up to date$RESET"
fi
elif [[ -e "$source_path" ]]; then
echo_fail "$source_path already exists and is not a symlink. Please remove it manually and run the script again."
exit 1
else
create_symlink "$target_path" "$source_path"
echo_ok "$source_path created$RESET"
fi
}
update_symlink "${config.devenv.root}/development/scripts/import.mjs" "${importJSScript}"
'';
scripts.build-and-publish.exec = ''
#!${pkgs.bash}/bin/bash
source ${commonFunctionsScript}
echo_section "Build and publish"
echo_step "Update auto-generated files"
update-files
build-stylesheets
build-monster-file
#update-files
${script-build-stylesheets}/bin/build-stylesheets
#build-monster-file
echo_step "Check if git is clean"
if [[ -n "$(git status --porcelain)" ]]; then
echo_fail "Git is not clean. Exiting."
echo_hint "You must commit all changes before you can publish a new version."
exit 1
# exit 1
fi
set -x
echo_step "Get next version"
NEXTVERSION="$(${inputs.version.defaultPackage."${builtins.currentSystem}"}/bin/version predict --git -0)"
NEXTVERSION="$(${versionBin} predict --git -0)"
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo_fail "Version prediction failed. Exiting."
......@@ -301,20 +26,22 @@ in {
echo_ok "New version: $NEXTVERSION"
echo_step "Update package.json and version.mjs"
LASTVERSION=$(cat "${config.devenv.root}/package.json" | jq -r '.version')
jq ".version = \"$NEXTVERSION\"" "${config.devenv.root}/package.json" | ${pkgs.moreutils}/bin/sponge "${config.devenv.root}/package.json"
update-versions
LASTVERSION=${packageData.version}
#jq ".version = \"$NEXTVERSION\"" "${config.devenv.root}/package.json" | ${pkgs.moreutils}/bin/sponge "${config.devenv.root}/package.json"
#update-versions
echo_ok "Package.json and version.mjs updated"
PROJECT_ROOT="${config.devenv.root}/"
TEST_PATH="${config.devenv.root}/test/"
BUILD_PATH="${config.devenv.root}/dist/"
PROJECT_ROOT="/"
TEST_PATH="/test/"
BUILD_PATH="/dist/"
if [ -d "$BUILD_PATH" ]; then
echo_step "Remove old build directory"
rm -rf "$BUILD_PATH"
fi
pwd
ls -lah
echo_step "Create new build directory"
mkdir -p "''${BUILD_PATH}"
......@@ -384,7 +111,116 @@ in {
fi
echo_ok "Tag created"
echo_ok "Publish successful"
'';
*********************
-run-dev:
silent: true
desc: Start and run the development server
cmds:
- run-development
-run-showroom:
silent: true
desc: Start and run the showroom server
cmds:
- run-showroom
-build-and-publish-showroom:
silent: true
desc: Build the showroom to dist/showroom and publish it to the s3 bucket
cmds:
- build-and-publish-showroom
-create-new-showroom-page:
silent: true
desc: Create a new showroom page
cmds:
- create-new-showroom-page {{.CLI_ARGS}}
-run-theme-generator:
silent: true
desc: Start and run the theme generator
cmds:
- run-theme-generator
-create-issue:
silent: true
desc: open an issue in gitlab and create a file in the issues folder
cmds:
- create-issue
-build-doc:
silent: true
desc: Build the documentation to dist/doc
aliases:
- bd
cmds:
- build-doc
-publish-doc:
silent: true
desc: Publish the documentation to dist/doc
aliases:
- bpd
cmds:
- publish-doc
-run-web-tests:
silent: true
desc: Run the tests
aliases:
- rwt
cmds:
- run-web-tests
-format-and-lint-code:
silent: true
desc: Format and lint the code
aliases:
- flc
cmds:
- format-and-lint-code
-create-new-component-class:
silent: true
desc: Create a new component class
cmds:
- create-new-component-class {{.CLI_ARGS}}
-build-and-publish:
silent: true
desc: Build the app and publish it to the npm registry
cmds:
- build-and-publish
*****************
scripts.update-versions.exec = ''
......@@ -426,7 +262,7 @@ in {
echo_section "create new showroom page"
if ! ${pkgs.nodejs_20}/bin/node ${config.devenv.root}/development/scripts/createNewShowrootmPage.mjs "$@"
if ! ${pkgs.nodejs_20}/bin/node ${config.devenv.root}/development/scripts/createNewShowroomPage.mjs "$@"
then
echo_fail "script createNewClass.mjs failed, check your JS!"
exit 1
......@@ -434,6 +270,20 @@ in {
echo_ok "New showroom page created"
'';
scripts.update-showroom-navigation.exec = ''
#!${pkgs.bash}/bin/bash
source ${commonFunctionsScript}
echo_section "update showroom navigation"
if ! ${pkgs.nodejs_20}/bin/node ${config.devenv.root}/development/scripts/updateShowroomNavigation.mjs
then
echo_fail "script updateShowroomNavigation.mjs failed, check your JS!"
exit 1
fi
echo_ok "Showroom navigation updated"
'';
scripts.build-and-publish-showroom.exec = ''
......@@ -551,86 +401,6 @@ in {
'';
scripts.build-stylesheets.exec = ''
#!${pkgs.bash}/bin/bash
TEST_PATH="${config.devenv.root}/test"
TEST_CASES_PATH="''${TEST_PATH}/cases/"
source ${commonFunctionsScript}
echo_section "build stylesheets"
function build() {
source ${commonFunctionsScript}
local prefix="${config.devenv.root}/source/"
echo_step "build stylesheet ''${1#$prefix}"
${pkgs.nodejs_20}/bin/node ${config.devenv.root}/development/scripts/buildStylesheets.mjs "$1"
}
export -f build
if ! ${pkgs.fd}/bin/fd --absolute-path --full-path ${config.devenv.root}/source --type file --extension pcss -0 | xargs -0 -I {} bash -c 'build "$@"' _ {}; then
echo_fail "Stylesheet build failed. Exiting."
exit 1
fi
echo_ok "Stylesheet build successful"
'';
scripts.run-tests.exec = ''
#!${pkgs.bash}/bin/bash
TEST_PATH="${config.devenv.root}/test"
TEST_CASES_PATH="''${TEST_PATH}/cases/"
source ${commonFunctionsScript}
update-versions
echo_section "run tests"
selection=$(gum choose "run specific test" "run all tests" "Cancel")
if [[ "$selection" == "Cancel" ]]; then
echo_text "Exiting."
exit 0
fi
if [[ "$selection" == "run all tests" ]]; then
echo_step "run specific tests"
if ! ${pkgs.nodePackages.pnpm}/bin/pnpm mocha --colors --jobs 1 --bail --recursive $TEST_CASES_PATH
then
echo "ERROR: Tests failed, check your JS!"
exit 1
fi
exit 0
fi
escaped_test_cases_path=$(printf '%s\n' "$TEST_CASES_PATH" | sed 's:[\\/&]:\\&:g;$!s/$/\\/')
echo_step "run all tests"
files=$(find $TEST_CASES_PATH -type f -name "*.mjs")
relative_files=$(echo "$files" | sed "s|''${escaped_test_cases_path}||g")
selected=$(echo "$relative_files" | gum filter --no-limit --header="Select the test case to run" --placeholder="Select test case to run, use tab to select multiple files")
if [[ -z "$selected" ]]; then
echo_text "No files selected. Exiting."
exit 0
fi
full_paths=$(echo "$selected" | sed "s|^|''${escaped_test_cases_path}|")
if ! ${pkgs.nodePackages.pnpm}/bin/pnpm mocha --colors --jobs 1 --bail --recursive $full_paths
then
echo "ERROR: Tests failed, check your JS!"
exit 1
fi
'';
scripts.build-monster-file.exec = ''
#!${pkgs.bash}/bin/bash
......
inputs:
nixpkgs:
url: github:nixos/nixpkgs/nixos-23.11
version:
url: git+https://gitlab.schukai.com/oss/utilities/version.git
flake: true
bob:
url: git+https://gitlab.schukai.com/oss/bob.git
flake: true
\ No newline at end of file
{
"nodes": {
"common": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-VjRoAeu0HhpiJ/oCup7JyT8IEgO+CwLkxCTno3UwAK8=",
"path": "./common",
"type": "path"
},
"original": {
"path": "./common",
"type": "path"
}
},
"devFlakes": {
"inputs": {
"common": "common",
"git-commit": "git-commit",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1715272075,
"narHash": "sha256-AzweeNBIAnYohoBx6NXmSy7aayFr0H1DfEFvDnHIaLY=",
"ref": "refs/heads/master",
"rev": "4a30b23f6580958ff5e06af5534f03228f7be631",
"revCount": 28,
"type": "git",
"url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-commit": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-8hXrOA8SKy//ctoL1poIhJwuT7G4rvVu7FguROzEoDg=",
"path": "./git-commit",
"type": "path"
},
"original": {
"path": "./git-commit",
"type": "path"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1714971268,
"narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1715106579,
"narHash": "sha256-gZMgKEGiK6YrwGBiccZ1gemiUwjsZ1Zv49KYOgmX2fY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8be0d8a1ed4f96d99b09aa616e2afd47acc3da89",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1715395895,
"narHash": "sha256-DreMqi6+qa21ffLQqhMQL2XRUkAGt3N7iVB5FhJKie4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "71bae31b7dbc335528ca7e96f479ec93462323ff",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1704145853,
"narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d2ea8eab9e400618748ab1a6a108255233b602c",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"root": {
"inputs": {
"devFlakes": "devFlakes",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_4",
"version": "version"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"version": {
"inputs": {
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1715522646,
"narHash": "sha256-Cljp1vlqLuvP5oqvFZGwbZ0ypWnLkK2t+0qDe+rX13E=",
"ref": "refs/heads/master",
"rev": "abd140ed98b8ecb71212f388260a40c8ef0e2426",
"revCount": 122,
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git/"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git/"
}
}
},
"root": "root",
"version": 7
}
flake.nix 0 → 100644
{
description = "Monster is a javascript and component library for building fantastic web applications.";
inputs = {
nixpkgs = {url = "github:nixos/nixpkgs/nixos-23.11";};
flake-utils = {url = "github:numtide/flake-utils";};
version = {url = "git+https://gitlab.schukai.com/oss/utilities/version.git/";};
devFlakes = {url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes.git";};
};
outputs = {
self,
nixpkgs,
flake-utils,
devFlakes,
version,
} @ inputs:
flake-utils.lib.eachDefaultSystem (system: let
inherit (nixpkgs.lib) optional;
pkgs' = import nixpkgs {
inherit system;
};
versionPath = version.packages.${system}.version;
versionBin = versionPath + "/bin/version";
script-task = pkgs'.callPackage ./nix/scripts/go-task.nix {inherit commonScript versionBin;};
script-clean-up = pkgs'.callPackage ./nix/scripts/clean-up.nix {inherit commonScript;};
script-deploy = pkgs'.callPackage ./nix/scripts/deploy.nix {inherit commonScript versionBin updateChangelogScript;};
script-update-changelog = pkgs'.callPackage ./nix/scripts/update-changelog.nix {inherit commonScript versionBin;};
updateChangelogScript = script-update-changelog + "/bin/update-changelog";
rootPath = ./.;
commonPck = devFlakes.packages.${system}.common;
commonScript = commonPck + "/bin/common";
commonPackages = import ./nix/config/common-packages.nix {inherit pkgs';};
extendedPackages = [
script-task
];
scriptPackages = [
versionPath
];
ciScriptPackages = [
script-deploy
script-clean-up
];
shellPackages = let
lib = pkgs'.lib;
ciJobToken = builtins.getEnv "CI_JOB_TOKEN";
in
commonPackages
++ extendedPackages
++ scriptPackages
++ lib.optionals (ciJobToken != null) ciScriptPackages;
debugShellPackages =
commonPackages
++ scriptPackages
++ [
];
in {
packages = rec {
monster = pkgs'.callPackage ./nix/packages/monster.nix {inherit commonScript;};
default = self.monster;
};
devShells = {
default = let
ciJobToken = builtins.getEnv "CI_JOB_TOKEN";
in
pkgs'.mkShell {
nativeBuildInputs = shellPackages;
shellHook = ''
source ${commonScript}
if [ -n "${ciJobToken}" ]; then
echo_fail "You are in a CI environment, this shell is not intended for CI, but for local development"
exit 1
fi
echo_header "Default Monster Shell"
readonly worktree=$(get_working_dir)
echo_hint "Working directory: ''${worktree}"
currentVersion=$(${versionBin} print -g)
if [ -z "''${currentVersion}" ]; then
echo_fail "No version found, check your git tags"
else
echo_hint "Current version: ''${currentVersion}"
fi
currentGitBranch=$(git rev-parse --abbrev-ref HEAD)
echo_hint "Current branch: ''${currentGitBranch}"
echo_hint "You can run the task command to see the available tasks"
if [ -d "node_modules" ]; then
echo_ok "Node modules are already installed"
else
echo_fail "Node modules are not installed, run task init-project"
fi
echo_section "Happy hacking!"
'';
};
debug = let
ciJobToken = builtins.getEnv "CI_JOB_TOKEN";
in
pkgs'.mkShell {
nativeBuildInputs = debugShellPackages;
# apps.run-server = pkgs'.writeShellScriptBin "run-server" ''
# ${commonScript}
# ${script-run-server}
# '';
shellHook = ''
'';
};
};
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment