Skip to content

Commit aab7892

Browse files
feat: initial
1 parent 3ddcee2 commit aab7892

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+12183
-0
lines changed

.commitlintrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"extends": ["@commitlint/config-conventional"]}

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

.eslintignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
example/
3+
examples/
4+
fixture/
5+
fixtures/
6+
dist/
7+
example-*/
8+
example/
9+
hotDevClient.js

.eslintrc.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
3+
const prettierOptions = JSON.parse(fs.readFileSync('./.prettierrc', 'utf8'));
4+
5+
module.exports = {
6+
"extends": ["standard", "prettier"],
7+
"env": {
8+
"jest": true
9+
},
10+
"plugins": ["prettier"],
11+
"rules": {
12+
"prettier/prettier": ['error', prettierOptions],
13+
}
14+
}

.gitattributes

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
2+
3+
# Handle line endings automatically for files detected as text
4+
# and leave all files detected as binary untouched.
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
#
12+
## These files are text and should be normalized (Convert crlf => lf)
13+
#
14+
15+
# source code
16+
*.php text
17+
*.css text
18+
*.sass text
19+
*.scss text
20+
*.less text
21+
*.styl text
22+
*.js text eol=lf
23+
*.coffee text
24+
*.json text
25+
*.htm text
26+
*.html text
27+
*.xml text
28+
*.svg text
29+
*.txt text
30+
*.ini text
31+
*.inc text
32+
*.pl text
33+
*.rb text
34+
*.py text
35+
*.scm text
36+
*.sql text
37+
*.sh text
38+
*.bat text
39+
40+
# templates
41+
*.ejs text
42+
*.hbt text
43+
*.jade text
44+
*.haml text
45+
*.hbs text
46+
*.dot text
47+
*.tmpl text
48+
*.phtml text
49+
50+
# server config
51+
.htaccess text
52+
.nginx.conf text
53+
54+
# git config
55+
.gitattributes text
56+
.gitignore text
57+
.gitconfig text
58+
59+
# code analysis config
60+
.jshintrc text
61+
.jscsrc text
62+
.jshintignore text
63+
.csslintrc text
64+
65+
# misc config
66+
*.yaml text
67+
*.yml text
68+
.editorconfig text
69+
70+
# build config
71+
*.npmignore text
72+
*.bowerrc text
73+
74+
# Heroku
75+
Procfile text
76+
.slugignore text
77+
78+
# Documentation
79+
*.md text
80+
LICENSE text
81+
AUTHORS text
82+
83+
84+
#
85+
## These files are binary and should be left untouched
86+
#
87+
88+
# (binary is a macro for -text -diff)
89+
*.png binary
90+
*.jpg binary
91+
*.jpeg binary
92+
*.gif binary
93+
*.ico binary
94+
*.mov binary
95+
*.mp4 binary
96+
*.mp3 binary
97+
*.flv binary
98+
*.fla binary
99+
*.swf binary
100+
*.gz binary
101+
*.zip binary
102+
*.7z binary
103+
*.ttf binary
104+
*.eot binary
105+
*.woff binary
106+
*.pyc binary
107+
*.pdf binary

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
coverage
2+
build
3+
node_modules
4+
stats.json
5+
dist
6+
output_test
7+
output_test
8+
examples/*/yarn.lock
9+
examples/*/package-lock.json
10+
packages/*/yarn.lock
11+
packages/*/package-lock.json
12+
.DS_Store
13+
npm-debug.log
14+
*.log
15+
*.log.*
16+
.idea

.huskyrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "npm run lint",
4+
"commit-msg": "commitlint -e $GIT_PARAMS"
5+
}
6+
}

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/carbon

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
build/
3+
node_modules/
4+
internals/generators/
5+
internals/scripts/
6+
package-lock.json
7+
yarn.lock
8+
package.json

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all"
8+
}

bin/cli.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
3+
// LIBRARIES
4+
const importLocalFile = require('import-local-file');
5+
// PACKAGES
6+
const logger = require('../packages/logger');
7+
8+
const localFile = importLocalFile(__filename);
9+
const forceGlobal = process.argv.includes('--force-global') || process.argv.includes('--forceGlobal');
10+
11+
if (localFile && !forceGlobal) {
12+
logger.debug('Using local build package', localFile);
13+
require(localFile);
14+
} else {
15+
// Code for both global and local version
16+
require('./main');
17+
}

