Skip to content

Commit

Permalink
Adopt JS domains. executables are in path now
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Feb 23, 2024
1 parent a8617f1 commit d097b27
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 30 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## 1.0a4 (unreleased)

- Get rid of `MXENV_PATH`. Instead, export `PATH` with virtual environment and node modules bin folders.
- Export `PATH` with virtual environment and node modules bin folders.

- Get rid of `MXENV_PATH`.

- Rename `PYTHON_BIN` to `PRIMARY_PYTHON` in `mxenv` domain.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ endif

# determine the executable path
ifeq ("$(VENV_ENABLED)", "true")
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(shell pwd)/node_modules/.bin/:$(PATH)
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH)
export VIRTUAL_ENV=$(VENV_FOLDER)
MXENV_PYTHON=python
else
Expand Down
2 changes: 1 addition & 1 deletion src/mxmake/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def test_Makefile(self, tempdir):
# determine the executable path
ifeq ("$(VENV_ENABLED)", "true")
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(shell pwd)/node_modules/.bin/:$(PATH)
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH)
export VIRTUAL_ENV=$(VENV_FOLDER)
MXENV_PYTHON=python
else
Expand Down
2 changes: 1 addition & 1 deletion src/mxmake/topics/core/mxenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ endif

# determine the executable path
ifeq ("$(VENV_ENABLED)", "true")
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(shell pwd)/node_modules/.bin/:$(PATH)
export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH)
export VIRTUAL_ENV=$(VENV_FOLDER)
MXENV_PYTHON=python
else
Expand Down
19 changes: 0 additions & 19 deletions src/mxmake/topics/docs/jsdoc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@
#:title = JSDoc Documentation
#:description = JSDoc installation and integration into Sphinx.
#:depends = js.npm
#:
#:[target.jsdoc]
#:description = Provide jsdoc executable on PATH.

##############################################################################
# jsdoc
##############################################################################

JSDOC_PATH=$(shell pwd)/$(NPM_PREFIX)/node_modules/jsdoc

JSDOC_TARGET:=$(SENTINEL_FOLDER)/jsdoc.sentinel
$(JSDOC_TARGET): $(NPM_TARGET)
@echo "Link jsdoc executable to name expected by Sphinx"
@ln -sf $(JSDOC_PATH)/jsdoc.js $(JSDOC_PATH)/jsdoc
@touch $(JSDOC_TARGET)

.PHONY: jsdoc
jsdoc: $(JSDOC_TARGET)
@export PATH=$(PATH):$(JSDOC_PATH)

# extend npm dev packages
NPM_DEV_PACKAGES+=jsdoc

# extend sphinx requirements and docs targets
DOCS_REQUIREMENTS+=sphinx_js
DOCS_TARGETS+=jsdoc

# extend default targets
INSTALL_TARGETS+=$(JSDOC_TARGET)
2 changes: 1 addition & 1 deletion src/mxmake/topics/js/karma.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ NPM_DEV_PACKAGES+=\

.PHONY: karma
karma: $(NPM_TARGET)
@$(NPM_PREFIX)/node_modules/.bin/karma start $(KARMA_CONFIG) $(KARMA_OPTIONS)
@karma start $(KARMA_CONFIG) $(KARMA_OPTIONS)
2 changes: 2 additions & 0 deletions src/mxmake/topics/js/npm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
# npm
##############################################################################

export PATH:=$(shell pwd)/$(NPM_PREFIX)/node_modules/.bin/:$(PATH)

# case `system.dependencies` domain is included
SYSTEM_DEPENDENCIES+=npm

Expand Down
2 changes: 1 addition & 1 deletion src/mxmake/topics/js/rollup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ NPM_DEV_PACKAGES+=\

.PHONY: rollup
rollup: $(NPM_TARGET)
@$(NPM_PREFIX)/node_modules/.bin/rollup --config $(ROLLUP_CONFIG)
@rollup --config $(ROLLUP_CONFIG)
6 changes: 2 additions & 4 deletions src/mxmake/topics/js/scss.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ NPM_DEV_PACKAGES+=sass

.PHONY: scss
scss: $(NPM_TARGET)
@$(NPM_PREFIX)/node_modules/.bin/sass \
$(SCSS_OPTIONS) $(SCSS_SOURCE) $(SCSS_TARGET)
@$(NPM_PREFIX)/node_modules/.bin/sass \
$(SCSS_OPTIONS) --style compressed $(SCSS_SOURCE) $(SCSS_MIN_TARGET)
@sass $(SCSS_OPTIONS) $(SCSS_SOURCE) $(SCSS_TARGET)
@sass $(SCSS_OPTIONS) --style compressed $(SCSS_SOURCE) $(SCSS_MIN_TARGET)
2 changes: 1 addition & 1 deletion src/mxmake/topics/js/wtr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ NPM_DEV_PACKAGES+=\

.PHONY: wtr
wtr: $(NPM_TARGET)
@$(NPM_PREFIX)/node_modules/.bin/web-test-runner $(WTR_OPTIONS) --config $(WTR_CONFIG)
@web-test-runner $(WTR_OPTIONS) --config $(WTR_CONFIG)

0 comments on commit d097b27

Please sign in to comment.