Skip to content

Commit

Permalink
fix docz issue
Browse files Browse the repository at this point in the history
  • Loading branch information
amila-t-kumarasekara committed Jul 4, 2024
1 parent c222db3 commit ad4ea27
Show file tree
Hide file tree
Showing 9 changed files with 12,923 additions and 11,035 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: Node.js Package
on:
push:
branches:
- main
- master
release:
types: [created]
types: [published]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
Expand All @@ -33,4 +36,4 @@ jobs:
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_GITHUB_TOKEN}}
10 changes: 5 additions & 5 deletions doczrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import path from 'path'
import pkg from './package.json';
const path = require('path');
const pkg = require('./package.json');

const libName = pkg.name;

export default {
module.exports = {
ignore: ['README.md', 'changelog.md', 'CODE_OF_CONDUCT.md', 'contributing.md', 'LICENSE.md'],
//src: './src',
// src: './src',
dest: './demo',
port: 8888,
hashRouter: true,
Expand Down Expand Up @@ -83,4 +83,4 @@ export default {
// },
// }
// },
}
};
4 changes: 2 additions & 2 deletions libName.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import pkg from './package.json';
export default pkg.name;
const pkg = require('./package.json');
module.exports = pkg.name;
85 changes: 42 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "react-carousel-elastic",
"version": "0.12.5",
"name": "react-carousel-elasticss",
"version": "0.13.0",
"description": "A flexible and responsive carousel component for react",
"author": "sag1v (Sagiv Ben Giat)",
"author": "Amila Kumarasekara",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.es.js",
"types": "./dist/index.d.ts",
"type": "module",
"jsnext:main": "dist/index.es.js",
"publishConfig": {
"registry": "https://registry.npmjs.org"
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
Expand All @@ -20,35 +21,33 @@
"npm": ">=5"
},
"scripts": {
"start": "concurrently -r -k -s all \"docz dev\" \"yarn run lint:watch\"",
"start": "concurrently -r -k -s all \"yarn run lint:watch\"",
"demo": "concurrently -r -k -s all \"rollup --config rollup.config.demo.js --watch\" \"yarn run lint:watch\"",
"lint:fix": "eslint src/* --fix",
"lint:watch": "esw --watch --fix src/*",
"test": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
"prebuild": "yarn run lint:fix",
"build": "rollup -c",
"build-doc": "docz build",
"deploy-doc": "gh-pages -d demo"
"build": "rollup -c"
},
"lint-staged": {
"*.js": "eslint src/. --fix"
},
"dependencies": {
"classnames": "^2.2.6",
"react-only-when": "^1.0.2",
"@uiw/react-only-when": "^2.0.2",
"classnames": "^2.3.2",
"react-swipeable": "^7.0.1",
"resize-observer-polyfill": "1.5.1"
},
"peerDependencies": {
"prop-types": "^15.5.4",
"prop-types": "^15.8.1",
"react": "^16.12.0 || ^17 || ^18",
"react-dom": "^16.12.0 || ^17 || ^18",
"styled-components": "^5.1.0"
"styled-components": "^6.1.1"
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-external-helpers": "^7.0.0",
"@babel/core": "^7.24.7",
"@babel/plugin-external-helpers": "^7.23.3",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.22.5",
Expand All @@ -65,49 +64,49 @@
"@babel/plugin-proposal-throw-expressions": "^7.22.5",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.3.4",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.18.6",
"@cfaester/enzyme-adapter-react-18": "^0.7.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-replace": "^5.0.2",
"@sabertazimi/react-scripts": "^5.21.2",
"babel-eslint": "^9.0.0",
"concurrently": "^4.1.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"docz": "^2.3.1",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.15.7",
"eslint": "5.12.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-react": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.32.2",
"eslint": "8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-config-standard-react": "^13.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-standard": "5.0.0",
"eslint-watch": "^6.0.1",
"gatsby-plugin-google-analytics": "^2.1.34",
"gh-pages": "^5.0.0",
"husky": "^4.3.0",
"lint-staged": "^10.5.2",
"prettier": "1.14.2",
"prettier-eslint": "^15.0.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-resizable": "^1.7.5",
"react-scripts": "^2.1.8",
"react-test-renderer": "^16.5.2",
"rollup": "^2.0.0",
"eslint-watch": "^8.0.0",
"gatsby-plugin-google-analytics": "^5.12.0",
"gh-pages": "^6.1.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "3.1.1",
"prettier-eslint": "^16.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-resizable": "^3.0.5",
"react-test-renderer": "^18.2.0",
"rollup": "^4.18.0",
"rollup-plugin-alias": "^2.2.0",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-serve": "^2.0.2",
"rollup-plugin-url": "^3.0.1",
"styled-components": "^5.1.0"
"styled-components": "^5.1.0",
"typescript": "^5.3.3"
},
"files": [
"dist"
Expand All @@ -129,4 +128,4 @@
"resolutions": {
"ansi-styles": "^3.2.0"
}
}
}
32 changes: 17 additions & 15 deletions rollup.config.demo.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import babel from "rollup-plugin-babel";
import commonjs from "rollup-plugin-commonjs";
import postcss from "rollup-plugin-postcss";
import resolve from "rollup-plugin-node-resolve";
import url from "rollup-plugin-url";
import alias from "rollup-plugin-alias";
import serve from "rollup-plugin-serve";
import replace from "@rollup/plugin-replace";
import livereload from 'rollup-plugin-livereload'
const babel = require("@rollup/plugin-babel").default;
const commonjs = require("rollup-plugin-commonjs");
const postcss = require("rollup-plugin-postcss");
const resolve = require("rollup-plugin-node-resolve");
const url = require("rollup-plugin-url");
const alias = require("rollup-plugin-alias");
const serve = require("rollup-plugin-serve");
const replace = require("@rollup/plugin-replace");
const livereload = require("rollup-plugin-livereload");

