From 4ca4e7dc4f1ea2fe70cf9efdbd5ef1f83d4016f7 Mon Sep 17 00:00:00 2001 From: Dale Sande Date: Wed, 20 Sep 2023 17:56:46 -0700 Subject: [PATCH] perf: update package config #171 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 --- .github/workflows/testPublish.yml | 2 -- .npmignore | 18 +++++++++++--- README.md | 39 ++++++++----------------------- package.json | 7 +++--- 4 files changed, 28 insertions(+), 38 deletions(-) diff --git a/.github/workflows/testPublish.yml b/.github/workflows/testPublish.yml index 7df72c9..3da911f 100644 --- a/.github/workflows/testPublish.yml +++ b/.github/workflows/testPublish.yml @@ -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 @@ -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 diff --git a/.npmignore b/.npmignore index 0aca650..b774095 100644 --- a/.npmignore +++ b/.npmignore @@ -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 diff --git a/README.md b/README.md index cf8a1bb..5b3f29d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. @@ -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
fonts.scss|Auro WCs|https://unpkg.com/@aurodesignsystem/webcorestylesheets@:version/dist/bundled/essentials.css| -| baseline.scss
fonts.scss|ODS WCs|https://unpkg.com/@aurodesignsystem/webcorestylesheets@:version/dist/bundled/baseline.css| +| resource | CDN URL | +|---|--- +| essentials.scss
fonts.scss|https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/essentials.css| ## Development @@ -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. diff --git a/package.json b/package.json index 1b0c74d..2e21853 100644 --- a/package.json +++ b/package.json @@ -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",