Skip to content

Commit

Permalink
perf: update package config #171
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This commit updates the .npmignore package config to
reduce the scope of the packaged files and directories

This commit also removes the necessity of copying all the src files to a
dist dir and instead allows the src dir to be added to the package.
Consumers will have to update dir references from ./dist to ./src in
most import cases.

Processed files are still located in the ./dist dir.

Changes to be committed:
modified:   .github/workflows/testPublish.yml
modified:   .npmignore
modified:   README.md
modified:   package.json
  • Loading branch information
blackfalcon committed Sep 25, 2023
1 parent 70ff3b4 commit 4ca4e7d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run copy:fonts:dist
- run: npm run build
- run: npm run build:sassdoc

Expand All @@ -41,7 +40,6 @@ jobs:
with:
node-version: 18
- run: npm ci
- run: npm run copy:fonts:dist
- run: npm run build
- run: npm run build:sassdoc
- uses: cycjimmy/semantic-release-action@v3
Expand Down
18 changes: 15 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
.gitignore
.sasslintrc
.stylelintrc
.travis.yml

# Directories
scripts/
test/
demo/
docs/
tests/
results/
documents/

# ignore docs
*.md

# ignore src
src/**/*
src/fonts/
src/auroElement/
src/scripts/

# overrides
!CHANGELOG.md
!README.md
39 changes: 10 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ npm i @aurodesignsystem/webcorestylesheets
There are no core files to import, rather WCSS is an à la carte solution allowing for users to import what they want and when they want it. In most cases you can simply import the Sass file as illustrated below:

```scss
@import "~@aurodesignsystem/webcorestylesheets/dist/ ... "
@import "~@aurodesignsystem/webcorestylesheets/src/ ... "
```

### Tokens Dependency
Expand All @@ -35,7 +35,7 @@ WCSS uses Sass and has a dependency on the `SCSSVariables.scss` file from [Desig

```scss
@import "~@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables";
@import "~@aurodesignsystem/webcorestylesheets/dist/ ... ";
@import "~@aurodesignsystem/webcorestylesheets/src/ ... ";
```

### Install the essentials
Expand All @@ -44,19 +44,19 @@ While WCSS is an à la carte solution, there are things that should be considere

```scss
// baseline design tokens as Sass variables
@import "~@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables";
@import "~@aurodesignsystem/design-tokens/src/tokens/SCSSVariables";

// globally add the mixins so that any future reference will be addressed
@import '~@aurodesignsystem/design-tokens/dist/tokens/breakpoints';
@import '~@aurodesignsystem/design-tokens/src/tokens/breakpoints';

// it's typically best practice to load the @font-face rules prior to any reference of the custom web fonts
@import '~@aurodesignsystem/design-tokens/dist/tokens/fonts';
@import '~@aurodesignsystem/design-tokens/src/tokens/fonts';

// set a baseline browser normalize
@import '~@aurodesignsystem/design-tokens/dist/tokens/normalize';
@import '~@aurodesignsystem/design-tokens/src/tokens/normalize';

// essentials setup baseline primitive selectors for any UI development
@import '~@aurodesignsystem/design-tokens/dist/tokens/essentials';
@import '~@aurodesignsystem/design-tokens/src/tokens/essentials';
```

For an example of setting up a master file that imports all of WCSS's resources, see the [styleTest.scss](https://github.com/AlaskaAirlines/OrionWebCoreStyleSheets/blob/master/tests/styleTest.scss) in the project.
Expand All @@ -76,14 +76,9 @@ At a limited scale, some files have been pre-processed to CSS so that it can be

**API Note**: First supporting version `v2.9.0`

```
unpkg.com/:package@:version/:file
```

| resource | supports | CDN URL |
|---|---|---|
| essentials.scss<br>fonts.scss|Auro WCs|https://unpkg.com/@aurodesignsystem/webcorestylesheets@:version/dist/bundled/essentials.css|
| baseline.scss<br>fonts.scss|ODS WCs|https://unpkg.com/@aurodesignsystem/webcorestylesheets@:version/dist/bundled/baseline.css|
| resource | CDN URL |
|---|---
| essentials.scss<br>fonts.scss|https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/essentials.css|

## Development

Expand All @@ -96,17 +91,3 @@ If additional selectors or scenarios are needed, please update the `./scripts/te
Running the `serve` command will open the Sassdoc view. Please review all changes as Sassdoc produces all documentation.

WCSS fully supports idiomatic CSS, be sure to review the [auro docs site](https://auro.alaskaair.com/webcorestylesheets/idiomatic-css) for more information.

### Linters

Sass-Lint tests to ensure that any new code is compliant with the set-forward standard. Sass-Lint is run as a pre-commit hook in this project. No commits will be allowed unless all linter tests are passed.

If there is an error, this will generate a `.html` file at the root of the project. To view this generated file, run the following command:

```
$ open sass-lint.html
```

This should open the file in your default browser.

This file is ignored and will not be added to version control.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@
"stylelint-config-standard": "^22.0.0"
},
"scripts": {
"copy:files": "copyfiles -u 1 -V './src/**/_*.scss' './src/**/*.js' ./dist",
"copy:fonts:dist": "copyfiles -f -V './src/fonts/*.*' ./dist/fonts",
"copy:files": "copyfiles -u 1 -V './src/auroElement/**/*' ./dist",
"css:lint": "stylelint './results/css/*.css'",
"scss:lint": "stylelint './src/**/*.scss'",
"build": "npm-run-all test build:sassdoc build:sass:demo copy:files build:sass:test build:sass:essentials postinstall",
"build": "npm-run-all test build:sassdoc build:sass:demo build:sass:test build:sass:essentials copy:files postinstall",
"build:ci": "npm-run-all sweep build",
"build:dev": "npm-run-all scss:lint build:sass:test css:lint jest",
"build:sassdoc": "sassdoc ./src -d ./docs && node scripts/sassdocTheme.js",
"build:sass:demo": "sass --no-source-map ./src/elementDemoStyles/:./dist/",
"build:sass:test": "sass --no-source-map ./tests/styleTest.scss:./results/css/testBuild.css",
"build:sass:essentials": "sass --no-source-map ./src/bundled/essentials.scss:./dist/bundled/essentials.css",
"sweep": "rm -rf ./dist ./results ./sassdoc && rm sass-lint.html",
"sweep": "rm -rf ./dist ./results ./sassdoc",
"postinstall": "node packageScripts/postinstall.js",
"jest": "jest",
"test": "npm-run-all scss:lint build:sass:test css:lint jest",
Expand Down

0 comments on commit 4ca4e7d

Please sign in to comment.