Skip to content

Commit

Permalink
Merge pull request #7 from giuseppeg/update-modules-in-generated-pkg
Browse files Browse the repository at this point in the history
Update modules in generated package
  • Loading branch information
necolas authored and mlnmln committed Dec 30, 2018
1 parent 8013152 commit 3324128
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 50 deletions.
12 changes: 6 additions & 6 deletions packages/generator-suit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
=== HEAD
# HEAD

=== 0.4.0 (April 5, 2014)
### 0.4.0 (April 5, 2014)

* Add latest build tools.
* Add npm support in generated components.

=== 0.3.0 (February 8, 2014)
### 0.3.0 (February 8, 2014)

* Add 'component-builder-suit' to generated package's tools.
* Remove CSSLint tooling from modules.

=== 0.2.0 (November 13, 2013)
### 0.2.0 (November 13, 2013)

* Add 'suit-test' to generated package's dev dependencies.
* Switch to using Component(1) for development.

=== 0.1.1 (October 19, 2013)
### 0.1.1 (October 19, 2013)

* Fix the generated README's description placeholder.
* Add 'adjoining-classes' and 'compatible-vendor-prefixes' to CSS Lint ignores.

=== 0.1.0 (August 23, 2013)
### 0.1.0 (August 23, 2013)

* Initial release.
6 changes: 4 additions & 2 deletions packages/generator-suit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Produces:
├── bower.json
├── component.json
├── package.json
├── my-component.css
└── test.html
├── index.css
├── lib/my-component.css
├── test/index.html
└── test/test.css
```
6 changes: 4 additions & 2 deletions packages/generator-suit/lib/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ Generator.prototype.projectFiles = function projectFiles() {
this.template('LICENSE.md');
this.template('README.md');
// component
this.template('index.css', this.moduleFileName);
this.template('index.css');
this.template('lib/component.css', 'lib/' + this.moduleFileName);
// test
this.template('test.html', 'test.html');
this.template('test/index.html');
this.template('test/test.css');
};

Generator.name = "suitModule";
6 changes: 5 additions & 1 deletion packages/generator-suit/lib/templates/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
=== HEAD
# HEAD

### v0.0.0 (MM/DD/YYYY)

* Initial public release.
14 changes: 13 additions & 1 deletion packages/generator-suit/lib/templates/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ To generate the testing build.
npm run build-test
```

Basic visual tests are in `test.html`.
Basic visual tests are in `test/index.html`.

To pre-process:

```
npm run preprocess
```

To pre-process the tests:

```
npm run preprocess-test
```

## Browser support

Expand Down
19 changes: 13 additions & 6 deletions packages/generator-suit/lib/templates/app/bower.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"name": "suit-<%= modulePackageName %>",
"name": "suitcss-<%= modulePackageName %>",
"description": "",
"version": "0.0.0",
"main": "<%= moduleFileName %>",
"author": "",
"main": "lib/<%= moduleFileName %>",
"ignore": [
"build",
"components",
"test",
".*",
"CHANGELOG.md",
"component.json",
"package.json",
"test.html"
"test",
"build",
"components"
],
"keywords": [
"browser",
"css-components",
"<%= modulePackageName %>",
"suitcss",
"style"
]
}
11 changes: 5 additions & 6 deletions packages/generator-suit/lib/templates/app/component.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "<%= modulePackageName %>",
"name": "suitcss-<%= modulePackageName %>",
"repo": "suitcss/<%= modulePackageName %>",
"version": "0.0.0",
"styles": ["<%= moduleFileName %>"],
"dependencies": {},
"development": {
"suitcss/components-test": "0.1.1"
},
"styles": [
"lib/<%= moduleFileName %>"
],
"author": "",
"license": "MIT"
}
5 changes: 1 addition & 4 deletions packages/generator-suit/lib/templates/app/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/** @define <%= _.classify(moduleName) %> */
@import "./lib/<%= moduleName %>.css";

.<%= _.classify(moduleName) %> {

}
5 changes: 5 additions & 0 deletions packages/generator-suit/lib/templates/app/lib/component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @define <%= _.classify(moduleName) %>; 'use strict' */

.<%= _.classify(moduleName) %> {

}
34 changes: 20 additions & 14 deletions packages/generator-suit/lib/templates/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@
"name": "suitcss-<%= modulePackageName %>",
"description": "",
"version": "0.0.0",
"style": "<%= moduleFileName %>",
"style": "index.css",
"files": [
"component.json",
"<%= moduleFileName %>"
"index.css",
"index.js",
"lib"
],
"devDependencies": {
"component": "0.19.x",
"component-builder-suit": "0.2.x",
"suitcss-preprocessor": "0.1.x"
"suitcss-components-test": "*",
"suitcss-preprocessor": "~0.3.0"
},
"scripts": {
"build": "npm run component && npm run preprocess",
"build-test": "npm run component-dev && npm run preprocess",
"component": "component install && component build --use component-builder-suit",
"component-dev": "component install --dev && component build --dev --use component-builder-suit",
"preprocess": "suitcss build/build.css build/build.css"
"build": "npm run setup && npm run preprocess",
"build-test": "npm run setup && npm run preprocess-test",
"preprocess": "suitcss index.css build/build.css",
"preprocess-test": "suitcss test/test.css build/test.css",
"setup": "npm install && mkdir -p build"
},
"repository": {
"type": "git",
"url": "git://github.com/suitcss/<%= modulePackageName %>.git"
},
"keywords": [
"suit",
"css",
"component"
"browser",
"css-components",
"<%= modulePackageName %>",
"suitcss",
"style"
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title><%= _.classify(moduleName) %> [component] - SUIT</title>
<meta name="viewport" content="initial-scale=1,width=device-width">
<link rel="stylesheet" href="build/build.css">
<title><%= _.classify(moduleName) %> [component] - suit</title>
<link rel="stylesheet" href="../build/test.css">
<style>
/* CSS to help implement and/or expose the test */
</style>
Expand Down
2 changes: 2 additions & 0 deletions packages/generator-suit/lib/templates/app/test/test.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "suitcss-components-test";
@import "../index.css";
12 changes: 7 additions & 5 deletions packages/generator-suit/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,27 @@ describe('Generator test', function () {
// config files
[
'bower.json',
/"name": "suit-components-my-module"/
/"name": "suitcss-components-my-module"/
],
[
'component.json',
/"name": "components-my-module"/
/"name": "suitcss-components-my-module"/
],
[
'package.json',
/"name": "suitcss-components-my-module"/,
/"style": "my-module.css"/
/"style": "index.css"/
],
// docs
'CHANGELOG.md',
'LICENSE.md',
'README.md',
// component
'my-module.css',
'index.css',
'lib/my-module.css',
// test
'test.html'
'test/index.html',
'test/test.css'
];

suitmodule.run([], function () {
Expand Down

0 comments on commit 3324128

Please sign in to comment.