Skip to content

Commit 41ba8fe

Browse files
authored
Merge pull request #2 from DerekCL/feature/ExistingProjectRemoval
Removed Existing Project support
2 parents 4b055f1 + d310368 commit 41ba8fe

11 files changed

+5
-182
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### [2018-07-01]
22
* Removed ejs support
3+
* Removed existing project support
34

45
### [Sat Jun 18 2016]
56
* Refactor configs

README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -66,46 +66,9 @@ Options
6666
* `author_name`: Your Name
6767
* `description`: A short description of the project for the `README.md` file
6868
* `version`: Project version number
69-
* `existing_project`: `n` if this is a new project and `y` if you're integrating into an existing project. See the notes below about integrating into an existing project.
7069
* `css_extension`: [`none`, `less`, `sass`] - use `less` or `sass` to preprocess styles.
7170

7271

73-
Integrating into existing projects
74-
----------------------------------
75-
76-
You can chain this into an existing cookiecutter project by installing via the projects `./hooks/post_gen_project.py` file or just installing it via the command line.
77-
78-
### Using post hooks
79-
Here is a django project post hook example that chains this through a django cookiecutter project.
80-
81-
```python
82-
from cookiecutter.main import cookiecutter
83-
84-
cookiecutter(
85-
'[email protected]:goldhand/cookiecutter-webpack.git',
86-
replay=False, overwrite_if_exists=True, output_dir='../',
87-
checkout=None, no_input=True, extra_context={
88-
'project_name': '{{ cookiecutter.project_name }}',
89-
'repo_name': '{{ cookiecutter.repo_name }}',
90-
'repo_owner': 'goldhand',
91-
'static_root': '{{ cookiecutter.project_dir }}/static/{{ cookiecutter.project_dir }}',
92-
'production_output_path': '{{ cookiecutter.project_dir }}/static/{{ cookiecutter.project_dir }}/dist/',
93-
'author_name': '{{ cookiecutter.author_name }}',
94-
'description': '{{ cookiecutter.description }}',
95-
'version': '{{ cookiecutter.version }}',
96-
'existing_project': 'y',
97-
'css_extension': 'sass',
98-
})
99-
```
100-
101-
The flag `existing_project` will move/remove some files and dependencies and also add supporting configurations for a django project.
102-
103-
### Using command line
104-
Just make sure you use the `--overwrite-if-exists` [ or `-f`] flag so cookiecutter can work within your existing project structure. You will also probably want to point to your existing projects parent directory and make sure you use the same `repo_name` as the project directory so your `package.json` files are installed at the project root.
105-
106-
cookiecutter -f -output-dir ../ [email protected]:goldhand/cookiecutter-webpack.git
107-
108-
10972
Contributing
11073
------------
11174

build_test_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ default_context:
77
"author_name": "Your Name"
88
"description": "A short description of the project."
99
"version": "0.1.0"
10-
"existing_project": "n"
1110
"css_extension": "none"
1211
"open_source_license": "ISC"

cookiecutter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"author_name": "Your Name",
88
"description": "A short description of the project.",
99
"version": "0.1.0",
10-
"existing_project": "n",
1110
"css_extension": ["none", "less", "sass"],
1211
"open_source_license": "ISC"
1312
}

hooks/post_gen_project.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

hooks/pre_gen_project.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Get the root project directory
55
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
6-
is_existing = '{{ cookiecutter.existing_project }}' == 'y'
76

87

98
def add_tilda(project_directory, file_name):
@@ -18,8 +17,3 @@ def add_tilda(project_directory, file_name):
1817
)
1918
if os.path.isfile(current_location):
2019
shutil.move(current_location, new_location)
21-
22-
23-
if is_existing:
24-
add_tilda(PROJECT_DIRECTORY, '.gitignore')
25-
add_tilda(PROJECT_DIRECTORY, 'README.md')

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"repository": {
2424
"type": "git",
25-
"url": "git+https://github.com/goldhand/cookiecutter-webpack.git"
25+
"url": "git+https://github.com/DerekCL/cookiecutter-typescript-webpack.git"
2626
},
2727
"keywords": [
2828
"webpack",
@@ -32,10 +32,10 @@
3232
"cookiecutter",
3333
"boilerplate"
3434
],
35-
"author": "Will Farley <a.will.farley@gmail.com>",
35+
"author": "Derek Lewandowski <derekclewandowski@gmail.com>",
3636
"license": "ISC",
3737
"bugs": {
38-
"url": "https://github.com/goldhand/cookiecutter-webpack/issues"
38+
"url": "https://github.com/DerekCL/cookiecutter-typescript-webpack/issues"
3939
},
40-
"homepage": "https://github.com/goldhand/cookiecutter-webpack#readme"
40+
"homepage": "https://github.com/DerekCL/cookiecutter-typescript-webpack#readme"
4141
}

tests/test_cookiecutter_generation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def context():
2424
"email": "Your email",
2525
"description": "A short description of the project.",
2626
"version": "0.1.0",
27-
"existing_project": "n",
2827
"css_extension": "none",
2928
}
3029

{{cookiecutter.repo_name}}/config/webpack.local.config.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import webpack from 'webpack';
22
import ForceCaseSensitivityPlugin from 'force-case-sensitivity-webpack-plugin';
3-
{% if cookiecutter.existing_project == 'y' -%}
4-
import BundleTracker from 'webpack-bundle-tracker';
5-
{% endif -%}
63

74
import baseConfig from './webpack.base.config.js';
85

@@ -13,18 +10,8 @@ module.exports = (opts) => {
1310

1411
return {
1512
...config,
16-
{% if cookiecutter.existing_project == 'y' -%}
17-
output: {
18-
...config.output,
19-
publicPath: 'http://localhost:8080/bundles/',
20-
},
21-
{% endif -%}
2213
plugins: [
2314
...config.plugins,
24-
{% if cookiecutter.existing_project == 'y' -%}
25-
// local bundle stats file
26-
new BundleTracker({filename: './webpack-stats.json'}),
27-
{% endif -%}
2815
new ForceCaseSensitivityPlugin(), // OSX wont check but other unix os will
2916
new webpack.NoErrorsPlugin(),
3017
],

{{cookiecutter.repo_name}}/config/webpack.production.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import path from 'path';
22
import webpack from 'webpack';
3-
{% if cookiecutter.existing_project == 'y' -%}
4-
import BundleTracker from 'webpack-bundle-tracker';
5-
{% endif -%}
63

74
import baseConfig from './webpack.base.config.js';
85

@@ -23,10 +20,6 @@ module.exports = (opts) => {
2320
},
2421
plugins: [
2522
...config.plugins,
26-
{% if cookiecutter.existing_project == 'y' -%}
27-
// production bundle stats file
28-
new BundleTracker({filename: './webpack-stats-production.json'}),
29-
{% endif -%}
3023
// pass options to uglify
3124
new webpack.LoaderOptionsPlugin({
3225
minimize: true,

0 commit comments

Comments
 (0)