1.0.146 • Published 9 days ago

occam-semver v1.0.146

Weekly downloads
-
License
MIT, Anti-996
Repository
github
Last release
9 days ago

Occam Semver

Occam's semantic versioning.

Contents

Introduction

Occam's package versioning is effectively taken out of the user's control with versions being enforced when packages are published. This package contains that functionality.

Installation

With npm:

npm install occam-semver

You can also clone the repository with Git...

git clone https://github.com/djalbat/occam-semver.git

...and then install the dependencies with npm from within the project's root directory:

npm install

You can also run a development server, see the section on building later on.

Example

There is a small development server that can be run from within the project's directory with the following command:

npm start

The example will then be available at the following URL:

http://localhost:8888

The source for the example can be found in the src/example.js file and corresponding src/example folder. You are encouraged to try the example whilst reading what follows. You can rebuild it on the fly with the following command:

npm run watch-debug

The development server will reload the page whenever you make changes.

One last thing to bear in mind is that this package is included by way of a relative rather than a package import. If you are importing it into your own application, however, you should use the standard package import.

Usage

Custom grammars and contexts are compared separately. The maximum of the two version number changes can be used for the version number change overall.

import { Version } from "occam-file-system";
import { updateVersion, compareContextJSON, compareCustomGrammarJSON } from "occam-semver";

const contextJSON = ... ,
      previousContextJSON = ''' ,
      contextJSONVersionNumberChange = compareContextJSON(previousContextJSON, contextJSON);

const customGrammarJSON = ... ,
      previousCustomGrammarJSON = ... ,
      customGrammarVJSONersionNumberChange = compareCustomGrammarJSON(previousCustomGrammarJSON, customGrammarJSON),
      
const versionNumberChange = Math.max(contxtJSONVersionNumberChange, customGrammarVJSONersionNumberChange);

let version;

const previousVersion = ... ;

version = previousVersion;  ///

version = Version.fromVersion(version); ///

updateVersion(version, versionNumberChange);

The updateVersion() function can be used to apply the version number change. Note that the Version class' fromVersion() static factory method is called to duplicate the previous version before making the change.

Example

The example demonstrates the underlying JSON diffing.

Building

Automation is done with npm scripts, have a look at the package.json file. The pertinent commands are:

npm run build-debug
npm run watch-debug

Contact

  • james.smith@djalbat.com
1.0.146

9 days ago

1.0.145

14 days ago

1.0.143

25 days ago

1.0.144

25 days ago

1.0.142

26 days ago

1.0.141

26 days ago

1.0.140

28 days ago

1.0.139

28 days ago

1.0.138

30 days ago

1.0.137

30 days ago

1.0.136

1 month ago

1.0.135

1 month ago

1.0.132

1 month ago

1.0.131

1 month ago

1.0.134

1 month ago

1.0.133

1 month ago

1.0.130

1 month ago

1.0.129

1 month ago

1.0.128

1 month ago

1.0.125

1 month ago

1.0.127

1 month ago

1.0.126

1 month ago

1.0.123

2 months ago

1.0.124

2 months ago

1.0.121

2 months ago

1.0.120

2 months ago

1.0.122

2 months ago

1.0.118

2 months ago

1.0.119

2 months ago

1.0.117

2 months ago

1.0.116

2 months ago

1.0.115

2 months ago

1.0.112

2 months ago

1.0.114

2 months ago

1.0.113

2 months ago

1.0.110

2 months ago

1.0.111

2 months ago

1.0.109

2 months ago

1.0.107

3 months ago

1.0.108

3 months ago

1.0.101

3 months ago

1.0.100

3 months ago

1.0.106

3 months ago

1.0.103

3 months ago

1.0.102

3 months ago

1.0.105

3 months ago

1.0.104

3 months ago

1.0.95

3 months ago

1.0.94

3 months ago

1.0.93

3 months ago

1.0.92

3 months ago

1.0.99

3 months ago

1.0.98

3 months ago

1.0.97

3 months ago

1.0.96

3 months ago

1.0.91

3 months ago

1.0.90

3 months ago

1.0.84

3 months ago

1.0.88

3 months ago

1.0.87

3 months ago

1.0.86

3 months ago

1.0.85

3 months ago

1.0.89

3 months ago

1.0.83

3 months ago

1.0.82

3 months ago

1.0.81

3 months ago

1.0.80

3 months ago

1.0.79

3 months ago

1.0.78

3 months ago

1.0.77

3 months ago

1.0.76

3 months ago

1.0.75

4 months ago

1.0.74

4 months ago

1.0.73

4 months ago

1.0.71

4 months ago

1.0.70

4 months ago

1.0.69

4 months ago

1.0.65

4 months ago

1.0.68

4 months ago

1.0.67

4 months ago

1.0.64

4 months ago

1.0.63

4 months ago

1.0.62

4 months ago

1.0.61

4 months ago

1.0.60

4 months ago

1.0.55

4 months ago

1.0.59

4 months ago

1.0.58

4 months ago

1.0.57

4 months ago

1.0.56

4 months ago

1.0.48

4 months ago

1.0.47

4 months ago

1.0.46

4 months ago

1.0.45

4 months ago

1.0.49

4 months ago

1.0.51

4 months ago

1.0.50

4 months ago

1.0.54

4 months ago

1.0.53

4 months ago

1.0.52

4 months ago

1.0.44

5 months ago

1.0.39

5 months ago

1.0.40

5 months ago

1.0.43

5 months ago

1.0.42

5 months ago

1.0.41

5 months ago

1.0.38

6 months ago

1.0.33

8 months ago

1.0.32

8 months ago

1.0.31

8 months ago

1.0.37

6 months ago

1.0.36

7 months ago

1.0.35

7 months ago

1.0.34

7 months ago

1.0.26

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.23

8 months ago

1.0.29

8 months ago

1.0.28

8 months ago

1.0.27

8 months ago

1.0.30

8 months ago

1.0.22

8 months ago

1.0.21

8 months ago

1.0.20

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.16

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

11 months ago

1.0.7

11 months ago

1.0.5

11 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago