Commit 126c1a8a authored by Élodie Thiéblin's avatar Élodie Thiéblin

chore: use tsc for compilation instead of webpack

parent 11a957222183
Pipeline #36987 failed with stages
in 50 seconds
......@@ -7,4 +7,5 @@ npm-debug.log
lib/bs/
node_modules/
build/
_bundles/
\ No newline at end of file
_bundles/
lib/
This diff is collapsed.
......@@ -11,32 +11,25 @@
"Typescript"
],
"files": [
"build"
"lib"
],
"main": "./build/index.js",
"types": "./build/lib/index.d.ts",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"devDependencies": {
"copy-webpack-plugin": "^4.5.2",
"source-map-loader": "^0.2.3",
"ts-loader": "^4.4.2",
"typedoc": "^0.19.0",
"typescript": "^2.9.2",
"typescript-formatter": "^7.2.2",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1"
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
"prettier": "^2.2.1",
"typescript": "^4.1.3"
},
"scripts": {
"clean": "rm -rf build",
"format": "npx prettier --check ./src/**/*.{jsx,tsx,ts,js,css}",
"lint": "npx tsc --noEmit",
"build": "webpack",
"build:production": "NODE_ENV=production webpack",
"prepublishOnly": "NODE_ENV=production webpack",
"doc": "typedoc --mode modules --out build/docs --exclude '**/*.test.ts' 'src/'"
"clean": "rm -rf lib",
"format": "prettier --check ./src/**/*.{jsx,tsx,ts,js,css}",
"lint": "eslint ./src/**/*.{js,ts}",
"build": "tsc"
},
"author": "LOGILAB <contact@logilab.fr>",
"license": "LGPL-3.0",
"dependencies": {
"@logilab/sparqlutils": "0.0.1"
}
"license": "LGPL-3.0"
}
......@@ -9,9 +9,8 @@ export interface SparqlView {
export type View = SparqlView;
export interface ViewDescription {
name: string;
description: string;
entrypoint: string;
url: string;
}
......@@ -3,15 +3,13 @@
"outDir": "./lib/",
"sourceMap": true,
"declaration": true,
"noImplicitAny": true,
"strictNullChecks": true,
"skipLibCheck": true,
"module": "commonjs",
"target": "es6",
"lib": [ "es6", "dom" ],
"jsx": "react"
"strict": true
},
"include": [
"./src/**/*"
"./src"
],
}
{
"baseIndentSize": 0,
"indentSize": 2,
"tabSize": 2,
"indentStyle": 2,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false
}
{
"rules": {
"no-internal-module": true,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
],
"await-promise": true,
"curly": [true, "ignore-same-line"],
"deprecation": true,
"label-position": true,
"no-arg": true,
"no-conditional-assignment": true,
"no-duplicate-imports": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-reference-import": true,
"no-return-await": true,
"no-switch-case-fall-through": true,
"no-unused-expression": [
true,
"allow-fast-null-checks",
"allow-tagged-template"
],
"no-unused-variable": [true, { "ignore-pattern": "^_" }],
"no-var-keyword": true,
"radix": true,
"space-within-parens": [true, 0],
"triple-equals": [true, "allow-null-check"],
"use-isnan": true,
"eofline": true,
"no-trailing-whitespace": true,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"class-name": true,
"comment-format": [true, "check-space"],
"jsdoc-format": true,
"new-parens": true,
"no-angle-bracket-type-assertion": true,
"no-consecutive-blank-lines": true,
"no-floating-promises": true,
"no-misused-new": true,
"no-string-throw": true,
"no-unnecessary-qualifier": true,
"no-unnecessary-type-assertion": true,
"one-line": [
true,
"check-catch",
"check-finally",
"check-else",
"check-open-brace",
"check-whitespace"
],
"one-variable-per-declaration": true,
"quotemark": [true, "double", "avoid-escape", "jsx-double"],
"semicolon": [true, "always"],
"strict-type-predicates": true,
"strict-boolean-expressions": [true, "allow-undefined-union"],
"space-before-function-paren": [
true,
{
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}
],
"unified-signatures": true,
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock"
]
}
}
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = [
{
entry: './src/index.ts',
mode: isProd ? 'production' : 'development',
output: {
path: path.resolve(__dirname, 'build/'),
filename: 'index.js',
libraryTarget: 'umd',
library: 'libview',
umdNamedDefine: true,
},
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
module: {
rules: [
{test: /\.tsx?$/, loader: 'ts-loader'},
{enforce: 'pre', test: /\.js$/, loader: 'source-map-loader'},
],
},
plugins: [],
},
];
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