mirror of https://git.sr.ht/~statianzo/pmrpc
Switched to node-tap esbuild for bundling pnpm for packaging sr.ht for source codemaster
parent
086f5862cc
commit
933d7bb063
@ -0,0 +1,20 @@
|
||||
image: archlinux
|
||||
packages:
|
||||
- nodejs-n
|
||||
- pnpm
|
||||
sources:
|
||||
- https://git.sr.ht/~statianzo/pmrpc
|
||||
secrets:
|
||||
- 01f84277-3abe-4ed1-9d0d-d66b49bfcfe7
|
||||
- 5756e542-1a3e-4c27-ac4c-4820cff2b965
|
||||
- 576364b7-4764-4794-a536-1a3357fb222b
|
||||
environment:
|
||||
CI: "true"
|
||||
tasks:
|
||||
- setup: |
|
||||
sudo n stable
|
||||
cd pmrpc
|
||||
pnpm i
|
||||
- validate: |
|
||||
cd pmrpc
|
||||
pnpm test
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
||||
const typescript = require('rollup-plugin-typescript2');
|
||||
const pkg = require('./package.json');
|
||||
|
||||
export default {
|
||||
input: 'src/index.ts',
|
||||
output: [
|
||||
{file: pkg.main, format: 'cjs'},
|
||||
{file: pkg.module, format: 'es'},
|
||||
{file: 'lib/index.umd.js', format: 'umd', name: 'JsonRpc'}
|
||||
],
|
||||
plugins: [
|
||||
typescript({
|
||||
tsConfigOverride: {
|
||||
compilerOptions: {
|
||||
declaration: true,
|
||||
allowJs: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
@ -0,0 +1,16 @@
|
||||
/*!istanbul ignore file */
|
||||
const { resolve } = require("path");
|
||||
const { build } = require("esbuild");
|
||||
|
||||
const buildIndex = (config) =>
|
||||
build({
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
entryPoints: [resolve(__dirname, "../src/index.ts")],
|
||||
target: ["es2017"],
|
||||
globalName: "JsonRpc",
|
||||
...config,
|
||||
});
|
||||
|
||||
|
||||
module.exports = buildIndex;
|
@ -0,0 +1,25 @@
|
||||
import buildIndex from './buildIndex.js';
|
||||
import {createRequire} from 'module';
|
||||
import { resolve } from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
const require = createRequire(import.meta.url)
|
||||
const pkg = require("../package.json");
|
||||
const __dirname = resolve(fileURLToPath(import.meta.url), '..');
|
||||
|
||||
const run = () =>
|
||||
Promise.all([
|
||||
buildIndex({
|
||||
format: "cjs",
|
||||
outfile: resolve(__dirname, "..", pkg.main),
|
||||
}),
|
||||
buildIndex({
|
||||
format: "esm",
|
||||
outfile: resolve(__dirname, "..", pkg.module),
|
||||
}),
|
||||
buildIndex({
|
||||
format: "iife",
|
||||
outfile: resolve(__dirname, "..", pkg.unpkg),
|
||||
}),
|
||||
]);
|
||||
|
||||
run();
|
@ -1,11 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"strict": true,
|
||||
"strictFunctionTypes": false,
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "Node",
|
||||
"lib": ["es5", "es2015", "es2016", "dom"]
|
||||
}
|
||||
"skipLibCheck": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"outDir": "lib",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src"],
|
||||
"exclude": ["**/*.spec.ts", "**/*.test.ts"]
|
||||
}
|
||||
|
Loading…
Reference in new issue