Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/medienhaus/medienhaus-dev-tools
https://github.com/medienhaus/medienhaus-dev-tools
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/medienhaus/medienhaus-dev-tools
- Owner: medienhaus
- Created: 2022-09-08T11:30:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T14:23:18.000Z (8 months ago)
- Last Synced: 2024-05-07T15:38:04.840Z (8 months ago)
- Language: JavaScript
- Size: 1.72 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### medienhaus/
Customizable, modular, free and open-source environment for decentralized, distributed communication and collaboration without third-party dependencies.
[Website](https://medienhaus.dev/) β [Fediverse](https://chaos.social/@medienhaus)
# medienhaus-dev-tools π§
Development and maintenance tools for matrix rooms and spaces.
`/leave` lets you leave every space or room with a given name.
`/space` event lets you add a state event with a given name to a given room.
`/createStructure` lets you create a nested matrix spaces tree based on a json file## Static Next.js React front-facing interface
### Deployment as static website
Clone git repository and run `npm run build`.
This will create a folder called 'out' with the static website### Installation
#### `npm install`
Installs all of the applicationβs dependencies.
### Configuration
Configuration happens in the `next.config.js` file.
### Available scripts
In the project directory, you can run:
#### `npm run dev`
Runs the application in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.The page will reload if you make edits.
You will also see any lint errors in the console.#### `npm run export`
Builds a production-ready version of the application and exports it to the `out` directory.
The build is minified and the filenames include the hashes.### Notes
When wrapping a [``](https://nextjs.org/docs/api-reference/next/link) from `next/link` within a styled-component, the [`as`](https://styled-components.com/docs/api#as-polymorphic-prop) prop provided by `styled` will collide with the Link's `as` prop and cause styled-components to throw an `"Invalid tag"` error. To avoid this, you can either use the recommended [`forwardedAs`](https://styled-components.com/docs/api#forwardedas-prop) prop from styled-components or use a different named prop to pass to a `styled` Link.
Click to expand workaround example
**components/StyledLink.js**
```javascript
import Link from 'next/link'
import styled from 'styled-components'const StyledLink = ({ as, children, className, href }) => (
{children}
)export default styled(StyledLink)`
color: #0075e0;
text-decoration: none;
transition: all 0.2s ease-in-out;&:hover {
color: #40a9ff;
}&:focus {
color: #40a9ff;
outline: none;
border: 0;
}
`
```**pages/index.js**
```javascript
import StyledLink from '../components/StyledLink'export default () => (
First post
)
```### create Structure
The Create Structure Route is expecting a json file as an array of objects with following keys :
* name β String
* template β String
* type β String
* parentNames β Array of Strings
* persons β Array of Objects
* name β String
* mail β StringExample:
```
[
{
"name": "root context name",
"template": "root",
"type": "context",
"parentNames": [
""
],
"persons": [
{
"name": "Firstname Lastname",
"mail": "[email protected]"
}
]
},
{
"name": "sub context name",
"template": "sub",
"type": "context",
"parentNames": [
"root context name"
],
"persons": [
{
"name": "Some-Other Name",
"mail": "[email protected]"
}
]
}
]
```
## CLI Tools
### `createStructure` CLI Tool
### Usage
1. Clone or download the repository.
2. Install Node.js.
3. Run the tool with your structure file, matrix base_url, matrix server_name, and access_token.```bash
node ./cli/createStructure.js \
-f ./examples/structure.example.json \
-b https://matrix.example.org \
-s example.org \
-t syt_access_token_foo_bar_baz_etc_lorem_ipsum \
```4. The tool will create the nested matrix spaces based on the input data.
5. The output JSON can be used for further usage.For help, use:
```bash
node ./cli/createStructure.js -h
```