Prepare Decodal packages for release
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import { copyFileSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
const packageDir = resolve(import.meta.dirname, '../../../packages/decodal-wasm');
|
||||
|
||||
copyFileSync(resolve(packageDir, '../../LICENSE-MIT'), resolve(packageDir, 'LICENSE-MIT'));
|
||||
copyFileSync(resolve(packageDir, '../../LICENSE-APACHE'), resolve(packageDir, 'LICENSE-APACHE'));
|
||||
|
||||
const declarationPath = resolve(packageDir, 'decodal_wasm.d.ts');
|
||||
let declarations = readFileSync(declarationPath, 'utf8');
|
||||
const hostTypes = `
|
||||
@@ -77,7 +80,23 @@ writeFileSync(
|
||||
|
||||
const packageJsonPath = resolve(packageDir, 'package.json');
|
||||
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
||||
packageJson.version = '0.1.3';
|
||||
packageJson.version = '0.1.4';
|
||||
packageJson.files = [
|
||||
'README.md',
|
||||
'LICENSE-MIT',
|
||||
'LICENSE-APACHE',
|
||||
'decodal_wasm_bg.wasm',
|
||||
'decodal_wasm.js',
|
||||
'decodal_wasm.d.ts',
|
||||
];
|
||||
packageJson.exports = {
|
||||
'.': {
|
||||
types: './decodal_wasm.d.ts',
|
||||
import: './decodal_wasm.js',
|
||||
},
|
||||
'./decodal_wasm_bg.wasm': './decodal_wasm_bg.wasm',
|
||||
'./package.json': './package.json',
|
||||
};
|
||||
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
||||
|
||||
writeFileSync(
|
||||
@@ -159,12 +178,14 @@ writeFileSync(
|
||||
JSON.stringify(
|
||||
{
|
||||
name: '@hare/decodal-wasm',
|
||||
version: '0.1.3',
|
||||
license: 'MIT',
|
||||
version: '0.1.4',
|
||||
license: 'MIT OR Apache-2.0',
|
||||
exports: './mod.ts',
|
||||
publish: {
|
||||
include: [
|
||||
'README.md',
|
||||
'LICENSE-MIT',
|
||||
'LICENSE-APACHE',
|
||||
'mod.ts',
|
||||
'decodal_wasm.js',
|
||||
'decodal_wasm.d.ts',
|
||||
|
||||
Reference in New Issue
Block a user