Skip to content

Commit

Permalink
Merge branch 'release/v1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
agung2001 committed Dec 25, 2022
2 parents 96ac618 + d7cdb8a commit 3304df3
Show file tree
Hide file tree
Showing 26 changed files with 6,582 additions and 908 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
assets/build/**/*.js
assets/vendor/**/*.js
assets/components/**/main.js
assets/components/**/rollup.config.js
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"env": {
"browser": true,
"es6": true,
"amd": true,
"node": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"requireConfigFile": false,
"babelOptions": {
"babelrc": false,
"configFile": false
}
},
"plugins": ["svelte3"],
"extends": ["eslint:recommended"],
"overrides": [
{
"files": ["assets/components/**/*.svelte"],
"processor": "svelte3/svelte3"
}
],
"rules": {
// ...
}
}
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ""
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"plugins": ["prettier-plugin-svelte"]
}
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ There are many ways to contribute to this repo. Here's a few ideas to get starte

- Simply give a 🌟 stars to this repo.
- 🤠 Add your name to list who uses this repository into [DISTRO](DISTRO.md).
- Find a 🐛 bug and report as an issue. Please report a single bug per issue.

## 📝 License

By contributing to Svelte, you agree that your contributions will be licensed under its [MIT license](LICENSE).
- Find a 🐛 bug and report as an issue. Please report a single bug per issue.
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
FROM nginx:latest

# Packages
RUN apt-get update && apt-get install -y \
git
RUN apt-get update && apt-get install -yq \
git \
curl

# Install NodeJS
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs

# fix npm - not the latest version installed by apt-get
RUN npm install -g npm

# Directories and Files
RUN rm -rf /usr/share/nginx/html/*
RUN git clone https://github.com/agung2001/agung2001.github.io.git /usr/share/nginx/html
WORKDIR /usr/share/nginx/html

# NPM Install
RUN npm i --force
RUN node index.js
RUN npx grunt

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
173 changes: 85 additions & 88 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,101 +1,98 @@
/** Load Javascript Library */
const path = require("path");

/**
* Components Scripts
* */
const components = ['content'];
const components = ['content']
const getShellComponents = () => {
let shell = {};
components.map((c) => {
let command = { command: `npx rollup -c assets/components/${c}/rollup.config.js` };
shell[`rollup_component_${c}`] = command;
});
return shell;
};
let shell = {}
components.map((c) => {
let command = {
command: `npx rollup -c assets/components/${c}/rollup.config.js`,
}
shell[`rollup_component_${c}`] = command
})
return shell
}
const getWatcherComponents = () => {
let watcher = {};
components.map((c) => {
let FilesTasks = {
files: [
`assets/components/${c}/**/*.js`,
`assets/components/${c}/**/*.svelte`,
],
tasks: [`build-component-${c}`, 'build-css']
};
watcher[`component_${c}`] = FilesTasks;
});
return watcher;
};

module.exports = function(grunt) {
let watcher = {}
components.map((c) => {
let FilesTasks = {
files: [
`assets/components/${c}/**/*.js`,
`assets/components/${c}/**/*.svelte`,
],
tasks: [`build-component-${c}`, 'build-css'],
}
watcher[`component_${c}`] = FilesTasks
})
return watcher
}

/** Configuration */
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
module.exports = function (grunt) {
/** Configuration */
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

/** Compile TailwindCSS - Cross Platform */
shell: {
...getShellComponents(),
nodesandedges: { command: 'node index.js'},
npm_tailwind: { command:
`npx tailwindcss build assets/css/tailwind/style.css -o assets/build/css/tailwind.min.css --silent && ` +
`node tailwindcsssupport.js`
}
},

/** CSS Minify */
cssmin: {
options: {
mergeIntoShorthands: false,
roundingPrecision: -1
},
target: {
files: {
"assets/build/css/tailwind.min.css" : "assets/build/css/tailwind.min.css"
}
}
},
/** Compile TailwindCSS - Cross Platform */
shell: {
...getShellComponents(),
nodesandedges: { command: 'node index.js' },
npm_tailwind: {
command:
`npx tailwindcss build assets/css/tailwind/style.css -o assets/build/css/tailwind.min.css --silent && ` +
`node tailwindcsssupport.js`,
},
},

/** Configure watch task */
watch: {
options: {
livereload: true,
},
config: {
files: [
'config.json'
],
tasks: ['build']
},
css: {
files: [
'assets/css/**/*.scss',
'assets/css/**/*.css',
'index.html'
],
tasks: ['build-css']
},
...getWatcherComponents(),
/** CSS Minify */
cssmin: {
options: {
mergeIntoShorthands: false,
roundingPrecision: -1,
},
target: {
files: {
'assets/build/css/tailwind.min.css':
'assets/build/css/tailwind.min.css',
},
});
},
},

/** Load Plugin */
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
/** Configure watch task */
watch: {
options: {
livereload: true,
},
config: {
files: ['config.json'],
tasks: ['build'],
},
css: {
files: ['assets/css/**/*.scss', 'assets/css/**/*.css', 'index.html'],
tasks: ['build-css'],
},
...getWatcherComponents(),
},
})

/** Component */
let componentsID = [];
components.map((c) => {
componentsID.push(`build-component-${c}`);
grunt.registerTask(`build-component-${c}`, [ `shell:rollup_component_${c}` ]);
});
/** Load Plugin */
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-cssmin')

/** Register Tasks */
grunt.registerTask('build-css', ['shell:npm_tailwind', 'cssmin']);
grunt.registerTask('build-js', [ ...componentsID ]);
grunt.registerTask('build', ['build-css', 'build-js']);
grunt.registerTask('default', ['build-css', 'build-js', 'shell:nodesandedges']);
/** Component */
let componentsID = []
components.map((c) => {
componentsID.push(`build-component-${c}`)
grunt.registerTask(`build-component-${c}`, [`shell:rollup_component_${c}`])
})

};
/** Register Tasks */
grunt.registerTask('build-css', ['shell:npm_tailwind', 'cssmin'])
grunt.registerTask('build-js', [...componentsID])
grunt.registerTask('build', ['build-css', 'build-js'])
grunt.registerTask('default', [
'build-css',
'build-js',
'shell:nodesandedges',
])
}
Loading

0 comments on commit 3304df3

Please # to comment.