Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dist files in dist/ folder, publishing instructions #32

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading