@shipload/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 4
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
package/.eslintrc ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "root": true,
3
+ "ignorePatterns": ["lib/*", "tests/*", "node_modules/**"],
4
+ "extends": [
5
+ "eslint:recommended",
6
+ "plugin:@typescript-eslint/eslint-recommended",
7
+ "plugin:@typescript-eslint/recommended",
8
+ "plugin:prettier/recommended"
9
+ ],
10
+ "rules": {
11
+ "prettier/prettier": "warn",
12
+ "no-console": "warn",
13
+ "sort-imports": [
14
+ "warn",
15
+ {
16
+ "ignoreCase": true,
17
+ "ignoreDeclarationSort": true
18
+ }
19
+ ],
20
+ "@typescript-eslint/no-empty-interface": "off", // TODO: This should be removed before PR #1
21
+ "@typescript-eslint/explicit-module-boundary-types": "off",
22
+ "@typescript-eslint/no-explicit-any": "off",
23
+ "@typescript-eslint/no-namespace": "off",
24
+ "@typescript-eslint/no-non-null-assertion": "off",
25
+ "@typescript-eslint/no-empty-function": "warn",
26
+ "no-inner-declarations": "off"
27
+ }
28
+ }
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ arrowParens: "always"
2
+ bracketSpacing: false
3
+ endOfLine: "lf"
4
+ printWidth: 100
5
+ semi: false
6
+ singleQuote: true
7
+ tabWidth: 4
8
+ trailingComma: "es5"
package/Makefile ADDED
@@ -0,0 +1,74 @@
1
+ SHELL := /bin/bash
2
+ SRC_FILES := $(shell find src -name '*.ts')
3
+ TEST_FILES := $(shell find test/tests -name '*.ts')
4
+ BIN := ./node_modules/.bin
5
+ MOCHA_OPTS := -u tdd -r ts-node/register -r tsconfig-paths/register --extension ts
6
+ NYC_OPTS := --temp-dir build/nyc_output --report-dir build/coverage
7
+
8
+ lib: ${SRC_FILES} package.json tsconfig.json node_modules rollup.config.js
9
+ @${BIN}/rollup -c && touch lib
10
+
11
+ .PHONY: test
12
+ test: node_modules
13
+ @TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
14
+ ${BIN}/mocha ${MOCHA_OPTS} ${TEST_FILES} --no-timeout --grep '$(grep)'
15
+
16
+ test/watch: node_modules
17
+ @TS_NODE_PROJECT='./test/tsconfig.json' \
18
+ ${BIN}/mocha --watch ${MOCHA_OPTS} ${TEST_FILES} --no-timeout --grep '$(grep)'
19
+
20
+ build/coverage: ${SRC_FILES} ${TEST_FILES} node_modules
21
+ @TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
22
+ ${BIN}/nyc ${NYC_OPTS} --reporter=html \
23
+ ${BIN}/mocha ${MOCHA_OPTS} -R nyan ${TEST_FILES}
24
+
25
+ .PHONY: coverage
26
+ coverage: build/coverage
27
+ @open build/coverage/index.html
28
+
29
+ .PHONY: ci-test
30
+ ci-test: node_modules
31
+ @TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
32
+ ${BIN}/nyc ${NYC_OPTS} --reporter=text \
33
+ ${BIN}/mocha ${MOCHA_OPTS} -R list ${TEST_FILES}
34
+
35
+ .PHONY: check
36
+ check: node_modules
37
+ @${BIN}/eslint src test --ext .ts --max-warnings 0 --format unix && echo "Ok"
38
+
39
+ .PHONY: format
40
+ format: node_modules
41
+ @${BIN}/eslint src --ext .ts --fix
42
+
43
+ .PHONY: docs
44
+ docs: build/docs
45
+ @open build/docs/index.html
46
+
47
+ build/docs: $(SRC_FILES) node_modules
48
+ @${BIN}/typedoc --out build/docs \
49
+ --excludeInternal --excludePrivate --excludeProtected \
50
+ --includeVersion --hideGenerator --readme none \
51
+ src/index.ts
52
+
53
+ build/pages: build/coverage build/docs
54
+ @mkdir -p build/pages
55
+ @cp -r build/docs/* build/pages/
56
+ @cp -r build/coverage build/pages/coverage
57
+
58
+ .PHONY: deploy-pages
59
+ deploy-pages: | clean lib build/pages node_modules
60
+ @${BIN}/gh-pages -d build/pages
61
+
62
+ build/browser.html: $(SRC_FILES) $(TEST_FILES) test/rollup.config.js node_modules
63
+ @${BIN}/rollup -c test/rollup.config.js
64
+
65
+ node_modules:
66
+ yarn install --non-interactive --frozen-lockfile --ignore-scripts
67
+
68
+ .PHONY: clean
69
+ clean:
70
+ rm -rf lib/ build/ build/browser.html
71
+
72
+ .PHONY: distclean
73
+ distclean: clean
74
+ rm -rf node_modules/
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # SDK
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ console.log('Hello!');
4
+ //# sourceMappingURL=shipload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipload.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;;"}
@@ -0,0 +1,2 @@
1
+ console.log('Hello!');
2
+ //# sourceMappingURL=shipload.m.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipload.m.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@shipload/sdk",
3
+ "module": "lib/shipload.m.js",
4
+ "type": "module",
5
+ "main": "lib/shipload.js",
6
+ "types": "lib/shipload.d.ts",
7
+ "unpkg": "lib/shipload.bundle.js",
8
+ "devDependencies": {
9
+ "@rollup/plugin-typescript": "^11.1.5",
10
+ "bun-types": "latest",
11
+ "rollup": "^4.0.2",
12
+ "rollup-plugin-cleanup": "^3.2.1",
13
+ "rollup-plugin-dts": "^6.1.0",
14
+ "tslib": "^2.6.2",
15
+ "typescript": "^5.2.2"
16
+ },
17
+ "peerDependencies": {
18
+ "typescript": "^5.0.0"
19
+ },
20
+ "dependencies": {},
21
+ "version": "0.0.1"
22
+ }
@@ -0,0 +1,36 @@
1
+ import dts from 'rollup-plugin-dts'
2
+ import typescript from '@rollup/plugin-typescript'
3
+ import cleanup from 'rollup-plugin-cleanup'
4
+ import pkg from './package.json' assert {type: 'json'}
5
+
6
+ const external = Object.keys(pkg.dependencies)
7
+
8
+ /** @type {import('rollup').RollupOptions} */
9
+ export default [
10
+ {
11
+ input: 'src/index.ts',
12
+ output: {
13
+ file: pkg.main,
14
+ format: 'cjs',
15
+ sourcemap: true,
16
+ exports: 'named',
17
+ },
18
+ plugins: [typescript({target: 'es6'}), cleanup({extensions: ['js', 'ts']})],
19
+ external,
20
+ },
21
+ {
22
+ input: 'src/index.ts',
23
+ output: {
24
+ file: pkg.module,
25
+ format: 'esm',
26
+ sourcemap: true,
27
+ },
28
+ plugins: [typescript({target: 'es2020'}), cleanup({extensions: ['js', 'ts']})],
29
+ external,
30
+ },
31
+ {
32
+ input: 'src/index.ts',
33
+ output: {file: pkg.types, format: 'esm'},
34
+ plugins: [dts(), cleanup({extensions: ['d.ts']})],
35
+ },
36
+ ]
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ console.log('Hello!')
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "downlevelIteration": true,
4
+ "esModuleInterop": true,
5
+ "experimentalDecorators": true,
6
+ "importHelpers": true,
7
+ "isolatedModules": true,
8
+ "lib": ["dom", "es2020"],
9
+ "module": "es2020",
10
+ "moduleResolution": "node",
11
+ "noImplicitAny": false,
12
+ "sourceMap": true,
13
+ "strict": true,
14
+ "target": "es2019"
15
+ },
16
+ "include": ["src/**/*"]
17
+ }