Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new dist structure #42

Merged
merged 1 commit into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Expand Up @@ -32,7 +32,6 @@
"zonesdb.js",
"generator.js",
"set-release.js",
"npm_dist/",
"dist/"
],
"rules": {}
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
@@ -1,4 +1,3 @@
package-lock.json linguist-generated=true -diff
dist/* linguist-generated=true -diff
npm_dist/**/* linguist-generated=true -diff
demo_assets/*/*.min.* linguist-generated=true -diff
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build-npm
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,6 @@ ZonesVzic
vzic
*.o
*~

# dist.
dist/
18 changes: 8 additions & 10 deletions Gruntfile.js
Expand Up @@ -45,7 +45,6 @@ module.exports = function (grunt) {
// cleans old built files
clean: {
oldBuildFiles: [
'npm_dist/',
'dist/',
'demo_assets/css/*.min.css',
'demo_assets/css/*.min.css.map',
Expand Down Expand Up @@ -79,30 +78,30 @@ module.exports = function (grunt) {
},
mjs_dist: {
src: 'src/tzlib.js',
dest: 'npm_dist/mjs/index.js',
dest: 'dist/mjs/index.js',
options: { process: (content) => prepareFinalFile(content, 'export') },
},
cjs_dist: {
src: 'src/tzlib.js',
dest: 'npm_dist/cjs/index.js',
dest: 'dist/cjs/index.js',
options: { process: (content) => prepareFinalFile(content, 'module.exports =') },
},
},
'file-creator': {
'package.json ES Module': {
'npm_dist/mjs/package.json': function (fs, fd, done) {
'dist/mjs/package.json': function (fs, fd, done) {
fs.writeSync(fd, '{ "type": "module" }');
done();
},
},
'package.json commonJS': {
'npm_dist/cjs/package.json': function (fs, fd, done) {
'dist/cjs/package.json': function (fs, fd, done) {
fs.writeSync(fd, '{ "type": "commonjs" }');
done();
},
},
'.eslintrc.json commonJS': {
'npm_dist/cjs/.eslintrc.json': function (fs, fd, done) {
'dist/cjs/.eslintrc.json': function (fs, fd, done) {
fs.writeSync(
fd,
'{ "extends": "../../.eslintrc.json", "env": { "node": true }, "plugins": ["commonjs"] }'
Expand All @@ -116,14 +115,14 @@ module.exports = function (grunt) {
options: {
compress: true,
mangle: true,
sourceMap: true,
sourceMap: false,
output: {
comments: 'some',
},
},
newBuild: {
files: {
'dist/tzlib.min.js': ['dist/tzlib.js'],
'dist/tzlib.js': ['dist/tzlib.js'],
'demo_assets/js/demopage.min.js': ['demo_assets/js/demopage.js'],
},
},
Expand All @@ -139,6 +138,5 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-version');

// Register task(s)
grunt.registerTask('default', ['clean', 'cssmin', 'copy:plain_dist', 'uglify']);
grunt.registerTask('npm', ['clean', 'cssmin', 'copy', 'file-creator', 'uglify']);
grunt.registerTask('default', ['clean', 'cssmin', 'copy', 'file-creator', 'uglify']);
};
1 change: 1 addition & 0 deletions Readme.md
Expand Up @@ -170,6 +170,7 @@ Licensed under [Apache-2.0](LICENSE).

## ⚡ Changelog (without minor changes and fixes)

- v1.5 : new dist structure
- v1.4 : further minification via data mapping
- v1.3 : bundle size optimization and API
- v1.2 : providing tzblock as array with separate tzid
Expand Down
3 changes: 1 addition & 2 deletions demo_assets/js/demopage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion demo_assets/js/demopage.min.js.map

This file was deleted.

209 changes: 0 additions & 209 deletions dist/tzlib.js

This file was deleted.

15 changes: 0 additions & 15 deletions dist/tzlib.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/tzlib.min.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion generator.js
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar TimeZones iCal Library
* ++++++++++++++++++++++++++++++++++++++
*
* Version: 1.4.2
* Version: 1.5.0
* Creator: Jens Kuerschner (https://jenskuerschner.de)
* Project: https://github.com/add2cal/timezones-ical-library
* License: Apache-2.0
Expand Down
8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -55,7 +55,7 @@
<script async defer data-website-id="f221953d-158e-46c9-88d1-3b05df00997a" src="./demo_assets/js/a.min.js" data-host-url="https://a.add-to-calendar-button.com" data-domains="tz.add-to-calendar-technology.com"></script>

<!-- load some basic css just for this demo page here -->
<link rel="stylesheet" href="./demo_assets/css/demopage.min.css?v=1.4.2">
<link rel="stylesheet" href="./demo_assets/css/demopage.min.css?v=1.5.0">

</head>
<body>
Expand Down Expand Up @@ -263,15 +263,15 @@ <h3>Background story</h3>
This page is hosted via "GitHub Pages". It includes some very basic analytics, that still preserves your anonymity and does not use any cookies. However, mind that the GitHub privacy policy applies additionally (<a target="_blank" rel="noopener" href="https://docs.github.com/en/github/site-policy/github-privacy-statement">click here for details</a>).
</p>
</div>
<div id="tiny-version">v1.4.2</div>
<div id="tiny-version">v1.5.0</div>

</div>


<!-- js stuff -->
<script type="application/javascript" src="./dist/tzlib.min.js?v=1.4.2"></script>
<script type="application/javascript" src="./dist/tzlib.min.js?v=1.5.0"></script>
<script type="application/javascript" src="./demo_assets/js/autocomplete.min.js"></script>
<script type="application/javascript" src="./demo_assets/js/demopage.min.js?v=1.4.2"></script>
<script type="application/javascript" src="./demo_assets/js/demopage.min.js?v=1.5.0"></script>

</body>
</html>