Skip to content

Commit

Permalink
refactoring utils project to use barrel output
Browse files Browse the repository at this point in the history
  • Loading branch information
fungairino committed Nov 14, 2024
1 parent f0cb378 commit 72b5f4b
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion applications/browser-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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
5 changes: 3 additions & 2 deletions knip.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const knipConfig = {
],
},
"libraries/*": {
entry: "src/*.ts!",
project: "**/*.ts",
// ! suffix files are included in production mode
entry: "src/index.ts!",
project: ["src/**/*.ts!", "!src/**/*.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,5 +1,5 @@
{
"name": "@pixiebrix/utils",
"name": "@pixiebrix/util-debug",
"version": "1.0.0",
"description": "PixieBrix Utility Library",
"scripts": {
Expand All @@ -9,8 +9,9 @@
"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
19 changes: 19 additions & 0 deletions libraries/util-debug/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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 * as debugUtils from "./lib/debugUtils";
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
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.

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 72b5f4b

Please sign in to comment.