-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ django_js_reverse/tests/tmp/ | |
.project | ||
.pydevproject | ||
.settings/ | ||
|
||
index.js | ||
index.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
3.5.4 | ||
3.6.3 | ||
3.7.0 | ||
pypy2.7-5.9.0 | ||
pypy3-2.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"author": "Bernhard Janetzki", | ||
"bugs": { | ||
"url": "https://github.com/ierror/django-js-reverse/issues" | ||
}, | ||
"description": "JavaScript url handling for Django that doesn't hurt.", | ||
"files": [ | ||
"index.js", | ||
"index.mjs" | ||
], | ||
"homepage": "https://github.com/ierror/django-js-reverse#readme", | ||
"keywords": [ | ||
"django", | ||
"js", | ||
"reverse", | ||
"url" | ||
], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"name": "django-js-reverse", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/ierror/django-js-reverse.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
import os | ||
|
||
import django | ||
from django.conf import settings | ||
|
||
import django_js_reverse | ||
from django_js_reverse import core | ||
|
||
if __name__ == '__main__': | ||
settings.configure( | ||
INSTALLED_APPS = ['django_js_reverse'], | ||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'APP_DIRS': True, | ||
}, | ||
], | ||
) | ||
django.setup() | ||
|
||
module = core.generate_cjs_module() | ||
with open('index.js', 'w') as cjs: | ||
cjs.write(module) | ||
|
||
with open('index.mjs', 'w') as cjs: | ||
cjs.write('const module = {};') | ||
cjs.write(module) | ||
cjs.write('export default module.exports;') | ||
|
||
with open('package.json', 'r+') as f: | ||
data = json.load(f) | ||
f.seek(0) | ||
data['version'] = '.'.join([str(v) for v in django_js_reverse.VERSION]) | ||
json.dump(data, f, sort_keys=True, indent=2) | ||
f.write('\n'); | ||
f.truncate() |