Skip to content

Commit

Permalink
feat(monorepo): Major redesign of project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Feb 9, 2024
1 parent 7032341 commit 20c7a8f
Show file tree
Hide file tree
Showing 193 changed files with 15,680 additions and 9,612 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ no-optional=false
skip-optional=false
auto-install-peers=true

prefer-workspace-packages=true
registry=https://registry.npmjs.org/
#registry=http://localhost:4873/

Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,6 @@
"source.sortMembers": "explicit"
}
},
"eslint.validate": ["json"]
"eslint.validate": ["json"],
"cSpell.words": ["kleur"]
}
33 changes: 33 additions & 0 deletions apps/nx-tools/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json"
},
overrides: [
{
files: ["./package.json", "./generators.json", "./executors.json", "./migrations.json"],
parser: "jsonc-eslint-parser",
rules: {
"@nx/nx-plugin-checks": "error"
}
},
{
files: ["./package.json"],
parser: "jsonc-eslint-parser",
rules: {
"@nx/dependency-checks": [
"error",
{
buildTargets: ["build"],
ignoredDependencies: ["nx", "typescript"]
}
]
}
}
]
};

module.exports = config;
23 changes: 5 additions & 18 deletions tools/nx/README.md → apps/nx-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ This library was generated with [Nx](https://nx.dev).
Using [pnpm](http://pnpm.io):

```bash
pnpm add -D @storm-stack/tools-nx
pnpm add -D @storm-stack/nx-tools
```

<details>
<summary>Using npm</summary>

```bash
npm install -D @storm-stack/tools-nx
npm install -D @storm-stack/nx-tools
```

</details>
Expand All @@ -62,7 +62,7 @@ npm install -D @storm-stack/tools-nx
<summary>Using yarn</summary>

```bash
yarn add -D @storm-stack/tools-nx
yarn add -D @storm-stack/nx-tools
```

</details>
Expand Down Expand Up @@ -90,19 +90,6 @@ nx run my-project:tamagui

**Please note:** _The tamagui executor should be included in the desired projects's `project.json` file._

### Options

The following executor options are available:

| Option | Type | Description | Default |
| --------- | ------ | ------------- | --------- |
| entry | `string` | The path to the entry file, relative to project. | "{sourceRoot}/index.ts" |
| outputPath | `string` | The output path of the generated files. | "dist/{projectRoot}" |
| tsConfig | `string` | The path to the \`tsconfig.json\` file. | "tsconfig.json" |
| clean | `boolean` | Remove the output path before building. | `true` |
| required | `string` | | |




<!-- markdownlint-restore -->
Expand All @@ -126,11 +113,11 @@ The following generators are available with this package to assist in workspace

## Building

Run `nx build tools-nx` to build the library.
Run `nx build nx-tools` to build the library.

## Running unit tests

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

<!-- START footer -->
<!-- prettier-ignore-start -->
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions apps/nx-tools/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./src";
export * from "./src/executors/tamagui/executor";
2 changes: 1 addition & 1 deletion tools/nx/jest.config.ts → apps/nx-tools/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { getJestConfig } from "@storm-software/testing-tools";

export default getJestConfig("tools/nx", true, "tools-nx");
export default getJestConfig("tools/nx", true, "nx-tools");
16 changes: 11 additions & 5 deletions tools/nx/package.json → apps/nx-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{
"name": "@storm-stack/tools-nx",
"name": "@storm-stack/nx-tools",
"private": false,
"version": "0.0.1",
"type": "commonjs",
"main": "./src/index.js",
"typings": "./src/index.d.ts",
"executors": "./executors.json",
"dependencies": {
"@storm-software/workspace-tools": "latest",
"@nx/devkit": "17.2.8",
"@storm-software/config": "latest",
"@storm-software/config-tools": "latest",
"@storm-software/workspace-tools": "latest",
"@tamagui/fake-react-native": "^1.89.11",
"esbuild": "^0.20.0",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"tslib": "^2.3.0"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4"
},
"peerDependencies": {
"nx": "17.2.8"
}
"nx": "17.2.8",
"@tamagui/web": "^1.89.8"
},
"executors": "./executors.json"
}
32 changes: 16 additions & 16 deletions tools/nx/project.json → apps/nx-tools/project.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "tools-nx",
"name": "nx-tools",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "tools/nx/src",
"sourceRoot": "apps/nx-tools/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/tools/nx",
"tsConfig": "tools/nx/tsconfig.json",
"project": "tools/nx/package.json",
"main": "tools/nx/src/index.ts",
"additionalEntryPoints": ["tools/nx/src/executors/tamagui/executor.ts"],
"outputPath": "dist/apps/nx-tools",
"tsConfig": "apps/nx-tools/tsconfig.json",
"project": "apps/nx-tools/package.json",
"main": "apps/nx-tools/src/index.ts",
"additionalEntryPoints": ["apps/nx-tools/src/executors/tamagui/executor.ts"],
"platform": "node",
"deleteOutputPath": true,
"bundle": true,
Expand All @@ -21,15 +21,15 @@
"metafile": true,
"minify": false,
"format": ["cjs"],
"external": ["nx", "@angular-devkit/architect"],
"external": ["nx", "@angular-devkit/architect", "@tamagui/proxy-worm", "esbuild"],
"esbuildOptions": {
"outExtension": {
".js": ".js"
}
},
"assets": [
{
"input": "./tools/nx",
"input": "./apps/nx-tools",
"glob": "*.md",
"output": "/"
},
Expand All @@ -39,37 +39,37 @@
"output": "/"
},
{
"input": "./tools/nx/src",
"input": "./apps/nx-tools/src",
"glob": "**/!(*.ts)",
"output": "./src"
},
{
"input": "./tools/nx/src",
"input": "./apps/nx-tools/src",
"glob": "**/*.d.ts",
"output": "./src"
},
{
"input": "./tools/nx",
"input": "./apps/nx-tools",
"glob": "generators.json",
"output": "."
},
{
"input": "./tools/nx",
"input": "./apps/nx-tools",
"glob": "executors.json",
"output": "."
},
{
"input": "./tools/nx",
"input": "./apps/nx-tools",
"glob": "**/schema.json",
"output": "."
},
{
"input": "./tools/nx",
"input": "./apps/nx-tools",
"glob": "**/files/**/{*.*,*}",
"output": "."
},
{
"input": "./tools/nx/assets",
"input": "./apps/nx-tools/assets",
"glob": "**/*.*",
"output": "./assets"
}
Expand Down
10 changes: 10 additions & 0 deletions apps/nx-tools/src/executors/tamagui/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const replaceReactNativeWeb = {
esm: {
from: 'from "react-native"',
to: 'from "react-native-web"'
},
cjs: {
from: 'require("react-native")',
to: 'require("react-native-web")'
}
};

0 comments on commit 20c7a8f

Please sign in to comment.