Skip to content

Commit

Permalink
build(type): build type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLenglet committed Jun 3, 2024
1 parent e85dbfd commit 5129087
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cut-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: simple

deploy-npm:
Expand All @@ -26,7 +26,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: https://registry.npmjs.org
- run: npm install
- run: npm run build
- run: npm publish
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ if (!environment.production) {

Your redux devtool menu will now show all your store actions, the option `storeName` will be the store instance name there (defaults to the class name if not provided), and every service extending the `Store` class will be its own instance in the dropdown at the top.

![The redux devtool window is opened, showing the store called "Users", in the "action" section, "set users" and "toggle user selection" are shown being called multiple times](assets/devtool.png)
![The redux devtool window is opened, showing the store called "Users", in the "action" section, "set users" and "toggle user selection" are shown being called multiple times](./assets/devtool.png)
2 changes: 1 addition & 1 deletion esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { build } from "esbuild";
import pkg from "./package.json" with { type: "json" };

build({
entryPoints: ["src/main.ts"],
entryPoints: ["src/index.ts"],
outdir: "dist",
format: "esm",
bundle: true,
Expand Down
31 changes: 30 additions & 1 deletion package-lock.json

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

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
"authors": "Anthony Lenglet",
"version": "1.0.0",
"type": "module",
"main": "dist/main.js",
"main": "dist/index.js",
"scripts": {
"build": "node esbuild.config.js"
"build": "node esbuild.config.js && ./node_modules/.bin/tsc -p tsconfig.json"
},
"peerDependencies": {
"@angular/core": ">=17.0.0",
"rxjs": ">=5.0.0"
},
"devDependencies": {
"esbuild": "^0.21.4"
"esbuild": "^0.21.4",
"typescript": "^5.4.5"
},
"dependencies": {
"fluxie": "file:fluxie-1.0.0.tgz"
}
}
4 changes: 3 additions & 1 deletion src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface DevtoolEvent {
source: string;
}

let storeDevtoolInstance = {};
let storeDevtoolInstance: { [key: string]: any } = {};
export let isDevtoolEnabled = false;

export function enableReduxDevtools() {
Expand All @@ -23,6 +23,7 @@ export function initializeReduxDevtools(
if (!isDevtoolInstalled()) {
return false;
}
// @ts-ignore
const newDevtoolInstance = window?.["__REDUX_DEVTOOLS_EXTENSION__"].connect({
name: storeName,
});
Expand Down Expand Up @@ -55,5 +56,6 @@ export function sendActionToDevtools(
}

function isDevtoolInstalled() {
// @ts-ignore
return window?.["__REDUX_DEVTOOLS_EXTENSION__"] !== undefined;
}
File renamed without changes.
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
/* Language and Environment */
"target": "es2022",
"outDir": "dist",

/* Modules */
"module": "ESNext",
Expand All @@ -11,7 +12,9 @@

/* Type Checking */
"strict": true,
"skipLibCheck": true
"declaration": true,
"skipLibCheck": true,
"emitDeclarationOnly": true
},
"exclude": ["node_modules", "dist"]
}

0 comments on commit 5129087

Please sign in to comment.