minor: initial commit

parents
Pipeline #10561 passed with stage
in 53 seconds
{
"plugins": ["transform-commonjs"],
"comments": false
}
\ No newline at end of file
/node_modules
dist
\ No newline at end of file
---
image: node:12
stages:
- release
publish:
stage: release
before_script:
- npm install -g semantic-release@v17.1 @semantic-release/gitlab@6.0.5
- git checkout $CI_COMMIT_REF_NAME
- npm ci --cache .npm --prefer-offline
script:
- echo "const path = \"https://cdn.skypack.dev/@startinblox/component-newsboard@$(semantic-release --dry-run | grep -oP 'Published release \K.*? ' | sed 's/ *$//g')\";module.exports = path;" > src/path.js
- npm run build
- semantic-release
only:
- master
- beta
tags:
- deploy
# Solid Newsboard
...
## How to use
...
### Parameters
...
## Developpers
Installation:
```bash
npm install
```
Build with:
```bash
npm run build
```
Watch files & rebuild on change with this command:
```bash
npm run watch
```
const path = require('./src/path.js');
const sass = require('sass');
const fs = require('fs');
sass.render({
file: 'src/styles/index.scss',
outFile: 'dist/index.css',
}, function(error, result) {
if(!error){
fs.mkdirSync('dist', { recursive: true });
fs.writeFile('dist/index.css', String(result.css).replace(/\/lib\/solid-directory/g, path), (e) =>{});
} else {
console.error(error);
}
});
\ No newline at end of file
This diff is collapsed.
{
"name": "@startinblox/component-newsboard",
"version": "0.0.0",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "https://git.startinblox.com/components/solid-newsboard.git"
},
"author": "startinblox",
"license": "MIT",
"release": {
"branches": [
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "major",
"release": "major"
},
{
"type": "minor",
"release": "minor"
},
{
"type": "*",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/gitlab",
"@semantic-release/npm"
]
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"babel-plugin-transform-commonjs": "^1.1.6",
"copyfiles": "^2.3.0",
"npm-run-all": "^4.1.5",
"sass": "^1.32.5"
},
"scripts": {
"build": "run-p copy:* build:*",
"build:css": "node build-scss.js",
"build:js": "babel \"src/*.js\" --out-dir dist/",
"build:i18n": "copyfiles -u 2 src/locales/*.json dist/locales",
"copy:image": "copyfiles -u 2 src/assets/* dist/assets && copyfiles -u 2 src/assets/**/* dist/assets",
"watch": "run-p copy:* watch:*",
"watch:css": "npm run build:css && npm run build:css -- -w",
"watch:js": "babel --watch \"src/*.js\" --out-dir dist/",
"watch:i18n": "npm run build:i18n && npm run build:i18n -- -w"
},
"devDependencies": {}
}
import SolidNewsboard from './solid-newsboard.js';
import ComponentPath from './path.js';
import { Helpers } from "https://cdn.skypack.dev/@startinblox/core@0.16";
Helpers.importCSS(ComponentPath+'/dist/index.css?min');
export {
SolidNewsboard
}
{
"some.translation.key": "Here's the newsboard!"
}
\ No newline at end of file
{
"some.translation.key": "¡Aquí está el newsboard!"
}
{
"some.translation.key": "Voici le newsboard!"
}
\ No newline at end of file
const path = "/lib/solid-newsboard";
module.exports = path;
import {
SolidTemplateElement
} from "https://cdn.skypack.dev/@startinblox/core@0.16";
import ComponentPath from './path.js';
export default class SolidNewsboard extends SolidTemplateElement {
constructor() {
super();
this.setTranslationsPath(`${ComponentPath}/dist/locales`);
if (window.hubl) {
this.localize = (key) => {
return window.hubl.intl.t("newsboard." + key) || this.strings[key] || key;
}
}
}
static get propsDefinition() {
return {
dataSrc: "data-src",
uniq: "uniq"
};
}
template({
dataSrc,
uniq = Math.random().toString(16).slice(2)
}) {
/*
`dataSrc` => URL du container à consommer, fournit par l'application
`uniq` => Permet l'usage du composant plusieurs fois sur la même page, à utiliser pour distinguer les eventuels `id`
*/
return `
<div>
<h2 class="margin-left-xsmall text-xlarge text-bold text-color-heading text-uppercase">${this.localize('some.translation.key')}</h2>
</div>
`;
}
}
customElements.define("solid-newsboard", SolidNewsboard);
\ No newline at end of file
solid-newsboard {
h2 {
color: "limegreen";
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment