Skip to content

Commit

Permalink
(chore) fix update version of LIPS in docs in build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 8, 2024
1 parent 455b4ee commit ac3b4c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define ver_date
-e "s/{{YEAR}}/${YEAR}/" $(1) || $(SED) -i -e "s/{{VER}}/DEV/g" -e "s/{{DATE}}/$(DATE)/g" $(1)
endef

ALL: Makefile package.json .$(VERSION) assets/classDiagram.svg dist/base.js dist/lips.js dist/lips.esm.js dist/lips.min.js dist/lips.esm.min.js README.md dist/std.min.scm dist/std.xcb docs/reference.json
ALL: Makefile package.json .$(VERSION) assets/classDiagram.svg dist/base.js dist/lips.js dist/lips.esm.js dist/lips.min.js dist/lips.esm.min.js README.md dist/std.min.scm dist/std.xcb docs/reference.json docs/version.json

dist/banner.js: src/banner.js src/lips.js .$(VERSION)
$(CP) src/banner.js dist/banner.js
Expand All @@ -49,6 +49,9 @@ dist/base.js: src/lips.js .$(VERSION)
$(SED) '/\/\*\*@license/,/\*\//d' < src/lips.js > dist/base.js
$(call ver_date,dist/base.js)

docs/version.json: ./docs/version.mjs .$(VERSION)
$(NODE) ./docs/version.mjs

dist/lips.js dist/lips.esm.js dist/lips.cjs: dist/banner.js dist/base.js .$(VERSION) rollup.config.js
$(ROLLUP) -c

Expand Down
8 changes: 6 additions & 2 deletions docs/version.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import fs from 'fs/promises';
import path from 'path';
import { fileURLToPath } from 'url';

fs.readFile('../package.json', 'utf8').then(json => {
const __dirname = path.dirname(fileURLToPath(import.meta.url));

fs.readFile(path.join(__dirname, '../package.json'), 'utf8').then(json => {
const { version } = JSON.parse(json);
return fs.writeFile('version.json', JSON.stringify(version));
return fs.writeFile(path.join(__dirname, 'version.json'), JSON.stringify(version));
});
5 changes: 4 additions & 1 deletion templates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define ver_date
-e "s/{{YEAR}}/${YEAR}/" $(1) || $(SED) -i -e "s/{{VER}}/DEV/g" -e "s/{{DATE}}/$(DATE)/g" $(1)
endef

ALL: Makefile package.json .$(VERSION) assets/classDiagram.svg dist/base.js dist/lips.js dist/lips.esm.js dist/lips.min.js dist/lips.esm.min.js README.md dist/std.min.scm dist/std.xcb docs/reference.json
ALL: Makefile package.json .$(VERSION) assets/classDiagram.svg dist/base.js dist/lips.js dist/lips.esm.js dist/lips.min.js dist/lips.esm.min.js README.md dist/std.min.scm dist/std.xcb docs/reference.json docs/version.json

dist/banner.js: src/banner.js src/lips.js .$(VERSION)
$(CP) src/banner.js dist/banner.js
Expand All @@ -49,6 +49,9 @@ dist/base.js: src/lips.js .$(VERSION)
$(SED) '/\/\*\*@license/,/\*\//d' < src/lips.js > dist/base.js
$(call ver_date,dist/base.js)

docs/version.json: ./docs/version.mjs .$(VERSION)
$(NODE) ./docs/version.mjs

dist/lips.js dist/lips.esm.js dist/lips.cjs: dist/banner.js dist/base.js .$(VERSION) rollup.config.js
$(ROLLUP) -c

Expand Down

0 comments on commit ac3b4c0

Please sign in to comment.