move dev dependencies to flake.nix

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-19 16:33:13 +03:00
parent 16ced3d449
commit 7cfded56a8
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
5 changed files with 81 additions and 7 deletions

4
.gitignore vendored
View File

@ -4,3 +4,7 @@ node_modules/
package-lock.json
dist/
# direnv
.envrc
.direnv/

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1668852955,
"narHash": "sha256-1ozaNW9uFRvm3cP9M6FPx+hdqyFQnf49M3HrLQ6nqrk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2fb6f9fb0ef3ca727cbd9ae30b90d1ce49d5fcca",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View File

@ -0,0 +1,21 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
deno
nodejs-18_x
nodePackages.typescript
];
};
});
}

View File

@ -1,6 +1,7 @@
DENO := deno
COV := $(DENO) coverage cov_profile
FMT := $(DENO) fmt *.ts examples/*.ts
NPM_PUB := npm publish
dev: fmt tests cov
@ -23,3 +24,14 @@ fmt-check:
clean:
rm -rf cov_profile dist
build: clean
tsc && tsc -p tsconfig.cjs.json
dry-pub:
$(NPM_PUB) --dry-run
pub:
$(NPM_PUB)

View File

@ -4,10 +4,7 @@
"description": "Simple finite state machine for nodejs",
"readme": "README.md",
"scripts": {
"build": "tsc && tsc -p tsconfig.cjs.json",
"check": "tsc --noEmit && tsc -p tsconfig.cjs.json --noEmit",
"clean": "rm -rf ./dist",
"prepublishOnly": "npm run clean && npm run build"
"prepublishOnly": "make build"
},
"repository": {
"type": "git",
@ -28,9 +25,6 @@
"url": "https://github.com/pleshevskiy/it-fsm/issues"
},
"homepage": "https://git.pleshevski.ru/pleshevskiy/it-fsm#readme",
"devDependencies": {
"typescript": "^4.9.3"
},
"main": "./dist/cjs/fsm.js",
"module": "./dist/esm/fsm.js",
"types": "./dist/esm/fsm.d.ts",