Added bootstrap-package command

This commit is contained in:
Josh Goldberg
2020-06-26 19:29:27 -04:00
parent ca67435f03
commit 5c5bcdf6f0
36 changed files with 300 additions and 106 deletions
+1
View File
@@ -5,3 +5,4 @@
**/src/**/*.js
**/test
**/package.json
packages/shenanigans-manager/setup/
+2 -2
View File
@@ -41,11 +41,11 @@ The following common commands from [`package.json`](../package.json) can be run
### Code Directories
Once built, there will be three directories in this package containing code, in order of build process:
Once built, there will be up to three directories in this package containing code, in order of build process:
1. `src/`: The "source of truth" containing TypeScript source files.
2. `lib/`: JavaScript source files, declaration files, and source maps generated by TypeScript from `src/`.
3. **[TODO]** `dist/`: Bundled, minified versions of JavaScript files generated by WebPack from `lib/`.
3. `dist/`: Bundled, minified versions of JavaScript files generated by WebPack from `lib/` -- if `package.json` contains a `"dist": true` under `"shenanigans"`.
### `shenanigans-manager`
+1 -1
View File
@@ -7,7 +7,7 @@
[![NPM version](https://badge.fury.io/js/devicelayr.svg)](http://badge.fury.io/js/devicelayr)
[![Join the chat at https://gitter.im/FullScreenShenanigans/community](https://badges.gitter.im/FullScreenShenanigans/community.svg)](https://gitter.im/FullScreenShenanigans/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
GamePad API bindings for InputWritr pipes.
Pipes GamePad API device actions to InputWritr pipes.
<!-- /Top -->
+1 -1
View File
@@ -7,7 +7,7 @@
[![NPM version](https://badge.fury.io/js/inputwritr.svg)](http://badge.fury.io/js/inputwritr)
[![Join the chat at https://gitter.im/FullScreenShenanigans/community](https://badges.gitter.im/FullScreenShenanigans/community.svg)](https://gitter.im/FullScreenShenanigans/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Configurable wrapper, recorder, and playback manager around user inputs.
Pipes input events to action callbacks.
<!-- /Top -->
+1 -1
View File
@@ -7,7 +7,7 @@
[![NPM version](https://badge.fury.io/js/pixeldrawr.svg)](http://badge.fury.io/js/pixeldrawr)
[![Join the chat at https://gitter.im/FullScreenShenanigans/community](https://badges.gitter.im/FullScreenShenanigans/community.svg)](https://gitter.im/FullScreenShenanigans/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Front-end to PixelRendr to automate drawing mass amounts of sprites to a primary canvas.
Real-time scene drawer for PixelRendr sprites.
<!-- /Top -->
+1
View File
@@ -35,5 +35,6 @@ It may contain the following keys, out of which only `name` is required:
- `name`: PascalCase name of the package, such as `"EightBittr"`.
- `dist`: Whether the package should also include a `dist` command that generates a Webpack-bundled `dist/` directory.
- `external`: Whether the package is a standalone repository outside of the EightBittr monorepo.
See `IShenanigansSchema` in [`src/typings.ts`](./src/typings.ts) for details.
@@ -0,0 +1,13 @@
<!-- Top -->
<!-- /Top -->
## Usage
Documentation coming soon<sup>tm</sup>!
<!-- Development -->
<!-- Maps -->
<!-- /Maps -->
<!-- /Development -->
@@ -0,0 +1,13 @@
/**
* Settings to initialize a new {{ shenanigans.name }}.
*/
export interface I{{ shenanigans.name }}Settings {
// TODO: Implement me!
}
/**
* {{ description }}
*/
export interface I{{ shenanigans.name }} {
// TODO: Implement me!
}
@@ -0,0 +1,2 @@
export * from "./I{{ shenanigans.name }}";
export * from "./{{ shenanigans.name }}";
@@ -0,0 +1,5 @@
describe("{{ shenanigans.name }}", () => {
it("_", () => {
// TODO: Implement me!
});
});
@@ -0,0 +1,18 @@
import {
I{{ shenanigans.name }},
I{{ shenanigans.name }}Settings,
} from "./I{{ shenanigans.name }}";
/**
* {{ description }}
*/
export class {{ shenanigans.name }} implements I{{ shenanigans.name }} {
/**
* Initializes a new instance of the {{ shenanigans.name }} class.
*
* @param settings Settings to be used for initialization.
*/
public constructor(settings: I{{ shenanigans.name }}Settings) {
throw new Error("TODO: Implement me!")
}
}
@@ -1,52 +0,0 @@
const glob = require("glob");
const path = require("path");
const package = require("./package.json");
const getEntriesAndSources = () => {
return package.shenanigans.entries === undefined
? [
{
entry: `./src/index.js`,
name: package.shenanigans.name,
},
]
: package.shenanigans.entries;
};
const getExternals = (shenanigans) => {
const output = {};
if (shenanigans.externals === undefined) {
return output;
}
for (const external of shenanigans.externals) {
output[external.name] = external.name;
}
return output;
};
const externals = getExternals(package.shenanigans);
const entriesAndSources = getEntriesAndSources();
const entry = {};
for (const pair of entriesAndSources) {
entry[pair.name] = pair.entry;
}
module.exports = {
entry,
externals,
mode: "production",
output: {
filename: "[name].js",
libraryTarget: "amd",
path: path.join(__dirname, "dist"),
},
performance: {
hints: false,
},
};
@@ -0,0 +1,5 @@
**/*.d.ts
**/*.js
**/*.json
**/dist
**/node_modules
@@ -0,0 +1,14 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./packages/*/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
}
@@ -0,0 +1,8 @@
*.d.ts
*.js
*.log
*.map
*.tsbuildinfo
node_modules/
lib/
test/
@@ -0,0 +1,7 @@
**/*.d.ts
**/dist
**/lib
**/node_modules
**/src/**/*.js
**/test
**/package.json
@@ -0,0 +1,4 @@
{
"printWidth": 98,
"tabWidth": 4
}
@@ -0,0 +1,31 @@
{
"compilerOptions": {
"baseUrl": "./src",
"declaration": true,
"declarationMap": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"jsx": "react",
"lib": ["dom", "es2015"],
"module": "amd",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./lib",
"pretty": true,
"rootDir": "./src",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"strictFunctionTypes": false,
"strictPropertyInitialization": false,
"target": "es2015"
},
"exclude": ["**/*.d.ts", "**/lib"],
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
}
@@ -0,0 +1,5 @@
{
"scripts": {
"compile": "tsc"
}
}

Some files were not shown because too many files have changed in this diff Show More