add lisp packages

This commit is contained in:
2020-12-05 21:29:49 +01:00
parent 85e20365ae
commit a6e2395755
7272 changed files with 1363243 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
'use strict'
const os = require('os');
const path = require('path');
const spawn = require('child_process').spawn;
const gypArgs = ['rebuild'];
if (process.env.NODE_PTY_DEBUG) {
gypArgs.push('--debug');
}
const gypProcess = spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', gypArgs, {
cwd: path.join(__dirname, '..'),
stdio: 'inherit'
});
gypProcess.on('exit', function (code) {
process.exit(code);
});

View File

@@ -0,0 +1,41 @@
var fs = require('fs');
var path = require('path');
var RELEASE_DIR = path.join(__dirname, '..', 'build', 'Release');
var BUILD_FILES = [
path.join(RELEASE_DIR, 'conpty.node'),
path.join(RELEASE_DIR, 'conpty.pdb'),
path.join(RELEASE_DIR, 'conpty_console_list.node'),
path.join(RELEASE_DIR, 'conpty_console_list.pdb'),
path.join(RELEASE_DIR, 'pty.node'),
path.join(RELEASE_DIR, 'pty.pdb'),
path.join(RELEASE_DIR, 'winpty-agent.exe'),
path.join(RELEASE_DIR, 'winpty-agent.pdb'),
path.join(RELEASE_DIR, 'winpty.dll'),
path.join(RELEASE_DIR, 'winpty.pdb')
];
cleanFolderRecursive = function(folder) {
var files = [];
if( fs.existsSync(folder) ) {
files = fs.readdirSync(folder);
files.forEach(function(file,index) {
var curPath = path.join(folder, file);
if(fs.lstatSync(curPath).isDirectory()) { // recurse
cleanFolderRecursive(curPath);
fs.rmdirSync(curPath);
} else if (BUILD_FILES.indexOf(curPath) < 0){ // delete file
fs.unlinkSync(curPath);
}
});
}
};
try {
cleanFolderRecursive(RELEASE_DIR);
} catch(e) {
console.log(e);
//process.exit(1);
} finally {
process.exit(0);
}

View File

@@ -0,0 +1,62 @@
/**
* Copyright (c) 2019, Microsoft Corporation (MIT License).
*/
const cp = require('child_process');
const fs = require('fs');
const path = require('path');
const packageJson = require('../package.json');
// Setup auth
fs.writeFileSync(`${process.env['HOME']}/.npmrc`, `//registry.npmjs.org/:_authToken=${process.env['NPM_AUTH_TOKEN']}`);
// Determine if this is a stable or beta release
const publishedVersions = getPublishedVersions();
const isStableRelease = publishedVersions.indexOf(packageJson.version) === -1;
// Get the next version
let nextVersion = isStableRelease ? packageJson.version : getNextBetaVersion();
console.log(`Publishing version: ${nextVersion}`);
// Set the version in package.json
const packageJsonFile = path.resolve(__dirname, '..', 'package.json');
packageJson.version = nextVersion;
fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
// Publish
const args = ['publish'];
if (!isStableRelease) {
args.push('--tag', 'beta');
}
const result = cp.spawn('npm', args, { stdio: 'inherit' });
result.on('exit', code => process.exit(code));
function getNextBetaVersion() {
if (!/^[0-9]+\.[0-9]+\.[0-9]+$/.exec(packageJson.version)) {
console.error('The package.json version must be of the form x.y.z');
process.exit(1);
}
const tag = 'beta';
const stableVersion = packageJson.version.split('.');
const nextStableVersion = `${stableVersion[0]}.${parseInt(stableVersion[1]) + 1}.0`;
const publishedVersions = getPublishedVersions(nextStableVersion, tag);
if (publishedVersions.length === 0) {
return `${nextStableVersion}-${tag}1`;
}
const latestPublishedVersion = publishedVersions.sort((a, b) => {
const aVersion = parseInt(a.substr(a.search(/[0-9]+$/)));
const bVersion = parseInt(b.substr(b.search(/[0-9]+$/)));
return aVersion > bVersion ? -1 : 1;
})[0];
const latestTagVersion = parseInt(latestPublishedVersion.substr(latestPublishedVersion.search(/[0-9]+$/)), 10);
return `${nextStableVersion}-${tag}${latestTagVersion + 1}`;
}
function getPublishedVersions(version, tag) {
const versionsProcess = cp.spawnSync('npm', ['view', packageJson.name, 'versions', '--json']);
const versionsJson = JSON.parse(versionsProcess.stdout);
if (tag) {
return versionsJson.filter(v => !v.search(new RegExp(`${version}-${tag}[0-9]+`)));
}
return versionsJson;
}