Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compose-regexp

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compose-regexp - npm Package Compare versions

Comparing version 0.6.13 to 0.6.14

4

package.json
{
"name": "compose-regexp",
"version": "0.6.13",
"version": "0.6.14",
"description": "A set of functions to build and compose complex regular expressions",

@@ -45,3 +45,3 @@ "type": "module",

"devDependencies": {
"compose-regexp": "0.6.12",
"compose-regexp": "0.6.13",
"gosub": "1.1.0",

@@ -48,0 +48,0 @@ "ospec": "^4.1.1",

@@ -21,6 +21,3 @@ import fs from "fs"

const README = fs.readFileSync('./README.md', {encoding: 'utf-8'}).toString()
// console.log(README)
// console.log(titles.exec(README))
// /[^-\p{ID_Continue}]/gu is meant to strip Emoji, it may be too broad, or too narrow a filter.

@@ -27,0 +24,0 @@ // We're dealing with ASCII in compose-regexp so this is overkill for us... What we have seems

@@ -1,2 +0,3 @@

import fs from 'fs'
import {writeFileSync} from 'fs'
import { command } from './utils.js'

@@ -7,2 +8,3 @@ import pkg from '../package.json' assert { type: 'json' }

const npm = command('npm')
const sleep = t => new Promise(f => setTimeout(f, t * 1000))

@@ -18,6 +20,9 @@ const {version} = pkg

fs.writeFileSync('./package.json', JSON.stringify(pkg, null, '\t'), 'utf-8')
writeFileSync('./package.json', JSON.stringify(pkg, null, '\t'), 'utf-8')
await npm('cache', 'clean', '--force')
// give the npm servers some time
await sleep(1)
await npm('i')

@@ -24,0 +29,0 @@

@@ -5,2 +5,3 @@ import { command, readFromCmd } from './utils.js'

const git = command('git')
const npm = command('npm')
const readGit = readFromCmd('git')

@@ -11,34 +12,67 @@ const readNpm = readFromCmd('npm')

const messages = []
const errors = []
console.log("Checking if we're alright...")
try { await readNpm('run', 'test')} catch({stderr, stdout}) {
messages.push("/!\\ There was a problem with the test suite", stdout, stderr)
}
await Promise.all([
(async () => {
await Promise.all([
(async () => {
try {
// `git status --porecelain` is empty when the tree is clean
const {stdout: status} = await readGit('status', '--porcelain')
if (status.trim() !== '') errors.push("/!\\ The git working tree is not clean")
const {stdout: branch} = await readGit('branch', '--show-current')
if (branch !== "main\n") {
errors.push(`/!\\ We are on branch ${branch.trim()}, we publish from main`)
// `git status --porecelain` is empty when the tree is clean
const {stdout: gitOutput} = await readGit('status', '--porcelain')
if (gitOutput.trim() !== '') messages.push("/!\\ The git working tree is not clean")
}
} catch({stderr, stdout}) {
errors.push("/!\\ git status or git branch error:", stdout, stderr)
}
})(),
(async () => {
try {
await readNpm('run', 'test')
} catch({stderr, stdout}) {
errors.push("/!\\ There was a problem with the test suite", stdout, stderr)
}
})(),
])
try{
// won't run if the git status or branch are wrong
// it must run after the tests too, because the latter
// build the regexps
if (errors.length === 0) await npm('run', 'build')
const {stdout: branch} = await readGit('branch', '--show-current')
if (branch !== "main\n") messages.push(`/!\\ We are on branch ${branch.trim()}, we publish from main`)
} catch({stderr, stdout}) {
errors.push("/!\\ npm run build error:", stdout, stderr)
}
})(),
(async () => {
try {
const {stdout} = await readNpm("view", "compose-regexp", "version")
if(stdout.trim() === version) errors.push("/!\\ You didn't bump the version number")
} catch({stderr, stdout}) {
errors.push("/!\\ npm view composer-regexp version", stdout, stderr, ">>>>")
}
})(),
])
const {stdout: remoteVersion} = await readNpm("view", "compose-regexp", "version")
if(remoteVersion.trim() === version) messages.push("/!\\ You didn't bump the version number")
try {await readNpm('run', 'build')} catch({stderr}) {
messages.push("/!\\ There was a problem building the lib", stderr)
if (errors.length !== 0) {
console.error('\n' + errors.join('\n\n') + '\n')
process.exit(1)
}
if (messages.length !== 0) {
console.error('\n' + messages.join('\n\n') + '\n')
process.exit(1)
}
console.log("All good!")
const {stdout: changes} = await readGit('status', '--porcelain')
if (changes !== '') {
await git('commit', '-am', `"build artefacts"`)
await git('commit', '-am', `"build artefacts"`)
}

@@ -1,3 +0,2 @@

import chp from 'child_process'
import { stringify } from 'querystring'
import {spawn} from 'child_process'

@@ -13,3 +12,6 @@ function childPromise(child) {

const reject = e => _reject(Object.assign(new Error("Problem in child process"), e))
const reject = e => _reject(Object.assign(new Error("Problem in child process"), e, {
stderr: err.join(''),
stdout: out.join(''),
}))

@@ -26,3 +28,3 @@ const handler = (code, signal) => (code === 0 ? fulfill : reject)({

child.on("error", err => {
reject({error: err.stack})
reject({error: err})
if (child.exitCode == null) child.kill('SIGTERM')

@@ -42,7 +44,7 @@ setTimeout(()=>{

// {
// code? // exit code
// signal? // signal recieved
// code? // exit code, if any
// signal? // signal recieved, if any
// stdout: string,
// stderr: string,
// error?: // the stack of the error on rejection
// error?: the error caught, if any
// }

@@ -53,3 +55,3 @@ // On rejection, the Error is augmented with the same fields

console.log('$ ' + [cmd, ...params].join(' '))
return childPromise(chp.spawn(cmd, params, {
return childPromise(spawn(cmd, params, {
stdio: 'inherit',

@@ -63,3 +65,3 @@ env: process.env,

export const readFromCmd = (cmd, options) => (...params) => childPromise(chp.spawn(cmd, params, {
export const readFromCmd = (cmd, options) => (...params) => childPromise(spawn(cmd, params, {
env: process.env,

@@ -66,0 +68,0 @@ cwd: process.cwd(),

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc