Skip to content

Commit 95b09c0

Browse files
committed
feat: initial commit of cli tool
0 parents  commit 95b09c0

40 files changed

+12236
-0
lines changed

.envrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Automatically sets up your devbox environment whenever you cd into this
4+
# directory via our direnv integration:
5+
6+
eval "$(devbox generate direnv --print-envrc)"
7+
8+
# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
9+
# for more details

.github/workflows/deploy-docs.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
# Checkout the repository
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
# Set up Node.js
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 18
31+
cache: "npm"
32+
33+
# Install dependencies
34+
- name: Install dependencies
35+
run: npm install --workspace=packages/docs
36+
37+
# Configure pages
38+
- name: Setup Pages
39+
id: pages
40+
uses: actions/configure-pages@v5
41+
42+
# Build the Astro site
43+
- name: Build the docs site
44+
run: npm run build --workspace=packages/docs
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: packages/docs/dist
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
needs: build
56+
runs-on: ubuntu-latest
57+
name: Deploy
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Node
2+
node_modules
3+
4+
# Devbox
5+
.devbox

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 imothee.xyz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# My NPM Workspace
2+
3+
This is a monorepo setup using npm workspaces that contains two main packages: `docs` and `policygen`.
4+
5+
## Packages
6+
7+
### Docs
8+
9+
The `docs` package is an Astro Starlight site that serves as the documentation for the project. It includes:
10+
11+
- **Main Entry Point**: Located at `packages/docs/src/index.astro`, this file defines the structure and content of the documentation site using Astro syntax.
12+
- **Configuration**: The `packages/docs/package.json` file lists the dependencies specific to the Astro site and any scripts for building or serving the site.
13+
- **Astro Configuration**: The `packages/docs/astro.config.mjs` file contains the configuration settings for the Astro project, specifying input and output directories, as well as any integrations or plugins used.
14+
15+
### Policygen
16+
17+
The `policygen` package is a CLI tool designed to generate policies. It includes:
18+
19+
- **Main Entry Point**: Located at `packages/policygen/src/index.ts`, this file contains the logic for generating policies and may include functions for parsing input and outputting generated policies.
20+
- **Configuration**: The `packages/policygen/package.json` file lists the dependencies required for the CLI tool and any scripts for building or running the tool.
21+
- **TypeScript Configuration**: The `packages/policygen/tsconfig.json` file specifies the compiler options, including target, module, and any type definitions needed for the policygen package.
22+
23+
## Setup Instructions
24+
25+
1. Clone the repository:
26+
```
27+
git clone <repository-url>
28+
cd my-npm-workspace
29+
```
30+
31+
2. Install dependencies:
32+
```
33+
npm install
34+
```
35+
36+
3. To run the Astro documentation site:
37+
```
38+
cd packages/docs
39+
npm run dev
40+
```
41+
42+
4. To use the policygen CLI tool:
43+
```
44+
cd packages/policygen
45+
npm run start
46+
```
47+
48+
## Usage Guidelines
49+
50+
- For documentation, navigate to the Astro site in your browser after running the development server.
51+
- For the policygen CLI tool, refer to the command line interface for available commands and options.
52+
53+
This workspace is structured to facilitate easy development and maintenance of both the documentation site and the CLI tool.

devbox.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.2/.schema/devbox.schema.json",
3+
"packages": ["nodejs@latest"]
4+
}

devbox.lock

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {
4+
"github:NixOS/nixpkgs/nixpkgs-unstable": {
5+
"last_modified": "2025-04-13T09:22:33Z",
6+
"resolved": "github:NixOS/nixpkgs/18dd725c29603f582cf1900e0d25f9f1063dbf11?lastModified=1744536153&narHash=sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg%2FN38%3D"
7+
},
8+
"nodejs@latest": {
9+
"last_modified": "2025-04-02T13:00:31Z",
10+
"plugin_version": "0.0.2",
11+
"resolved": "github:NixOS/nixpkgs/384d1adab77a8d49172a3acc1d5c2f26d013a69a#nodejs_23",
12+
"source": "devbox-search",
13+
"version": "23.11.0",
14+
"systems": {
15+
"aarch64-darwin": {
16+
"outputs": [
17+
{
18+
"name": "out",
19+
"path": "/nix/store/7z52lrjdf95sxdv5gmf1lkd6jkmbrk56-nodejs-23.11.0",
20+
"default": true
21+
},
22+
{
23+
"name": "libv8",
24+
"path": "/nix/store/0ksknzxczr0kzbz6swnw9ib84hgi77s8-nodejs-23.11.0-libv8"
25+
}
26+
],
27+
"store_path": "/nix/store/7z52lrjdf95sxdv5gmf1lkd6jkmbrk56-nodejs-23.11.0"
28+
},
29+
"aarch64-linux": {
30+
"outputs": [
31+
{
32+
"name": "out",
33+
"path": "/nix/store/yjnnd52kllrr7ydnz7ixw950fbgv014q-nodejs-23.11.0",
34+
"default": true
35+
},
36+
{
37+
"name": "libv8",
38+
"path": "/nix/store/4i48prhfrkr2wbs06vs5g2aaicncpsfx-nodejs-23.11.0-libv8"
39+
}
40+
],
41+
"store_path": "/nix/store/yjnnd52kllrr7ydnz7ixw950fbgv014q-nodejs-23.11.0"
42+
},
43+
"x86_64-darwin": {
44+
"outputs": [
45+
{
46+
"name": "out",
47+
"path": "/nix/store/m2wfafc3wszhrl6ymyjjjw2b20a0xbx3-nodejs-23.11.0",
48+
"default": true
49+
},
50+
{
51+
"name": "libv8",
52+
"path": "/nix/store/5f0jci5bwflnxp2ysfisv5xwxis7wa45-nodejs-23.11.0-libv8"
53+
}
54+
],
55+
"store_path": "/nix/store/m2wfafc3wszhrl6ymyjjjw2b20a0xbx3-nodejs-23.11.0"
56+
},
57+
"x86_64-linux": {
58+
"outputs": [
59+
{
60+
"name": "out",
61+
"path": "/nix/store/npy9r2i6v4r277y91vnf40l47gwpsdz4-nodejs-23.11.0",
62+
"default": true
63+
},
64+
{
65+
"name": "libv8",
66+
"path": "/nix/store/0shcl7m044cdglpsf9nd61rgfndhx4qm-nodejs-23.11.0-libv8"
67+
}
68+
],
69+
"store_path": "/nix/store/npy9r2i6v4r277y91vnf40l47gwpsdz4-nodejs-23.11.0"
70+
}
71+
}
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)