bin/main.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// LIBRARIES
2+
const updateNotifier = require('update-notifier');
3+
const cac = require('cac');
4+
// COMPONENTS
5+
const isPath = require('../lib/utils/isPath');
6+
const TechpacketBuildTools = require('../lib');
7+
// PACKAGES
8+
const logger = require('../packages/logger');
9+
// PACKAGE
10+
const pkg = require('../package');
11+
12+
require('loud-rejection')();
13+
14+
updateNotifier({ pkg }).notify();
15+
16+
// To start, we will need to know which `command` you're calling
17+
// And you can also supply options via CLI flags
18+
const { input, flags } = cac.parse(process.argv.slice(2));
19+
20+
// Handle `--version` before starting
21+
if (flags.version || flags.v) {
22+
logger.debug(require('../package').version);
23+
process.exit();
24+
}
25+
26+
let command;
27+
let entry;
28+
29+
if (!input[0] || isPath(input[0])) {
30+
command = 'develop';
31+
entry = input;
32+
} else {
33+
command = input[0];
34+
entry = input.slice(1);
35+
}
36+
37+
// Create options
38+
const options = Object.assign({}, flags, { entry, flags });
39+
40+
if (entry.length === 0) {
41+
delete options.entry;
42+
}
43+
44+
const app = new TechpacketBuildTools(command, options);
45+
46+
app.run().catch(err => {
47+
logger.error(err.stack);
48+
process.exit(1);
49+
});

docs/README.md

Whitespace-only changes.

docs/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mkdocs==1.0.3
2+
mkdocs-material==3.0.3
3+
Pygments==2.2.0

docs/styles/docs.css

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
header .md-header-nav .md-flex__cell {
2+
vertical-align: middle;
3+
}
4+
5+
header .md-header-nav .md-logo {
6+
padding: 0;
7+
margin: 0;
8+
}
9+
10+
header .md-header-nav .md-logo .md-icon {
11+
background: url('https://avatars3.githubusercontent.com/u/41538082?s=200&v=4');
12+
width: 40px;
13+
height: 40px;
14+
background-size: cover;
15+
}
16+
17+
header.md-header[data-md-state="shadow"] {
18+
box-shadow: none;
19+
border-bottom: 1px solid #d2d6d9;
20+
}
21+
22+
body {
23+
background: #f5f8fa;
24+
}
25+
26+
.md-footer {
27+
display: none;
28+
}
29+
30+
.md-sidebar__scrollwrap .md-nav--secondary {
31+
border-radius: 6px;
32+
background-color: #ebf1f5;
33+
text-align: left;
34+
}
35+
36+
@media only screen and (min-width: 60em) {
37+
.md-search {
38+
padding: 0;
39+
}
40+
}

lerna.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"lerna": "2.9.1",
3+
"version": "1.0.0-alpha.1",
4+
"command": {
5+
"publish": {
6+
"ignoreChanges": [
7+
"*.md",
8+
"**/example/**",
9+
"**/test/**"
10+
]
11+
}
12+
},
13+
"packages": [
14+
"packages/*"
15+
]
16+
}

lib/cli/cliEngine.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// LIBRARIES
2+
const cac = require('cac');
3+
4+
module.exports = class CLI {
5+
constructor(command) {
6+
this.command = command;
7+
this.cac = cac();
8+
}
9+
10+
handleCommand(...args) {
11+
return this.cac.command(...args);
12+
}
13+
14+
isCurrentCommand(command) {
15+
if (command === '*' || command === this.command) return true;
16+
if (Array.isArray(command) && command.includes(this.command)) return true;
17+
return false;
18+
}
19+
20+
willShowHelp() {
21+
return process.argv.includes('--help');
22+
}
23+
24+
async runCommand() {
25+
const args = [this.command];
26+
27+
if (this.willShowHelp()) {
28+
args.push('--help');
29+
}
30+
31+
return this.cac.parse(args);
32+
}
33+
};

0 commit comments

Comments
 (0)