Skip to content

Commit

Permalink
Merge pull request #111 from qlik-oss/tsm/rename-pkg
Browse files Browse the repository at this point in the history
chore: rename package
  • Loading branch information
Caele authored Nov 16, 2023
2 parents 48f90f2 + 927f1ef commit ca1248d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 83 deletions.
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;

0 comments on commit ca1248d

Please sign in to comment.