Skip to content
Snippets Groups Projects
Commit c910642f authored by Philipp Stadler's avatar Philipp Stadler
Browse files

chore: inherit build prefix in anki transformer build

parent 7d3d4e6e
Branches
No related tags found
1 merge request!135Feat/external build
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
include \ include \
make/defs.mk \ make/defs.mk \
make/transformer-anki-tags.mk \
make/src-common.mk \ make/src-common.mk \
make/pipenv.mk \ make/pipenv.mk \
make/node.mk \ make/node.mk \
......
...@@ -6,7 +6,7 @@ K := $(foreach exec,$(REQUIRED_ON_PATH), \ ...@@ -6,7 +6,7 @@ K := $(foreach exec,$(REQUIRED_ON_PATH), \
# root like in CI, otherwise all generated files are in artifacts/ # root like in CI, otherwise all generated files are in artifacts/
# note that using . and ./ behave the same as the empty string and the filename # note that using . and ./ behave the same as the empty string and the filename
# targets will not start with . # targets will not start with .
BUILD_PREFIX ?= artifacts BUILD_PREFIX ?= $(PWD)/artifacts
BUILD_PREFIX := $(and $(filter-out . ./,$(BUILD_PREFIX)),$(BUILD_PREFIX)/) BUILD_PREFIX := $(and $(filter-out . ./,$(BUILD_PREFIX)),$(BUILD_PREFIX)/)
# some build subprocesses need this, e.g. the JS proxy for parcel needs to # some build subprocesses need this, e.g. the JS proxy for parcel needs to
# know where to load the chardata from # know where to load the chardata from
......
TEMPLATE_SPEC_FILENAME := .template-spec.yaml TEMPLATE_SPEC_FILENAME := .template-spec.yaml
PARCEL_DEV_ENTRY_HTMLS := src/templates/index.html PARCEL_DEV_ENTRY_HTMLS := src/templates/index.html
PARCEL_PLUGIN_SRC_DIR := transformer-anki-tags
PARCEL_DEV_CONFIG := parcel-dev-config.json PARCEL_DEV_CONFIG := parcel-dev-config.json
TEMPLATE_FILES := $(shell find src -type f '(' -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.ts' -o -name $(TEMPLATE_SPEC_FILENAME) ')') TEMPLATE_FILES := $(shell find src -type f '(' -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.ts' -o -name $(TEMPLATE_SPEC_FILENAME) ')')
...@@ -27,7 +26,6 @@ html: $(BUILT_TEMPLATE_HTMLS) $(BUILT_TEMPLATE_SPECS) ...@@ -27,7 +26,6 @@ html: $(BUILT_TEMPLATE_HTMLS) $(BUILT_TEMPLATE_SPECS)
.PHONY: dev .PHONY: dev
dev: $(PARCEL) $(HANZI_DATA) $(PARCEL_PLUGIN_INSTALLED_DIR) dev: $(PARCEL) $(HANZI_DATA) $(PARCEL_PLUGIN_INSTALLED_DIR)
cd $(PARCEL_PLUGIN_SRC_DIR) && $(MAKE)
$(PARCEL) serve $(PARCEL_DEV_ENTRY_HTMLS) --config=./$(PARCEL_DEV_CONFIG) $(PARCEL) serve $(PARCEL_DEV_ENTRY_HTMLS) --config=./$(PARCEL_DEV_CONFIG)
.PHONY: test-html .PHONY: test-html
......
TSC := node_modules/.bin/tsc TSC := node_modules/.bin/tsc
BUILD_PREFIX := $(BUILD_PREFIX)transformer-anki-tags/
index.cjs: index.ts $(TSC) tsconfig.json $(BUILD_PREFIX)index.cjs: index.ts $(TSC) tsconfig.json $(BUILD_PREFIX)package.json
$(TSC) --project . $(TSC) --project .
mv index.js index.cjs @$(and $(BUILD_PREFIX),mkdir -p $(BUILD_PREFIX))
mv index.js $(BUILD_PREFIX)index.cjs
$(BUILD_PREFIX)package.json: package.json
@$(and $(BUILD_PREFIX),mkdir -p $(BUILD_PREFIX))
cp $< $@
$(TSC): package.json yarn.lock $(TSC): package.json yarn.lock
yarn install yarn install
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
"name": "@parcel/transformer-anki-tags", "name": "@parcel/transformer-anki-tags",
"version": "0.0.1", "version": "0.0.1",
"license": "MIT", "license": "MIT",
"dependencies": {
"@parcel/plugin": "^2.11.0"
},
"devDependencies": { "devDependencies": {
"@parcel/plugin": "^2.11.0",
"typescript": "*" "typescript": "*"
}, },
"main": "index.cjs", "main": "index.cjs",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment