Skip to content

Commit

Permalink
Merge pull request #32 from proj4js/dist
Browse files Browse the repository at this point in the history
Dist files in dist/ folder, publishing instructions
  • Loading branch information
ahocevar authored Oct 10, 2024
2 parents 7d5c656 + 3a993e5 commit dde7c45
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 491 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
wkt.build.js
dist

18 changes: 18 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Publishing

Make sure you have the latest from the main branch:

git pull origin main

Use `npm version` to update the version number in the `package.json`.

npm version {patch|minor|major} --no-git-tag-version

Then run the publish script

./publish.sh

afterwards don't forget to update the versions to be a prerelease of the next version, so if you just published 1.1.1 then:

npm version 1.1.2-dev
git push --follow-tags
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wkt-parser",
"version": "1.3.3",
"description": "wkt-parser ===",
"main": "wkt.build.js",
"main": "dist/wkt.cjs",
"module": "index.js",
"scripts": {
"test": "node -r esm test.js",
Expand Down
21 changes: 21 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# get current version
VERSION=$(node -e "console.log(require('./package.json').version)")

# Build
git checkout -b build
npm run build
git add dist -f
git commit -m "build $VERSION"

# Tag and push
git tag -f v$VERSION -m "$VERSION"
git push --tags git@github.com:proj4js/wkt-parser.git $VERSION

# Publish
npm publish

# Cleanup
git checkout main
git branch -D build
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
input: 'index.js',
output: {
file: 'wkt.build.js',
file: 'dist/wkt.cjs',
format: 'cjs'
}
};
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var test = require('tape');
import compare from 'js-struct-compare';
var wktParser = require('./wkt.build.js');
var wktParser = require('./dist/wkt.cjs');
var fixtures = require('./test-fixtures.json');

fixtures.forEach((item, i)=>{
Expand Down
Loading

0 comments on commit dde7c45

Please sign in to comment.