Browse Source

Define version only in one place

master
Futago-za Ryuu 3 years ago
parent
commit
6bc85de256
  1. 3
      package.json
  2. 3
      packages/pegjs/lib/compiler/passes/generate-js.js
  3. 2
      packages/pegjs/lib/peg.js
  4. 2
      rollup.config.js
  5. 2
      server.js
  6. 8
      yarn.lock

3
package.json

@ -32,7 +32,8 @@
"rollup-plugin-babel": "4.0.3",
"rollup-plugin-commonjs": "9.1.6",
"rollup-plugin-multi-entry": "2.0.2",
"rollup-plugin-node-resolve": "3.4.0"
"rollup-plugin-node-resolve": "3.4.0",
"rollup-plugin-json": "3.1.0"
},
"devDependencies": {
"coveralls": "3.0.2",

3
packages/pegjs/lib/compiler/passes/generate-js.js

@ -3,6 +3,7 @@
"use strict";
const util = require( "../../util" );
const VERSION = require( "../../../package.json" ).version;
// Generates parser JavaScript code.
function generateJS( ast, session, options ) {
@ -1593,7 +1594,7 @@ function generateJS( ast, session, options ) {
function generateHeaderComment() {
let comment = "// Generated by PEG.js v0.11.0-dev, https://pegjs.org/";
let comment = `// Generated by PEG.js v${ VERSION }, https://pegjs.org/`;
const header = options.header;
if ( typeof header === "string" ) {

2
packages/pegjs/lib/peg.js

@ -8,7 +8,7 @@ const util = require( "./util" );
const peg = {
// PEG.js version (uses semantic versioning).
VERSION: "0.11.0-dev",
VERSION: require( "../package.json" ).version,
GrammarError: GrammarError,
ast: ast,

2
rollup.config.js

@ -3,6 +3,7 @@
const dedent = require( "dedent" );
const babel = require( "rollup-plugin-babel" );
const commonjs = require( "rollup-plugin-commonjs" );
const json = require( "rollup-plugin-json" );
const resolve = require( "rollup-plugin-node-resolve" );
const { terser } = require( "rollup-plugin-terser" );
@ -44,6 +45,7 @@ function generate( target ) {
plugins: [
commonjs(),
babel( babelOptions ),
json( { namedExports: false } ),
resolve(),
],
};

2
server.js

@ -9,6 +9,7 @@ const ms = require( "pretty-ms" );
const rollup = require( "rollup" );
const babel = require( "rollup-plugin-babel" );
const commonjs = require( "rollup-plugin-commonjs" );
const json = require( "rollup-plugin-json" );
const multiEntry = require( "rollup-plugin-multi-entry" );
const resolve = require( "rollup-plugin-node-resolve" );
@ -121,6 +122,7 @@ babelOptions.runtimeHelpers = true;
plugins: [
multiEntry(),
commonjs(),
json( { namedExports: false } ),
babel( babelOptions ),
resolve(),
],

8
yarn.lock

@ -4292,6 +4292,12 @@ rollup-plugin-commonjs@9.1.6:
resolve "^1.5.0"
rollup-pluginutils "^2.0.1"
rollup-plugin-json@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-3.1.0.tgz#7c1daf60c46bc21021ea016bd00863561a03321b"
dependencies:
rollup-pluginutils "^2.3.1"
rollup-plugin-multi-entry@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-multi-entry/-/rollup-plugin-multi-entry-2.0.2.tgz#ab50fbabec62526706492badadd8d59f139e4d58"
@ -4314,7 +4320,7 @@ rollup-plugin-terser@2.0.2:
jest-worker "^23.2.0"
terser "^3.8.2"
rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0:
rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.1.tgz#760d185ccc237dedc12d7ae48c6bcd127b4892d0"
dependencies:

Loading…
Cancel
Save