import libName from "./libName";
const libName = require("./libName");

import * as ReactNamedExports from 'react';
import * as ReactIsNamedExports from 'react-is';
const ReactNamedExports = require('react');
const ReactIsNamedExports = require('react-is');

export default {
module.exports = {
input: `demoApp/src/index.js`,
output: [
{
Expand All @@ -25,9 +25,11 @@ export default {
],
plugins: [
alias({
"react-elastic-carousel": `src/${libName}/index.js`,
entries: {
"react-elastic-carousel": `src/${libName}/index.js`,
}
}),
//external(),
// external(),
postcss({
modules: false,
}),
Expand Down
7 changes: 4 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import babel from 'rollup-plugin-babel';
import babel from '@rollup/plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import copy from "rollup-plugin-copy";
import external from "rollup-plugin-auto-external";
Expand All @@ -7,9 +7,9 @@ import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import alias from 'rollup-plugin-alias';

import pkg from './package.json'
import pkg from './package.json' assert { type: 'json' };

import libName from './libName';
const libName = "react-elastic-carousel";

export default {
input: `src/${libName}/index.js`,
Expand Down Expand Up @@ -37,6 +37,7 @@ export default {
url(),
babel({
exclude: 'node_modules/**',
babelHelpers: "external",
plugins: [ '@babel/external-helpers' ]
}),
resolve(),
Expand Down
2 changes: 1 addition & 1 deletion src/react-elastic-carousel/components/Carousel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Children } from "react";
import PropTypes from "prop-types";
import ResizeObserver from "resize-observer-polyfill";
import Only from "react-only-when";
import Only from "@uiw/react-only-when";
import Track from "./Track";
import Arrow from "./Arrow";
import consts from "../consts";
Expand Down
2 changes: 1 addition & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import Adapter from "@cfaester/enzyme-adapter-react-18";

configure({ adapter: new Adapter() });
Loading

0 comments on commit ad4ea27

Please sign in to comment.