diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 974d120..701d46c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,37 +1,47 @@ --- name: Bug report about: Create a report to help us improve -title: '' +title: "[BUG] " labels: bug, needs-triage assignees: chenasraf - --- -**Describe the bug** +#### Describe the bug + A clear and concise description of what the bug is. -**To Reproduce** +#### How To Reproduce + Steps to reproduce the behavior: 1. Prepare templates: - ``` - template contents - ``` + + ```txt + This is my {{ template }} + ``` + 2. Run with args/config: - ``` - npx simple-scaffold@latest -t ... -o output TplName - ``` -**Expected behavior** + + ```shell + npx simple-scaffold@latest -t input -o output TplName + ``` + +#### Expected behavior\*\* + A clear and concise description of what you expected to happen. -**Logs** -If applicable, paste your logs to help explain your problem. -To see more logs, run the scaffold with `-v 1` to enable debug logging. +#### Logs -**Desktop (please complete the following information):** - - OS: [e.g. iOS] +If applicable, paste your logs to help explain your problem. To see more logs, run the scaffold with +`-v 1` to enable debug logging. + +#### Desktop (please complete the following information): + +- OS: [e.g. macOS, Windows, Linux] +- OS Version: [e.g. Big Sur, 11, Ubuntu 20.04] - Node.js: [e.g. 16.8] - - Simple Scaffold Version [e.g. 1.0.4] +- Simple Scaffold Version [e.g. 1.1.2] + +#### Additional context -**Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index fbd6563..0d85a66 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,24 @@ --- name: Feature request about: Suggest an idea for this project -title: '' +title: "[FEATURE] " labels: enhancement, needs-triage assignees: chenasraf - --- -**Is your feature request related to a problem? Please describe.** +#### Is your feature request related to a problem? Please describe. + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** +#### Describe the solution you'd like + A clear and concise description of what you want to happen. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +#### Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered, if +applicable. + +#### Additional context -**Additional context** Add any other context or screenshots about the feature request here. diff --git a/.markdownlint.json b/.markdownlint.json index 6b22214..cbcf834 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -6,4 +6,4 @@ }, "no-inline-html": false, "first-line-h1": false -} \ No newline at end of file +} diff --git a/.prettierrc b/.prettierrc index 362ea09..f1bb6e0 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,14 @@ "semi": false, "trailingComma": "all", "printWidth": 120, - "tabWidth": 2 + "tabWidth": 2, + "overrides": [ + { + "files": "*.md", + "options": { + "printWidth": 100, + "proseWrap": "always" + } + } + ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 65b7a01..087d773 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,29 +1,27 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Scaffold", - "type": "node", - "request": "launch", - "protocol": "inspector", - "cwd": "${workspaceFolder}", - "program": "${workspaceFolder}/test.ts", - "outFiles": [ - "${workspaceRoot}/dist/test.js" - ], - "env": { - "NODE_ENV": "develop" - }, - "sourceMaps": true, + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Scaffold", + "type": "node", + "request": "launch", + "protocol": "inspector", + "cwd": "${workspaceFolder}", + "program": "${workspaceFolder}/test.ts", + "outFiles": ["${workspaceRoot}/dist/test.js"], + "env": { + "NODE_ENV": "develop" }, - { - "type": "node", - "request": "attach", - "name": "Attach by Process ID", - "processId": "${command:PickProcess}" - } - ] + "sourceMaps": true + }, + { + "type": "node", + "request": "attach", + "name": "Attach by Process ID", + "processId": "${command:PickProcess}" + } + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index c565eb6..ca43e54 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,4 +17,4 @@ 100 ], }, -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 414d097..d133a64 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,55 +5,55 @@ "script": "build", "label": "build", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "dev", "label": "dev", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "command": "yarn typedoc --watch", "label": "typedoc --watch", "type": "shell", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "start", "label": "start", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "test", "label": "test", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "command": "yarn test --watchAll", "label": "yarn test --watchAll", "type": "shell", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "cmd", "label": "cmd", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "build-test", "label": "build-test", "type": "npm", - "problemMatcher": [], + "problemMatcher": [] }, { "script": "build-cmd", "label": "build-cmd", "type": "npm", - "problemMatcher": [], - }, - ], -} \ No newline at end of file + "problemMatcher": [] + } + ] +} diff --git a/MIGRATION.md b/MIGRATION.md index b0ff10f..fda2be9 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,16 +1,20 @@ -# Migrating from 0.x to 1.0 +# Migrating from 0.x to 1.x In Simple Scaffold v1.0, the entire codebase was overhauled, yet usage remains mostly the same between versions. With these notable exceptions: - Some of the argument names have changed - Template syntax has been improved -- The command to run Scaffold has been simplified from `new SimpleScaffold(opts).run()` to `SimpleScaffold(opts)`, which now returns a promise that you can await to know when the process has been completed. +- The command to run Scaffold has been simplified from `new SimpleScaffold(opts).run()` to + `SimpleScaffold(opts)`, which now returns a promise that you can await to know when the process + has been completed. ## Argument changes -- `locals` has been renamed to `data`. The appropriate command line args have been updated as - well to `--data` | `-d`. +- `locals` has been renamed to `data`. The appropriate command line args have been updated as well + to `--data` | `-d`. +- Additional options have been added to both CLI and Node interfaces. See the [readme](/README.md) + for more information. ## Template syntax changes diff --git a/README.md b/README.md index 9847735..eee75c3 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ async function main() { output: ["src/components"], data: { className: "myClassName", - author: "Chen Asraf" + author: "Chen Asraf", }, }) console.log("Done.") diff --git a/doc-theme/tsconfig.json b/doc-theme/tsconfig.json index f0f4221..2c60a50 100644 --- a/doc-theme/tsconfig.json +++ b/doc-theme/tsconfig.json @@ -9,7 +9,7 @@ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "es2016", // /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ "jsx": "react", // /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ @@ -21,7 +21,7 @@ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "commonjs", // /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ @@ -65,9 +65,9 @@ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "forceConsistentCasingInFileNames": true, // /* Ensure that casing is correct in imports. */ /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true, // /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -88,6 +88,6 @@ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true // /* Skip type checking all .d.ts files. */ } } diff --git a/tsconfig.json b/tsconfig.json index 2d2b232..a2b3c37 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,20 +4,13 @@ "module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, - "lib": [ - "ES2019", - ], + "lib": ["ES2019"], "declaration": true, "outDir": "dist", "strict": true, "sourceMap": true, - "removeComments": false, + "removeComments": false }, - "include": [ - "src/index.ts", - "src/cmd.ts", - ], - "exclude": [ - "tests/*" - ] + "include": ["src/index.ts", "src/cmd.ts"], + "exclude": ["tests/*"] } diff --git a/typedoc.json b/typedoc.json index 16a0777..9215619 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,17 +1,10 @@ { "name": "Simple Scaffold", - "entryPoints": [ - "src/index.ts" - ], + "entryPoints": ["src/index.ts"], "includeVersion": true, "categorizeByGroup": false, - "sort": [ - "visibility" - ], - "categoryOrder": [ - "Main", - "*" - ], + "sort": ["visibility"], + "categoryOrder": ["Main", "*"], "media": "media", "theme": "doc-theme", "githubPages": true,