Skip to content

Commit

Permalink
refactoring utils project to use barrel output (#9524)
Browse files Browse the repository at this point in the history
  • Loading branch information
fungairino authored Nov 15, 2024
1 parent 45e518a commit 42dbf8e
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
node-version-file: applications/browser-extension/package.json
cache: npm
- run: npm ci
- run: npm run test --workspaces -- --coverage
- run: npm run test:ci
- uses: actions/upload-artifact@v4
with:
name: extension-test-coverage
Expand Down
3 changes: 2 additions & 1 deletion applications/browser-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "PixieBrix Browser Extension",
"scripts": {
"test": "TZ=UTC jest",
"test:ci": "TZ=UTC jest --coverage",
"test:watch": "TZ=UTC jest --watchAll",
"test:e2e": "playwright test",
"test:e2e:debug": "PWDEBUG=console playwright test",
Expand Down Expand Up @@ -40,7 +41,7 @@
"@fortawesome/react-fontawesome": "^0.2.2",
"@mozilla/readability": "^0.5.0",
"@pixiebrix/jq-web": "^0.5.1",
"@pixiebrix/utils": "*",
"@pixiebrix/util-debug": "*",
"@reduxjs/toolkit": "^1.9.7",
"@rjsf/bootstrap-4": "^5.22.3",
"@rjsf/core": "^5.22.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { uuidv4 } from "@/types/helpers";
import { cloneDeep, compact, get, pull, uniq } from "lodash";
import { DataPanelTabKey } from "@/pageEditor/tabs/editTab/dataPanel/dataPanelTypes";
import { type TreeExpandedState } from "@/components/jsonTree/JsonTree";
import { getInvalidPath } from "@pixiebrix/utils/src/debugUtils";
import { getInvalidPath } from "@pixiebrix/util-debug";
import {
selectActiveBrickConfigurationUIState,
selectActiveBrickPipelineUIState,
Expand Down
2 changes: 1 addition & 1 deletion applications/browser-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// All project dependencies
// TODO: add @nx/js plugin which will automatically update these paths
{
"path": "../../libraries/utils"
"path": "../../libraries/util-debug"
}
],
"exclude": ["venv", "dist", "node_modules"]
Expand Down
6 changes: 4 additions & 2 deletions knip.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ const knipConfig = {
],
},
"libraries/*": {
entry: "src/*.ts!",
project: "**/*.ts",
// ! suffix files are included in production mode
entry: "src/index.ts!",
project: ["src/**/*.ts!"],
ignore: ["src/lib/globals.d.ts"],
},
"applications/browser-extension": {
entry: [
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "@pixiebrix/utils",
"name": "@pixiebrix/util-debug",
"version": "1.0.0",
"description": "PixieBrix Utility Library",
"description": "PixieBrix Debug Utility Library",
"scripts": {
"test": "TZ=UTC jest",
"test:ci": "TZ=UTC jest",
"lint": "eslint src --ext js,jsx,ts,tsx --quiet --report-unused-disable-directives",
"lint:fast": "ESLINT_NO_IMPORTS=1 eslint src --ext js,jsx,ts,tsx --quiet",
"build": "tsc --build",
"build:typecheck": "tsc --build"
},
"license": "AGPL-3.0",
"repository": "https://github.com/pixiebrix/pixiebrix-extension",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"dependencies": {
"formik": "^2.4.6"
},
Expand Down
18 changes: 18 additions & 0 deletions libraries/util-debug/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2024 PixieBrix, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

export * from "./lib/debugUtils";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/libraries/utils",
"outDir": "../../dist/out-tsc/libraries/util-debug",
"types": ["jest", "node"]
},
"include": [
Expand Down
5 changes: 5 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"cache": true
},
"test": {
"dependsOn": ["^build:typecheck"],
"cache": true
},
"test:ci": {
"dependsOn": ["^build:typecheck"],
"cache": true
},
"lint": {
Expand Down
11 changes: 5 additions & 6 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"scripts": {
"test": "nx run-many -t test",
"test:ci": "nx run-many -t test:ci",
"lint": "nx run-many -t lint",
"build": "nx build",
"build:typecheck": "nx run-many -t build:typecheck",
Expand Down
2 changes: 1 addition & 1 deletion pixiebrix-extension.iml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<excludeFolder url="file://$MODULE_DIR$/.playwright-report" />
<excludeFolder url="file://$MODULE_DIR$/applications/browser-extension/dist" />
<excludeFolder url="file://$MODULE_DIR$/applications/browser-extension/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/libraries/utils/coverage" />
<excludeFolder url="file://$MODULE_DIR$/.nx" />
<excludeFolder url="file://$MODULE_DIR$/libraries/util-debug/coverage" />
<excludePattern pattern="applications/browser-extension/report.html" />
</content>
<orderEntry type="inheritedJdk" />
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "./applications/browser-extension"
},
{
"path": "./libraries/utils"
"path": "./libraries/util-debug"
}
]
}

0 comments on commit 42dbf8e

Please sign in to comment.