Skip to content

Commit

Permalink
Merge pull request #995 from totoroot/javascript-directory
Browse files Browse the repository at this point in the history
Add support for specifying JavaScript root directory
  • Loading branch information
domenkozar authored Mar 6, 2024
2 parents acc01d3 + 10b8abd commit cd8975d
Show file tree
Hide file tree
Showing 25 changed files with 371 additions and 121 deletions.
10 changes: 10 additions & 0 deletions examples/javascript-bun/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Devenv
.devenv*
devenv.local.nix

# JavaScript runtimes
node_modules/
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lockb
5 changes: 5 additions & 0 deletions examples/javascript-bun/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -ex

node -e "require('axios')"
11 changes: 11 additions & 0 deletions examples/javascript-bun/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs, lib, ... }:

{
languages.javascript = {
enable = true;
bun = {
enable = true;
install.enable = true;
};
};
}
3 changes: 3 additions & 0 deletions examples/javascript-bun/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
14 changes: 14 additions & 0 deletions examples/javascript-bun/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "javascript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0"
}
}
10 changes: 10 additions & 0 deletions examples/javascript-directory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Devenv
.devenv*
devenv.local.nix

# JavaScript runtimes
node_modules/
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lockb
6 changes: 6 additions & 0 deletions examples/javascript-directory/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -ex

cd directory
node -e "require('axios')"
13 changes: 13 additions & 0 deletions examples/javascript-directory/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ pkgs, lib, ... }:

{
languages.javascript = {
enable = true;
directory = "directory";
package = pkgs.nodejs-slim;
npm = {
enable = true;
install.enable = true;
};
};
}
3 changes: 3 additions & 0 deletions examples/javascript-directory/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
14 changes: 14 additions & 0 deletions examples/javascript-directory/directory/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "javascript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0"
}
}
10 changes: 10 additions & 0 deletions examples/javascript-pnpm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Devenv
.devenv*
devenv.local.nix

# JavaScript runtimes
node_modules/
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lockb
5 changes: 5 additions & 0 deletions examples/javascript-pnpm/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -ex

node -e "require('axios')"
11 changes: 11 additions & 0 deletions examples/javascript-pnpm/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs, lib, ... }:

{
languages.javascript = {
enable = true;
pnpm = {
enable = true;
install.enable = true;
};
};
}
3 changes: 3 additions & 0 deletions examples/javascript-pnpm/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
14 changes: 14 additions & 0 deletions examples/javascript-pnpm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "javascript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0"
}
}
10 changes: 10 additions & 0 deletions examples/javascript-yarn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Devenv
.devenv*
devenv.local.nix

# JavaScript runtimes
node_modules/
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lockb
5 changes: 5 additions & 0 deletions examples/javascript-yarn/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -ex

node -e "require('axios')"
11 changes: 11 additions & 0 deletions examples/javascript-yarn/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs, lib, ... }:

{
languages.javascript = {
enable = true;
yarn = {
enable = true;
install.enable = true;
};
};
}
3 changes: 3 additions & 0 deletions examples/javascript-yarn/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
14 changes: 14 additions & 0 deletions examples/javascript-yarn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "javascript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0"
}
}
8 changes: 7 additions & 1 deletion examples/javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Devenv
.devenv*
devenv.local.nix
node_modules

# JavaScript runtimes
node_modules/
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lockb
1 change: 1 addition & 0 deletions examples/javascript/.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash

set -ex

node -e "require('axios')"
5 changes: 4 additions & 1 deletion examples/javascript/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{
languages.javascript = {
enable = true;
npm.install.enable = true;
npm = {
enable = true;
install.enable = true;
};
};
}
106 changes: 0 additions & 106 deletions examples/javascript/package-lock.json

This file was deleted.

Loading

0 comments on commit cd8975d

Please sign in to comment.