Skip to content

Commit

Permalink
feat(config): Added config library to support loading user workspace …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
sullivanpj committed Nov 19, 2023
1 parent 435748f commit 489284a
Show file tree
Hide file tree
Showing 21 changed files with 1,569 additions and 233 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -1,3 +1,4 @@
# These are supported funding model platforms

patreon: StormSoftware
github: storm-software
33 changes: 33 additions & 0 deletions .github/workflows/dependabot-approve.yml
@@ -0,0 +1,33 @@
# https://stackoverflow.com/q/70664840/590396
name: Dependabot auto-approve
on: pull_request_target

permissions:
contents: write
pull-requests: write

env:
CI: true
NX_VERBOSE_LOGGING: true
STORM_REPO_WORKER: stormie-bot
STORM_REPO_URL: https://github.com/storm-software/storm-stack
STORM_REPO_ROOT: ${{ github.workspace }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' }}
steps:
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Expand Up @@ -321,5 +321,6 @@
******************************/
"commitizen.capitalizeWindowsDriveLetter": true,
"commitizen.autoSync": false,
"commitizen.showOutputChannel": "always"
"commitizen.showOutputChannel": "always",
"cSpell.words": ["typeschema"]
}
4 changes: 2 additions & 2 deletions README.md
@@ -1,11 +1,11 @@
<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/storm-banner.gif" width="100%" altText="Storm Software" /></div>

<br />
<div align="center">
<a href="https://stormsoftware.org" target="_blank">Website</a> | <a href="https://stormsoftware.org/contact" target="_blank">Contact</a> | <a href="https://github.com/storm-software/storm-stack" target="_blank">Repository</a> | <a href="https://storm-software.github.io/storm-stack/" target="_blank">Documentation</a> | <a href="https://github.com/storm-software/storm-stack/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a> | <a href="https://github.com/storm-software/storm-stack/issues/new?assignees=&labels=enhancement&template=feature-request.yml&title=Feature Request%3A+">Request a Feature</a> | <a href="https://github.com/storm-software/storm-stack/discussions">Ask a Question</a>
</div>

<br />
<h1>Storm Stack</h1>
⚡ The <b>Storm Stack</b> monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.
<br /><br />
⚡ <b>Storm Workspaces</b> are built using <a href="https://nx.dev/" target="_blank">Nx</a>, a set of extensible dev tools for monorepos, which helps you develop like Google, Facebook, and Microsoft. Building on top of Nx, the Open System provides a set of tools and patterns that help you scale your monorepo to many teams while keeping the codebase maintainable.
Expand All @@ -14,7 +14,7 @@

[![github](https://img.shields.io/github/package-json/v/storm-software/storm-stack?style=for-the-badge&color=1fb2a6)](https://github.com/storm-software/storm-stack)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-stack/build-release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ - This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />

<!--#if GitHubActions-->

Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -93,14 +93,14 @@
"@storm-software/testing-tools": "latest",
"@storm-software/workspace-tools": "latest",
"@swc-node/register": "^1.6.8",
"@swc/cli": "^0.1.62",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.96",
"@swc/helpers": "^0.5.3",
"@types/jest": "^29.5.8",
"@types/node": "20.9.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"eslint": "^8.53.0",
"eslint": "^8.54.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -111,12 +111,11 @@
"prettier": "^3.1.0",
"prettier-plugin-packagejson": "^2.4.6",
"prettier-plugin-prisma": "^5.0.0",
"semantic-release": "^22.0.7",
"semantic-release": "^22.0.8",
"terser": "^5.24.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"tsup": "^7.2.0",
"typescript": "~5.2.2",
"verdaccio": "^5.27.0"
},
Expand All @@ -139,7 +138,8 @@
"@storm-software/date-time": "workspace:*",
"@storm-software/errors": "workspace:*",
"@storm-software/serialization": "workspace:*",
"@storm-software/logging": "workspace:*"
"@storm-software/logging": "workspace:*",
"@storm-software/config": "workspace:*"
}
},
"triggerEmptyDevReleaseByIncrementingThisNumber": 0
Expand Down
156 changes: 156 additions & 0 deletions packages/config/README.md
@@ -0,0 +1,156 @@
<!-- START header -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->


