Skip to content

Commit

Permalink
fix: export interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
omariosouto committed Aug 1, 2022
1 parent c862216 commit 57efd0f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { StyleSheet, ResponsiveProperty } from "@lib/stylesheet/stylesheet";
export { default as parseStyleSheet } from "@lib/parse-stylesheet/parse-stylesheet";
export { breakpoints, Breakpoints } from "@lib/breakpoints/breakpoints";
export { StyleSheet, ResponsiveProperty } from "@lib/stylesheet/stylesheet";
1 change: 1 addition & 0 deletions lib/stylesheet/stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { ResponsiveProperty } from "./responsive-property";

export { ResponsiveProperty } from "./responsive-property";

export interface StyleSheet {
// [box-model]
height?: height;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"dependencies": {},
"devDependencies": {
"@typescript-eslint/parser": "^5.31.0",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-private-property-in-object": "^7.16.5",
"@babel/preset-env": "7.16.4",
Expand All @@ -44,14 +43,15 @@
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "20.0.0",
"@rollup/plugin-node-resolve": "13.0.4",
"@rollup/plugin-typescript": "8.2.5",
"@rollup/plugin-typescript": "^8.3.4",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/commit-analyzer": "8.0.1",
"@semantic-release/git": "9.0.0",
"@semantic-release/github": "7.0.7",
"@semantic-release/npm": "7.0.5",
"@semantic-release/release-notes-generator": "9.0.1",
"@types/jest": "^28.1.6",
"@typescript-eslint/parser": "^5.31.0",
"eslint": "8.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.6.0",
Expand Down
53 changes: 27 additions & 26 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-var-requires */
import path from 'path';
import { execSync } from 'child_process';
import alias from '@rollup/plugin-alias';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import external from 'rollup-plugin-peer-deps-external';
import dts from 'rollup-plugin-dts';
import path from "path";
import { execSync } from "child_process";
import alias from "@rollup/plugin-alias";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
import typescript from "@rollup/plugin-typescript";
import external from "rollup-plugin-peer-deps-external";
import dts from "rollup-plugin-dts";

const packageJson = require('./package.json');
const packageJson = require("./package.json");

const extensions = ['.ts', '.tsx', '.json'];
const extensions = [".ts", ".tsx", ".json"];

const SKNBBuildEnd = (options = {}) => {
const { hook = 'generateBundle' } = options;
const { hook = "generateBundle" } = options;
return {
name: 'skn-build-end',
name: "skn-build-end",
[hook]: async () => {
execSync('[ -d dist ] || mkdir dist');
execSync("[ -d dist ] || mkdir dist");

const cmdExportTypes = 'yarn export:types';
const cmdExportTypes = "yarn export:types";
console.log(`RUN: ${cmdExportTypes}`);
execSync(cmdExportTypes);
console.log(`DONE: ${cmdExportTypes}`);
Expand All @@ -30,20 +30,20 @@ const SKNBBuildEnd = (options = {}) => {

export default [
{
input: 'lib/index.ts',
input: "lib/index.ts",
external: (id) => {
return /^react|styled-jsx|next/.test(id);
},
output: [
{
file: packageJson.main,
format: 'cjs',
format: "cjs",
sourcemap: true,
name: packageJson.name,
},
{
file: packageJson.module,
format: 'esm',
format: "esm",
sourcemap: true,
},
],
Expand All @@ -52,9 +52,9 @@ export default [
alias({
entries: [
{
find: '@lib',
find: "@lib",
replacement: () => {
return path.resolve(__dirname, 'lib');
return path.resolve(__dirname, "lib");
},
},
],
Expand All @@ -63,26 +63,27 @@ export default [
jsnext: true,
extensions,
}),
typescript(),
commonjs(),
babel({
babelHelpers: 'inline',
exclude: 'node_modules/**',
babelHelpers: "inline",
exclude: "node_modules/**",
extensions,
}),
SKNBBuildEnd(),
],
},
{
input: 'types/lib/index.d.ts',
output: [{ file: packageJson.types, format: 'esm' }],
input: "types/lib/index.d.ts",
output: [{ file: packageJson.types, format: "esm" }],
external: [/\.css$/],
plugins: [
alias({
entries: [
{
find: '@lib',
find: "@lib",
replacement: () => {
return path.resolve(__dirname, 'types', 'lib');
return path.resolve(__dirname, "types", "lib");
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1628,10 +1628,10 @@
is-module "^1.0.0"
resolve "^1.19.0"

"@rollup/plugin-typescript@8.2.5":
version "8.2.5"
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.2.5.tgz#e0319761b2b5105615e5a0c371ae05bc2984b7de"
integrity sha512-QL/LvDol/PAGB2O0S7/+q2HpSUNodpw7z6nGn9BfoVCPOZ0r4EALrojFU29Bkoi2Hr2jgTocTejJ5GGWZfOxbQ==
"@rollup/plugin-typescript@^8.3.4":
version "8.3.4"
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.3.4.tgz#45cdc0787b658b37d0362c705d8de86bc8bc040e"
integrity sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
resolve "^1.17.0"
Expand Down

1 comment on commit 57efd0f

@vercel
Copy link

@vercel vercel bot commented on 57efd0f Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.