Skip to content

Commit

Permalink
chore: improve nx project layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mikonse committed Jun 15, 2024
1 parent cc7946f commit 20f2686
Show file tree
Hide file tree
Showing 33 changed files with 406 additions and 123 deletions.
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI
on:
pull_request:
push:
branches: ["master"]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Nodejs
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install node dependencies
run: npm ci

- name: Set up Python with PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"

- name: Install Python dependencies
run: pdm sync -d -G testing

- name: Lint
run: npx nx run-many --target=lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Nodejs
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install node dependencies
run: npm ci

- name: Set up Python with PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"

- name: Install Python dependencies
run: pdm sync -d -G testing

- name: Test
run: npx nx run-many --target=test

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Nodejs
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install node dependencies
run: npm ci

- name: Set up Python with PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"

- name: Install Python dependencies
run: pdm sync -d -G testing

- name: Build
run: npx nx run-many --target=build
55 changes: 2 additions & 53 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,50 +72,11 @@ node_modules
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
.idea

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

Expand All @@ -128,20 +89,8 @@ out/
# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
fabric.properties
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,57 @@ Software Development Kit for SFT projects.

## Contributing

This repo is using [NX](https://nx.dev/) as mono-repo management tooling.

- First install nodejs in the current lts version (20).

Then install node dependencies via

```bash
npm install
```

To start hacking on the python parts simply use [pdm](https://pdm-project.org) to install all dependencies.

```bash
pdm install
```

To start hacking on the web parts install all dependencies via npm
### Packages in this repo

| Name | Directory | Package Name | Technology |
| --------------- | --------------------- | ------------------------- | ---------- |
| sftkit | `sftkit` | `sftkit` | Python |
| components | `web/components` | `@sftkit/components` | TypeScript |
| form-components | `web/form-components` | `@sftkit/form-components` | TypeScript |
| modal-provider | `web/modal-provider` | `@sftkit/modal-provider` | TypeScript |
| utils | `web/utils` | `@sftkit/utils` | TypeScript |

#### Linting

To run respective linters on a project run

```bash
npm install
npx nx lint <project-name>
```

#### Formatting

```bash
npx nx run sftkit:format
npx nx format
```

#### Testing

```bash
npx nx test <project-name>
```

#### Building

```bash
npx nx build <project-name>
```

## Contact
Expand Down
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"defaultBase": "master",
"parallel": 5,
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@sfdkit/root",
"name": "@sftkit/root",
"version": "0.0.0",
"license": "MIT",
"scripts": {},
Expand Down
Loading

0 comments on commit 20f2686

Please sign in to comment.