<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/storm-banner.gif" width="100%" altText="Storm Software" /></div>

<div align="center">
<a href="https://stormsoftware.org" target="_blank">Website</a> | <a href="https://stormsoftware.org/contact" target="_blank">Contact</a> | <a href="https://github.com/storm-software/storm-stack" target="_blank">Repository</a> | <a href="https://storm-software.github.io/storm-stack/" target="_blank">Documentation</a> | <a href="https://github.com/storm-software/storm-stack/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a> | <a href="https://github.com/storm-software/storm-stack/issues/new?assignees=&labels=enhancement&template=feature-request.yml&title=Feature Request%3A+">Request a Feature</a> | <a href="https://github.com/storm-software/storm-stack/discussions">Ask a Question</a>
</div>

<br />
This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack packages include CLI utility applications, tools, and various libraries used to create modern, scalable web applications.
<br />

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-0.0.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ - This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- END header -->

# config

<!-- START doctoc -->
<!-- END doctoc -->

## Reduced Package Size

This project uses [tsup](https://tsup.egoist.dev/) to package the source code due to its ability to remove unused code and ship smaller javascript files thanks to code splitting. This helps to greatly reduce the size of the package and to make it easier to use in other projects.

## Development

This project is built using [Nx](https://nx.dev). As a result, many of the usual commands are available to assist in development.

### Building

Run `nx build config` to build the library.

### Running unit tests

Run `nx test config` to execute the unit tests via [Jest](https://jestjs.io).

### Linting

Run `nx lint config` to run [ESLint](https://eslint.org/) on the package.

<!-- START footer -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->


## Storm Workspaces

Storm workspaces are built using <a href="https://nx.dev/" target="_blank">Nx</a>, a set of extensible dev tools for monorepos, which helps you develop like Google, Facebook, and Microsoft. Building on top of Nx, the Open System provides a set of tools and patterns that help you scale your monorepo to many teams while keeping the codebase maintainable.

## Roadmap

See the [open issues](https://github.com/storm-software/storm-stack/issues) for a list of proposed features (and known issues).

- [Top Feature Requests](https://github.com/storm-software/storm-stack/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Top Bugs](https://github.com/storm-software/storm-stack/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Newest Bugs](https://github.com/storm-software/storm-stack/issues?q=is%3Aopen+is%3Aissue+label%3Abug)

## Support

Reach out to the maintainer at one of the following places:

- [Contact](https://stormsoftware.org/contact)
- [GitHub discussions](https://github.com/storm-software/storm-stack/discussions)
- <support@stormsoftware.org>

## License

This project is licensed under the **Apache License 2.0**. Feel free to edit and distribute this template as you like.

See [LICENSE](LICENSE) for more information.

## Changelog

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Every release, along with the migration instructions, is documented in the [CHANGELOG](CHANGELOG.md) file

## Contributing

First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**.

Please try to create bug reports that are:

- _Reproducible._ Include steps to reproduce the problem.
- _Specific._ Include as much detail as possible: which version, what environment, etc.
- _Unique._ Do not duplicate existing opened issues.
- _Scoped to a Single Bug._ One bug per report.

Please adhere to this project's [code of conduct](.github/CODE_OF_CONDUCT.md).

You can use [markdownlint-cli](https://github.com/storm-software/storm-stack/markdownlint-cli) to check for common markdown style inconsistency.

## Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://www.sullypat.com/"><img src="https://avatars.githubusercontent.com/u/99053093?v=4?s=100" width="100px;" alt="Patrick Sullivan"/><br /><sub><b>Patrick Sullivan</b></sub></a><br /><a href="#design-sullivanpj" title="Design">🎨</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Code">💻</a> <a href="#tool-sullivanpj" title="Tools">🔧</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Documentation">📖</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://tylerbenning.com/"><img src="https://avatars.githubusercontent.com/u/7265547?v=4?s=100" width="100px;" alt="Tyler Benning"/><br /><sub><b>Tyler Benning</b></sub></a><br /><a href="#design-tbenning" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://stormsoftware.org"><img src="https://avatars.githubusercontent.com/u/149802440?v=4?s=100" width="100px;" alt="Stormie"/><br /><sub><b>Stormie</b></sub></a><br /><a href="#maintenance-stormie-bot" title="Maintenance">🚧</a></td>
</tr>
</tbody>
<tfoot>
<tr>
<td align="center" size="13px" colspan="7">
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
</img>
</td>
</tr>
</tfoot>
</table>

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

<br />
<br />
<div align="center">
<img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-banner.png" width="100%" altText="Storm Software" />
</div>
<div align="center">
<a href="https://stormsoftware.org" target="_blank">Website</a> | <a href="https://stormsoftware.org/contact" target="_blank">Contact</a> | <a href="https://linkedin.com/in/patrick-sullivan-865526b0" target="_blank">LinkedIn</a> | <a href="https://medium.com/@pat.joseph.sullivan" target="_blank">Medium</a> | <a href="https://github.com/storm-software" target="_blank">GitHub</a> | <a href="https://keybase.io/sullivanp" target="_blank">OpenPGP Key</a>
</div>

<div align="center">
<p><b>Fingerprint:</b> 1BD2 7192 7770 2549 F4C9 F238 E6AD C420 DA5C 4C2D</p>
</div>

Storm Software is an open source software development organization and creator of Acidic, StormStack and StormCloud. Our mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languagues.

If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our website!

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br /><br />


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- END footer -->
35 changes: 35 additions & 0 deletions packages/config/eslint.config.js
@@ -0,0 +1,35 @@
const { FlatCompat } = require("@eslint/eslintrc");
const baseConfig = require("../../eslint.config.js");
const js = require("@eslint/js");
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
});
module.exports = [
...baseConfig,
{
files: [
"packages/config/**/*.ts",
"packages/config/**/*.tsx",
"packages/config/**/*.js",
"packages/config/**/*.jsx"
],
parserOptions: { project: ["packages/config/tsconfig.*?.json"] },
rules: {}
},
{
files: ["packages/config/**/*.ts", "packages/config/**/*.tsx"],
rules: {}
},
{
files: ["packages/config/**/*.js", "packages/config/**/*.jsx"],
rules: {}
},
...compat.config({ parser: "jsonc-eslint-parser" }).map(config => ({
...config,
"files": ["packages/config/**/*.json"],
"rules": {
"@nx/dependency-checks": "error"
}
}))
];
3 changes: 3 additions & 0 deletions packages/config/jest.config.ts
@@ -0,0 +1,3 @@
import { getJestConfig } from "@storm-software/testing-tools";

export default getJestConfig("packages/config", true, "config");
20 changes: 20 additions & 0 deletions packages/config/package.json
@@ -0,0 +1,20 @@
{
"name": "@storm-software/config",
"version": "0.0.1",
"private": false,
"description": "⚡ The storm-stack monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
"repository": {
"type": "github",
"url": "https://github.com/storm-software/storm-stack.git",
"directory": "packages/config"
},
"type": "module",
"dependencies": {
"@decs/typeschema": "^0.12.1",
"cosmiconfig": "^8.3.6",
"zod": "^3.22.4"
},
"publishConfig": {
"access": "public"
}
}
35 changes: 35 additions & 0 deletions packages/config/project.json
@@ -0,0 +1,35 @@
{
"name": "config",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/config/src",
"targets": {
"build": {
"executor": "@storm-software/workspace-tools:tsup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/config",
"tsConfig": "packages/config/tsconfig.json",
"project": "packages/config/package.json",
"defaultConfiguration": "production",
"external": [
"valibot",
"ow",
"fp-ts/Either",
"@effect/schema",
"@deepkit/type"
]
},
"configurations": {
"production": {
"debug": false
},
"development": {
"debug": true
}
}
},
"lint": {},
"test": {}
}
}

0 comments on commit 489284a

Please sign in to comment.