Skip to content

Commit

Permalink
EDSC-4327: Fixing issue with @use and separating css to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorlang committed Jan 24, 2025
1 parent 3a1d074 commit 2516a28
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 110 deletions.
10 changes: 7 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
.codecov.yml
.eslintignore
.eslintrc
.github
.github/workflows/ci.yml
.nvmrc
.nyc_output
.snyk
.travis
.travis.yml
babel.config.js
bin
coverage
cypress
cypress.config.js
cypress.json
cypress.webpack.config.js
edsc-*
example
source.tgz
src
tmp
webpack.config.js
.codecov.yml
.github/workflows/ci.yml
.snyk
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@ For the jQuery version of this plugin see [this branch](https://github.com/nasa/

## Installation

npm install @edsc/echoforms
```console
npm install @edsc/echoforms
```

## Usage

After installing you can use the component in your code.
### Import the required css

The `styles.css` file must be loaded separately from the `node_modules/@edsc-echoforms/dist` directory.

```javascript
import '@edsc/echoforms/dist/styles.css'
```

### Use the EDSCEchoform component

The `EDSCEchoforms` React component is imported from the `@edsc/echoforms` module. When using the component, the `form`, `onFormModelUpdated`, and `onFormIsValidUpdated` are required. See the Props section below for more information.

```javascript
import EDSCEchoform from '@edsc/echoforms'
Expand Down Expand Up @@ -53,15 +65,21 @@ onFormIsValidUpdated | Function | true | | Callback function that returns a Bool

To compile:

npm install
```console
npm install
```

To start the example project for local testing:

npm start
```console
npm start
```

To run the tests:

npm test
```console
npm test
```

## Contributing

Expand Down
11 changes: 3 additions & 8 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const webpack = require('webpack')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

Expand Down Expand Up @@ -39,17 +38,13 @@ module.exports = {
]
},
plugins: [
htmlWebpackPlugin,
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
stream: false
})
htmlWebpackPlugin
],
resolve: {
extensions: ['.js', '.jsx'],
fallback: {
buffer: require.resolve('buffer'),
stream: require.resolve('stream-browserify')
buffer: false,
stream: false
}
},
devtool: 'source-map',
Expand Down
Loading

0 comments on commit 2516a28

Please sign in to comment.