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

chore: rename package #111

Merged
merged 2 commits into from
Nov 16, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 41 additions & 38 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,52 @@ var pkg = require('./package.json');
var DIST = './dist';
var VERSION = process.env.VERSION || 'local-dev';

gulp.task('qext', function () {
var qext = {
name: 'P&L pivot',
type: 'visualization',
description: pkg.description + '\nVersion: ' + VERSION,
version: VERSION,
icon: 'pivot-table',
preview: 'qlik-smart-pivot.png',
keywords: 'qlik-sense, visualization',
author: pkg.author,
homepage: pkg.homepage,
license: pkg.license,
repository: pkg.repository,
dependencies: {
'qlik-sense': '>=5.5.x'
},
__next: true
};
if (pkg.contributors) {
qext.contributors = pkg.contributors;
}
var src = require('stream').Readable({
objectMode: true
});
src._read = function () {
this.push(new gutil.File({
cwd: '',
base: '',
path: pkg.name + '.qext',
contents: Buffer.from(JSON.stringify(qext, null, 4))
}));
this.push(null);
};
return src.pipe(gulp.dest(DIST));
gulp.task("qext", function () {
var qext = {
name: "P&L pivot",
type: "visualization",
description: pkg.description + "\nVersion: " + VERSION,
version: VERSION,
icon: "pivot-table",
preview: "qlik-smart-pivot.png",
keywords: "qlik-sense, visualization",
author: pkg.author,
homepage: pkg.homepage,
license: pkg.license,
repository: pkg.repository,
dependencies: {
"qlik-sense": ">=5.5.x",
},
__next: true,
};
if (pkg.contributors) {
qext.contributors = pkg.contributors;
}
var src = require("stream").Readable({
objectMode: true,
});
src._read = function () {
this.push(
new gutil.File({
cwd: "",
base: "",
path: "qlik-smart-pivot.qext",
contents: Buffer.from(JSON.stringify(qext, null, 4)),
})
);
this.push(null);
};
return src.pipe(gulp.dest(DIST));
});

gulp.task('clean', function(){
gulp.task("clean", function () {
return del([DIST], { force: true });
});

gulp.task('zip-build', function(){
return gulp.src(DIST + '/**/*')
.pipe(zip(`${pkg.name}_${VERSION}.zip`))
gulp.task("zip-build", function () {
return gulp
.src(DIST + "/**/*")
.pipe(zip(`qlik-smart-pivot_${VERSION}.zip`))
.pipe(gulp.dest(DIST));
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "qlik-smart-pivot",
"name": "@qlik/qlik-smart-pivot",
"version": "0.0.1",
"description": "Profit & Loss reporting with color and font customizations.",
"homepage": "",
Expand Down
9 changes: 1 addition & 8 deletions scripts/verify-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ set -o errexit

echo "Verifying built file count"

while read line; do
if [[ $line =~ ^\"name\": ]]; then
name=${line#*: \"}
name=${name%\"*}
fi
done < package.json

expected_file_count=$(($(find dist -type f | wc -l)-1))
zip_file_count=$(zipinfo dist/${name}_${VERSION}.zip | grep ^- | wc -l)
zip_file_count=$(zipinfo dist/qlik-smart-pivot_${VERSION}.zip | grep ^- | wc -l)

if [ "${expected_file_count}" -ne "${zip_file_count}" ]; then
# File count is incorrect
Expand Down
65 changes: 29 additions & 36 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,63 @@ console.log('Webpack mode:', MODE); // eslint-disable-line no-console

const config = {
devtool: DEVTOOL,
entry: ['./src/index.js'],
entry: ["./src/index.js"],
externals: {
jquery: {
amd: 'jquery',
commonjs: 'jquery',
commonjs2: 'jquery',
root: '_'
amd: "jquery",
commonjs: "jquery",
commonjs2: "jquery",
root: "_",
},
qlik: {
amd: 'qlik',
commonjs: 'qlik',
commonjs2: 'qlik',
root: '_'
}
amd: "qlik",
commonjs: "qlik",
commonjs2: "qlik",
root: "_",
},
},
mode: MODE,
module: {
rules: [
{
enforce: 'pre',
enforce: "pre",
exclude: /(node_modules|Library)/,
loader: 'eslint-loader',
loader: "eslint-loader",
options: {
failOnError: true
failOnError: true,
},
test: /\.(js|jsx)$/
test: /\.(js|jsx)$/,
},
{
exclude: /node_modules/,
test: /\.(js|jsx)$/,
use: {
loader: 'babel-loader',
loader: "babel-loader",
options: {
plugins: [
'@babel/plugin-transform-async-to-generator',
'@babel/plugin-proposal-class-properties'
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-proposal-class-properties",
],
presets: [
'@babel/preset-env',
'@babel/preset-react'
]
}
}
presets: ["@babel/preset-env", "@babel/preset-react"],
},
},
},
{
test: /.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
}
]
use: ["style-loader", "css-loader", "less-loader"],
},
],
},
output: {
filename: `${packageJSON.name}.js`,
libraryTarget: 'amd',
path: DIST
filename: "qlik-smart-pivot.js",
libraryTarget: "amd",
path: DIST,
},
plugins: [
new StyleLintPlugin({
files: '**/*.less'
})
]
files: "**/*.less",
}),
],
};

module.exports = config;
Loading