Changed back to prebuilt but this time it will build on install to allow theme.styl

Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-03-30 15:30:26 +02:00
parent 6c2b3466ba
commit 2569db42f8
6 changed files with 784 additions and 42 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@ node_modules/
*.js *.js
!src/dzeio/stylusUtils.js !src/dzeio/stylusUtils.js
*.d.ts *.d.ts
types/
!rollup.config.js
!src/stylus.d.ts !src/stylus.d.ts
!.storybook/*.js !.storybook/*.js
style.css style.css

View File

@ -2,8 +2,8 @@
"name": "@dzeio/components", "name": "@dzeio/components",
"version": "0.5.2", "version": "0.5.2",
"license": "MIT", "license": "MIT",
"main": "./src/index.mjs", "main": "./index.mjs",
"types": "./src/index.d.ts", "types": "./types/index.d.ts",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.16", "@babel/core": "^7.12.16",
"@babel/preset-env": "^7.12.16", "@babel/preset-env": "^7.12.16",
@ -21,10 +21,8 @@
"react-dom": "^17.0.1", "react-dom": "^17.0.1",
"react-feather": "^2.0.9", "react-feather": "^2.0.9",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",
"stylus": "^0.54.8",
"stylus-loader": "^4.3.3", "stylus-loader": "^4.3.3",
"ts-loader": "^8.0.17", "ts-loader": "^8.0.17",
"typescript": "^4.1.3",
"webpack": "^4.44.2" "webpack": "^4.44.2"
}, },
"peerDependencies": { "peerDependencies": {
@ -34,8 +32,16 @@
"react-feather": "^2.0.9" "react-feather": "^2.0.9"
}, },
"scripts": { "scripts": {
"storybook": "rm -rf src/dzeio/**/*.js && start-storybook -p 6006", "dev": "rm -rf src/dzeio/**/*.js && start-storybook -p 6006",
"build": "tsc && mv src/index.js src/index.mjs", "build": "rollup --config",
"prepublishOnly": "yarn build" "prepublishOnly": "yarn build",
"postinstall": "rollup --config"
},
"dependencies": {
"rollup": "^2.44.0",
"rollup-plugin-styles": "^3.14.1",
"rollup-plugin-typescript2": "^0.30.0",
"stylus": "^0.54.8",
"typescript": "^4.2.3"
} }
} }

27
rollup.config.js Normal file
View File

@ -0,0 +1,27 @@
import typescript from 'rollup-plugin-typescript2';
import styles from 'rollup-plugin-styles'
import pkg from './package.json';
export default [
{
input: 'src/index.ts',
external: ['ms'],
plugins: [
styles({
modules: true,
url: false,
autoModules: true,
mode: 'extract',
}),
typescript({useTsconfigDeclarationDir: true}), // so Rollup can convert TypeScript to JavaScript
],
output: [
{
file: pkg.main,
format: 'es',
assetFileNames: 'style.css'
}
]
}
];

View File

@ -1,3 +1,9 @@
/**
* Copyright (c) 2021
*
* @summary DZEIO Component Library
*/
import Box from './dzeio/Box' import Box from './dzeio/Box'
import Button from './dzeio/Button' import Button from './dzeio/Button'
import Checkbox from './dzeio/Checkbox' import Checkbox from './dzeio/Checkbox'

View File

@ -11,7 +11,7 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */ // "outFile": "./", /* Concatenate and emit output to single file. */
"declarationDir": "src", "declarationDir": "types",
// "outDir": "./dist", /* Redirect output structure to the directory. */ // "outDir": "./dist", /* Redirect output structure to the directory. */
// "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */ // "composite": true, /* Enable project compilation */

769
yarn.lock

File diff suppressed because it is too large Load Diff