Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dennykorsukewitz committed Nov 21, 2023
1 parent 0f1c9f2 commit fba40af
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repository:
name: generator-sublime-package

# A short description of the repository that will show up on GitHub
description: Todo
description: Sublime-Package is a Sublime Text package generator for yeoman, which creates scaffold for a sublime-package.

# A URL with more information about the repository
homepage: https://dennykorsukewitz.github.io/generator-sublime-package/
Expand Down
68 changes: 36 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,40 @@

# Sublime-Package

**Sublime-Package** is a Sublime Text package generator for [yeoman](https://yeoman.io/).

We are all lazy 🦥 and only want to code 👨‍💻 if it is not already exists.
**Sublime-Package** is a Sublime Text package generator for [yeoman](https://yeoman.io/), which creates scaffold for a sublime-package.

We are all lazy 🦥 and only want to code 👨‍💻 if it is not already exists. \
So i created this yeoman generator to easy get an scaffold for a sublime-package.

| Repository | GitHub | NPM |
| ------ | ------ | ------ |
| ![GitHub release (latest by date)](https://img.shields.io/github/v/release/dennykorsukewitz/generator-sublime-package) | ![GitHub open issues](https://img.shields.io/github/issues/dennykorsukewitz/generator-sublime-package) ![GitHub closed issues](https://img.shields.io/github/issues-closed/dennykorsukewitz/generator-sublime-package?color=#44CC44) | ![npm](https://img.shields.io/npm/dy/generator-sublime-package) |
| ![GitHub license](https://img.shields.io/github/license/dennykorsukewitz/generator-sublime-package) | ![GitHub pull requests](https://img.shields.io/github/issues-pr/dennykorsukewitz/generator-sublime-package?label=PR) ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/dennykorsukewitz/generator-sublime-package?color=g&label=PR) | ![npm](https://img.shields.io/npm/dm/generator-sublime-package) |
| ![GitHub language count](https://img.shields.io/github/languages/count/dennykorsukewitz/generator-sublime-package?style=flat&label=language) | ![GitHub contributors](https://img.shields.io/github/contributors/dennykorsukewitz/generator-sublime-package) | ![npm](https://img.shields.io/npm/dw/generator-sublime-package) |
| ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dennykorsukewitz/generator-sublime-package) | ![GitHub downloads](https://img.shields.io/github/downloads/dennykorsukewitz/generator-sublime-package/total?style=flat) | ![npm](https://img.shields.io/npm/dt/generator-sublime-package) |

todo
![npm bundle size](https://img.shields.io/bundlephobia/min/generator-sublime-package)
![npm collaborators](https://img.shields.io/npm/collaborators/generator-sublime-package)
| ![GitHub release (latest by date)](https://img.shields.io/github/v/release/dennykorsukewitz/generator-sublime-package) | ![GitHub open issues](https://img.shields.io/github/issues/dennykorsukewitz/generator-sublime-package) ![GitHub closed issues](https://img.shields.io/github/issues-closed/dennykorsukewitz/generator-sublime-package?color=#44CC44) | ![npm version](https://badge.fury.io/js/generator-sublime-package.svg) |
| ![GitHub license](https://img.shields.io/github/license/dennykorsukewitz/generator-sublime-package) | ![GitHub pull requests](https://img.shields.io/github/issues-pr/dennykorsukewitz/generator-sublime-package?label=PR) ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/dennykorsukewitz/generator-sublime-package?color=g&label=PR) | ![npm bundle size](https://img.shields.io/bundlephobia/min/generator-sublime-package) ![npm collaborators](https://img.shields.io/npm/collaborators/generator-sublime-package) |
| ![GitHub language count](https://img.shields.io/github/languages/count/dennykorsukewitz/generator-sublime-package?style=flat&label=language) | ![GitHub contributors](https://img.shields.io/github/contributors/dennykorsukewitz/generator-sublime-package) | ![npm](https://img.shields.io/npm/dy/generator-sublime-package) ![npm](https://img.shields.io/npm/dm/generator-sublime-package) |
| ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dennykorsukewitz/generator-sublime-package) | ![GitHub downloads](https://img.shields.io/github/downloads/dennykorsukewitz/generator-sublime-package/total?style=flat) | ![npm](https://img.shields.io/npm/dw/generator-sublime-package) ![npm](https://img.shields.io/npm/dt/generator-sublime-package) |

| Status |
| ------ |
| [![GitHub commits since tagged version](https://img.shields.io/github/commits-since/dennykorsukewitz/generator-sublime-package/0.0.1/dev)](https://github.com/dennykorsukewitz/generator-sublime-package/compare/0.0.1...dev) ![GitHub Workflow Lint](https://github.com/dennykorsukewitz/generator-sublime-package/actions/workflows/lint.yml/badge.svg?branch=dev&style=flat&label=Lint) ![GitHub Workflow Pages](https://github.com/dennykorsukewitz/generator-sublime-package/actions/workflows/pages.yml/badge.svg?branch=dev&style=flat&label=GitHub%20Pages) |

---

TODO

[![Node.js](https://img.shields.io/badge/nodejs-16.13.0-blue.svg)](https://github.com/nodejs/node)
[![yeoman-generator version](https://badge.fury.io/js/yeoman-generator.svg)](https://badge.fury.io/js/yeoman-generator)
[![yo version](https://badge.fury.io/js/yo.svg)](https://badge.fury.io/js/yo)

![Yeoman](doc/images/Yeoman_Logo.png)
## Feature

We use the Yeoman as a node.js module.
The following files can be created.

- .gitattributes
- .gitignore
- messages/changelog.txt
- messages/install.txt
- messages/version.txt
- messages.json
- README.md

---

## Feature

TODO


## Usage

TODO

```bash
# let the magic happen
yo sublime-package
Expand All @@ -56,13 +45,10 @@ yo sublime-package --generators

# run subgenerators directly
yo sublime-package:SUBGENERATOR
yo sublime-package:sopm
yo sublime-package:readme
```

## Settings

TODO

---

## Dependencies

Expand All @@ -89,6 +75,8 @@ Install [Yeoman](http://yeoman.io)
npm install -g yo
```

---

## Installation

### 1. NPM
Expand Down Expand Up @@ -122,8 +110,12 @@ Run this link command in generator-sublime-package directory to link this genera
npm link ./
```

---

## Development

### Dependencies

```bash
# install yeoman-test for jest tests
npm install -g yeoman-test
Expand All @@ -137,11 +129,23 @@ npm install -g ejs-lint

```

### Common Commands
### Commands

```bash
npm run lint # lint all JS files
npm run lint-fix # lint and fix all JS files
npm run test # start jest (tests)
npm run coverage # start jest (tests) with coverage
```

---

## Download

For download see [Sublime-GitHubFileFetcher](https://github.com/dennykorsukewitz/Sublime-GitHubFileFetcher/releases)

---

Enjoy!

Your [Denny Korsukéwitz](https://github.com/dennykorsukewitz) 🚀
16 changes: 11 additions & 5 deletions generators/app/USAGE
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ Example:
yo sublime-package --generators

This will create:
.gitignore: default gitignore file
.gitattributes default .gitattributes file
.gitignore default .gitignore file
messages/changelog.txt default changelog.txt file
messages/install.txt default install.txt file
messages/version.txt default version.txt file
messages.json default messages.json file

Variables:
TODO
TODO
TODO
TODO
sublime_version
package_name
package_description
github_username
github_fullname
54 changes: 32 additions & 22 deletions generators/app/config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
const config = {
name: 'Sublime-Package-Generator',
versions: {
'4.0.x': '',
},
prompts: [
// {
// name: 'sublime_version',
// message: 'For which sublime version should this package be?',
// type: 'list',
// choices: '${config.supported_versions}',
// default: '4.0.x',
// store: true,
// },
{
name: 'framework_version',
message: 'For which framework version should this package be?',
type: 'list',
choices: '${config.supported_versions}',
default: '7.0.x',
name: 'package_name',
message: 'What is the name of your new Sublime-Package?',
type: 'input',
default: '${config.package_name_predicted}',
store: true,
},
{
name: 'package_name',
message: 'Please add or confirm the package prefix / customer contraction.',
name: 'package_description',
type: 'input',
default: '${config.package_prefix}',
message: 'Description. What does the package contain?',
default: '**${config.package_name_predicted}** is a Sublime Text package that...',
store: true,
},
{
name: 'github_username',
message: 'What is the GitHub user name of your new Sublime-Package?',
type: 'input',
default: '${config.github_username}',
store: true,
},
{
name: 'github_fullname',
message: 'What is your GitHub full name?',
type: 'input',
default: '${config.github_fullname}',
store: true,
},
// {
// name: 'package_seperator',
// message: 'Please add or confirm the package seperator.',
// type: 'input',
// default: '${config.package_seperator}',
// store: true,
// },
// {
// name: 'package_suffix',
// message: 'Please add or confirm the package suffix.',
// type: 'input',
// default: '${config.package_suffix}',
// store: true,
// },
],
};
module.exports = config;
26 changes: 15 additions & 11 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ module.exports = class extends Generator {
config = this.config.getAll();

// Denny: delete me
if (config.package_name == 'DK-Test') {
console.log('initializing config');
console.log(config);
console.log(generator_config);
}
console.log('initializing config');
console.log(config);
console.log('initializing generator_config');
console.log(generator_config);

// Says hello
helper.SayStart(this, config);

generator_config.prompts = helper.InterpolatePrompts(this, config, generator_config.prompts);

console.log('generator_config.prompts');
console.log(generator_config.prompts);


// add only not answered prompt's (questions) to array prompts
generator_config.prompts.forEach(prompt => {
if (!config[prompt.name]) {

// if add supported framework_version 's
if (prompt.name == 'framework_version') {
// if add supported sublime_version 's
if (prompt.name == 'sublime_version') {
prompt.choices = config.supported_versions;
}
prompts.push(prompt);
Expand All @@ -58,16 +63,16 @@ module.exports = class extends Generator {
}

config.generators = [];
config.framework_version = config.framework_version || answers.framework_version;
config.sublime_version = config.sublime_version || answers.sublime_version || '4.0.x';

if (!config.generators.length && config.framework_version && config.generators_by_versions) {
if (!config.generators.length && config.sublime_version && config.generators_by_versions) {
config.generators = helper.GetAvailableGenerators(this, config);
}

if (!config.generators || !config.generators.length) {
this.log(
yosay(
`${chalk.red('I have not found any generators for this version:')} ${chalk.green(config.framework_version)}`,
`${chalk.red('I have not found any generators for this version:')} ${chalk.green(config.sublime_version)}`,
),
);
return;
Expand Down Expand Up @@ -99,7 +104,6 @@ module.exports = class extends Generator {
this.config.set(key, answers[key]);
}

helper.SetPackageName(this, config);
this.config.save();
}

Expand Down
12 changes: 12 additions & 0 deletions generators/app/templates/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Exclude files from exporting

## Graphics
*.png export-ignore
*.jpg export-ignore
*.jpeg export-ignore
*.gif export-ignore
*.tif export-ignore
*.tiff export-ignore
*.ico export-ignore
*.svg export-ignore
*.eps export-ignore
3 changes: 3 additions & 0 deletions generators/app/templates/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.yo-rc.json
node_modules
coverage
11 changes: 11 additions & 0 deletions generators/app/templates/changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Changelog

All notable changes to the "<%= package_name %>" package will be documented in this file.

---

Version 0.0.0

Initial release of <%= package_name %> package.

- TODO
Empty file.
9 changes: 9 additions & 0 deletions generators/app/templates/install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
⭐ Congratulations ⭐

<%= package_description %>

-------------------

🌟 Version 0.0.0 🌟 - Feature List

- TODO
4 changes: 4 additions & 0 deletions generators/app/templates/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"install": "messages/install.txt",
"0.0.0": "messages/version.txt"
}
13 changes: 13 additions & 0 deletions generators/app/templates/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
🌟 Version 0.0.0 🌟

Initial release of TODO package.

- TODO

GitHub link - https://github.com/<%= github_username %>/<%= package_name %>

---

Enjoy!

Your [Denny Korsukéwitz](https://github.com/<%= github_username %>) 🚀
8 changes: 8 additions & 0 deletions generators/readme/USAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Description:
Creates README.md markdown file.

Example:
yo sublime-package:readme

This will create:
README.md: Description and minimal user instructions
13 changes: 13 additions & 0 deletions generators/readme/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const config = {
name: 'README.md',
priority: 5,
versions: {
'4.0.x': '',
},
required_data: [
'package_name',
'sublime_version',
],
prompts: [],
};
module.exports = config;
Loading

0 comments on commit fba40af

Please sign in to comment.