mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
protobuf-demo: Add package
This commit is contained in:
parent
bfcc6dd323
commit
6c78efbcb7
1
packages/protobuf-demo/.eslintignore
Symbolic link
1
packages/protobuf-demo/.eslintignore
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../.eslintignore
|
4
packages/protobuf-demo/.gitignore
vendored
Normal file
4
packages/protobuf-demo/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
build/
|
||||||
|
dist/
|
||||||
|
docs/
|
||||||
|
proto/
|
10
packages/protobuf-demo/README.md
Normal file
10
packages/protobuf-demo/README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# @cosmjs/protobuf-demo
|
||||||
|
|
||||||
|
Demo package for protobufs with Cosmos SDK.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This package is part of the cosmjs repository, licensed under the Apache
|
||||||
|
License 2.0 (see
|
||||||
|
[NOTICE](https://github.com/CosmWasm/cosmjs/blob/master/NOTICE) and
|
||||||
|
[LICENSE](https://github.com/CosmWasm/cosmjs/blob/master/LICENSE)).
|
26
packages/protobuf-demo/jasmine-testrunner.js
Executable file
26
packages/protobuf-demo/jasmine-testrunner.js
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
require("source-map-support").install();
|
||||||
|
const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json");
|
||||||
|
|
||||||
|
// setup Jasmine
|
||||||
|
const Jasmine = require("jasmine");
|
||||||
|
const jasmine = new Jasmine();
|
||||||
|
jasmine.loadConfig({
|
||||||
|
spec_dir: "build",
|
||||||
|
spec_files: ["**/*.spec.js"],
|
||||||
|
helpers: [],
|
||||||
|
random: false,
|
||||||
|
seed: null,
|
||||||
|
stopSpecOnExpectationFailure: false,
|
||||||
|
});
|
||||||
|
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 15 * 1000;
|
||||||
|
|
||||||
|
// setup reporter
|
||||||
|
const { SpecReporter } = require("jasmine-spec-reporter");
|
||||||
|
const reporter = new SpecReporter({ ...defaultSpecReporterConfig });
|
||||||
|
|
||||||
|
// initialize and execute
|
||||||
|
jasmine.env.clearReporters();
|
||||||
|
jasmine.addReporter(reporter);
|
||||||
|
jasmine.execute();
|
47
packages/protobuf-demo/karma.conf.js
Normal file
47
packages/protobuf-demo/karma.conf.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||||
|
basePath: ".",
|
||||||
|
|
||||||
|
// frameworks to use
|
||||||
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||||
|
frameworks: ["jasmine"],
|
||||||
|
|
||||||
|
// list of files / patterns to load in the browser
|
||||||
|
files: ["dist/web/tests.js"],
|
||||||
|
|
||||||
|
client: {
|
||||||
|
jasmine: {
|
||||||
|
random: false,
|
||||||
|
timeoutInterval: 15000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// test results reporter to use
|
||||||
|
// possible values: 'dots', 'progress'
|
||||||
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||||
|
reporters: ["progress", "kjhtml"],
|
||||||
|
|
||||||
|
// web server port
|
||||||
|
port: 9876,
|
||||||
|
|
||||||
|
// enable / disable colors in the output (reporters and logs)
|
||||||
|
colors: true,
|
||||||
|
|
||||||
|
// level of logging
|
||||||
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
|
||||||
|
// enable / disable watching file and executing tests whenever any file changes
|
||||||
|
autoWatch: false,
|
||||||
|
|
||||||
|
// start these browsers
|
||||||
|
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||||
|
browsers: ["Firefox"],
|
||||||
|
|
||||||
|
browserNoActivityTimeout: 90000,
|
||||||
|
|
||||||
|
// Keep brower open for debugging. This is overridden by yarn scripts
|
||||||
|
singleRun: false,
|
||||||
|
});
|
||||||
|
};
|
1
packages/protobuf-demo/nonces/README.txt
Normal file
1
packages/protobuf-demo/nonces/README.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Directory used to trigger lerna package updates for all packages
|
36
packages/protobuf-demo/package.json
Normal file
36
packages/protobuf-demo/package.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"name": "@cosmjs/protobuf-demo",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.20.0",
|
||||||
|
"description": "Utilities for Cosmos SDK 0.38",
|
||||||
|
"author": "Ethan Frey <ethanfrey@users.noreply.github.com>",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"main": "build/index.js",
|
||||||
|
"types": "types/index.d.ts",
|
||||||
|
"files": [
|
||||||
|
"build/",
|
||||||
|
"types/",
|
||||||
|
"*.md",
|
||||||
|
"!*.spec.*",
|
||||||
|
"!**/testdata/"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/CosmWasm/cosmjs/tree/master/packages/sdk38"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"docs": "shx rm -rf docs && typedoc --options typedoc.js",
|
||||||
|
"format": "prettier --write --loglevel warn \"./src/**/*.ts\"",
|
||||||
|
"lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"",
|
||||||
|
"lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix",
|
||||||
|
"move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts",
|
||||||
|
"format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"",
|
||||||
|
"build": "shx rm -rf ./build && tsc && yarn move-types && yarn format-types",
|
||||||
|
"build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build",
|
||||||
|
"test-node": "node jasmine-testrunner.js",
|
||||||
|
"test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox",
|
||||||
|
"test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless",
|
||||||
|
"test": "yarn build-or-skip && yarn test-node",
|
||||||
|
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
|
||||||
|
}
|
||||||
|
}
|
12
packages/protobuf-demo/tsconfig.json
Normal file
12
packages/protobuf-demo/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"outDir": "build",
|
||||||
|
"declarationDir": "build/types",
|
||||||
|
"rootDir": "src"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*"
|
||||||
|
]
|
||||||
|
}
|
14
packages/protobuf-demo/typedoc.js
Normal file
14
packages/protobuf-demo/typedoc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
const packageJson = require("./package.json");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
src: ["./src"],
|
||||||
|
out: "docs",
|
||||||
|
exclude: "**/*.spec.ts",
|
||||||
|
target: "es6",
|
||||||
|
name: `${packageJson.name} Documentation`,
|
||||||
|
readme: "README.md",
|
||||||
|
mode: "file",
|
||||||
|
excludeExternals: true,
|
||||||
|
excludeNotExported: true,
|
||||||
|
excludePrivate: true,
|
||||||
|
};
|
19
packages/protobuf-demo/webpack.web.config.js
Normal file
19
packages/protobuf-demo/webpack.web.config.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const glob = require("glob");
|
||||||
|
const path = require("path");
|
||||||
|
const webpack = require("webpack");
|
||||||
|
|
||||||
|
const target = "web";
|
||||||
|
const distdir = path.join(__dirname, "dist", "web");
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
// bundle used for Karma tests
|
||||||
|
target: target,
|
||||||
|
entry: glob.sync("./build/**/*.spec.js"),
|
||||||
|
output: {
|
||||||
|
path: distdir,
|
||||||
|
filename: "tests.js",
|
||||||
|
},
|
||||||
|
plugins: [new webpack.EnvironmentPlugin(["WASMD_ENABLED"])],
|
||||||
|
},
|
||||||
|
];
|
Loading…
x
Reference in New Issue
Block a user