Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
fix: local build packages
Browse files Browse the repository at this point in the history
Signed-off-by: Cory Rylan <splintercode.cb@gmail.com>
  • Loading branch information
coryrylan committed Nov 24, 2020
1 parent b9a4062 commit 0ea7d5e
Show file tree
Hide file tree
Showing 42 changed files with 233 additions and 33,106 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
*.element.css.ts
*.global.css.ts
packages/core/src/styles/tokens/generated
packages/core/dist
packages/react/.cache
packages/react/coverage
packages/react/dist
.parcel-cache

# compiled output
/dist
/packages/**/dist
/tmp
/out-tsc
/.ng_build
Expand Down
2 changes: 1 addition & 1 deletion apps/core-angular-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@angular/platform-browser-dynamic": "~10.0.3",
"@angular/router": "~10.0.3",
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"normalize.css": "^8.0.1",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/core-angular-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"license": "MIT",
"dependencies": {
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"angular": "^1.8.0",
"normalize.css": "^8.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/core-angular-universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@angular/platform-server": "~10.0.3",
"@angular/router": "~10.0.3",
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"@nguniversal/express-engine": "^10.0.1",
"normalize.css": "^8.0.1",
"express": "^4.15.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/core-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"dependencies": {
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/react": "./packages/react/dist/react",
"@clr/core": "./dist/core",
"@clr/react": "./dist/react",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.1",
"@testing-library/user-event": "^7.2.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/core-ie/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "lite-server"
},
"dependencies": {
"@clr/core": "./packages/core/dist/core"
"@clr/core": "./dist/core"
},
"devDependencies": { }
}
2 changes: 1 addition & 1 deletion apps/core-parcel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"license": "MIT",
"dependencies": {
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"normalize.css": "^8.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/core-rollup-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@clr/city": "1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"normalize.css": "8.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/core-snowpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"normalize.css": "^8.0.1",
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core"
"@clr/core": "./dist/core"
},
"devDependencies": {
"snowpack": "^2.7.6"
Expand Down
2 changes: 1 addition & 1 deletion apps/core-vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@clr/city": "^1.1.0",
"@clr/core": "./packages/core/dist/core",
"@clr/core": "./dist/core",
"core-js": "^3.6.4",
"normalize.css": "^8.0.1",
"vue": "^2.6.11"
Expand Down
43 changes: 1 addition & 42 deletions apps/website/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,46 +102,5 @@ module.exports = {
changeOrigin: true,
},
},
},
configureWebpack: {
resolve: {
alias: {
// Note: paths to dist/core/register.js are from website root, not .vuepress/register.js
// Mono repo constraints mak us reference these assets that aren't installed directly in project node_modules
'@clr/core': path.resolve('../../dist/core'),
'@clr/core/alert': path.resolve('../../dist/core/alert'),
'@clr/core/badge': path.resolve('../../dist/core/badge'),
'@clr/core/button': path.resolve('../../dist/core/button'),
'@clr/core/checkbox': path.resolve('../../dist/core/checkbox'),
'@clr/core/datalist': path.resolve('../../dist/core/datalist'),
'@clr/core/date': path.resolve('../../dist/core/date'),
'@clr/core/file': path.resolve('../../dist/core/file'),
'@clr/core/forms': path.resolve('../../dist/core/forms'),
'@clr/core/icon': path.resolve('../../dist/core/icon'),
'@clr/core/input': path.resolve('../../dist/core/input'),
'@clr/core/modal': path.resolve('../../dist/core/modal'),
'@clr/core/password': path.resolve('../../dist/core/password'),
'@clr/core/radio': path.resolve('../../dist/core/radio'),
'@clr/core/range': path.resolve('../../dist/core/range'),
'@clr/core/search': path.resolve('../../dist/core/search'),
'@clr/core/select': path.resolve('../../dist/core/select'),
'@clr/core/tag': path.resolve('../../dist/core/tag'),
'@clr/core/textarea': path.resolve('../../dist/core/textarea'),
'@clr/core/time': path.resolve('../../dist/core/time'),
'@clr/core/toggle': path.resolve('../../dist/core/toggle'),
// @TODO Would like to be able to remove these
'ramda': path.resolve('../../packages/core/node_modules/ramda'),
'ramda/es/anyPass': path.resolve('../../packages/core/node_modules/ramda/es/anyPass.js'),
'ramda/es/equals': path.resolve('../../packages/core/node_modules/ramda/es/equals.js'),
'ramda/es/isNil': path.resolve('../../packages/core/node_modules/ramda/es/isNil.js'),
'ramda/es/includes': path.resolve('../../packages/core/node_modules/ramda/es/includes.js'),
'ramda/es/curryN': path.resolve('../../packages/core/node_modules/ramda/es/curryN.js'),
'ramda/es/path': path.resolve('../../packages/core/node_modules/ramda/es/path.js'),
'ramda/es/has': path.resolve('../../packages/core/node_modules/ramda/es/has.js'),
'ramda/es/is': path.resolve('../../packages/core/node_modules/ramda/es/is.js'),
'ramda/es/isEmpty': path.resolve('../../packages/core/node_modules/ramda/es/isEmpty.js'),
'ramda/es/without': path.resolve('../../packages/core/node_modules/ramda/es/without.js'),
},
},
},
}
};
6 changes: 3 additions & 3 deletions apps/website/.vuepress/theme/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* The full license information can be found in LICENSE in the root directory of this project.
*/

@import '../../../../../dist/clr-ui/clr-ui.min.css';
@import '../../../../../dist/core/global.min.css';
@import '../../../../../dist/core/styles/module.shims.min.css';
@import '~@clr/ui/clr-ui.min.css';
@import '~@clr/core/global.min.css';
@import '~@clr/core/styles/module.shims.min.css';

@import './a11y-light.scss';
@import './containers';
Expand Down
2 changes: 2 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"lint": "markdownlint '**/*.md' --ignore 'node_modules'"
},
"dependencies": {
"@clr/core": "./dist/core",
"@clr/ui": "./dist/clr-ui",
"@sentry/browser": "5.15.5",
"@sentry/integrations": "5.15.5",
"markdown-it-attrs": "^3.0.3",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"clean:modules": "del ./**/node_modules",
"clean": "del ./dist && yarn run schematics:clean",
"start": "yarn angular:dev:start",
"build": "npm-run-all build:ci build:website build:storybook:core",
"build": "npm-run-all build:ci build:website -p build:storybook:core build:storybook:angular angular:dev:build",
"build:ci": "npm-run-all clean format lint build:libs test",
"build:libs": "npm-run-all -p ui:build icons:build core:build -s angular:build schematics:build react:build",
"build:libs": "npm-run-all preinstall ui:build icons:build core:build react:build angular:build schematics:build",
"build:website": "yarn --cwd apps/website run build",
"build:storybook:angular": "yarn --cwd packages/angular run build-storybook",
"build:storybook:angular": "yarn --cwd packages/angular run storybook:build",
"build:storybook:core": "yarn --cwd packages/core run storybook:build",
"test": "npm-run-all -p angular:test core:test icons:test react:test eslint-rule:test",
"test:a11y": "node scripts/axe",
Expand Down Expand Up @@ -82,7 +82,7 @@
"react:build": "yarn --cwd packages/react run build",
"react:lint": "yarn --cwd packages/react run lint",
"react:test": "yarn --cwd packages/react run test",
"preinstall": "mkdir -p ./packages/core/dist/core/ && mkdir -p ./packages/react/dist/react/",
"preinstall": "yarn --cwd packages/core build:preinstall && yarn --cwd packages/react build:preinstall && yarn --cwd packages/ui build:preinstall && yarn --cwd packages/icons build:preinstall && yarn --cwd packages/angular build:preinstall",
"website:deploy": "scripts/website.sh",
"website:build": "yarn --cwd apps/website run build",
"website:storybook": "yarn --cwd packages/angular run start:storybook",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import '@clr/icons';
import { addDecorator, addParameters } from '@storybook/angular';
import { withCssResources } from '@storybook/addon-cssresources';
import darkTheme from '../dist/clr-ui/clr-ui-dark.min.css';
import darkTheme from '@clr/ui/clr-ui-dark.min.css';
import '!style-loader!css-loader!sass-loader!../src/styles.scss';

addDecorator(withCssResources); // Not sure why this is still needed. I thought SB6 got rid of need for decorators.
Expand Down
10 changes: 1 addition & 9 deletions packages/angular/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"extends": "../projects/dev/tsconfig.app.json",
"compilerOptions": {
"types": ["node"],
"paths": {
"@clr/core": ["./dist/core"],
"@clr/core/*": ["./dist/core/*"],
"@clr/icons": ["./dist/clr-icons"],
"@clr/icons/*": ["./dist/clr-icons/*"],
"@clr/angular": ["./dist/clr-angular"],
"@clr/angular/*": ["./dist/clr-angular/*"]
}
"types": ["node"]
},
"exclude": ["../src/test.ts", "../src/**/*.spec.ts", "../projects/**/*.spec.ts"],
"include": ["../src/stories/**/*"],
Expand Down
46 changes: 6 additions & 40 deletions packages/angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
Expand Down Expand Up @@ -118,43 +117,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"styles": ["projects/clr-angular/src/main.scss"],
"main": "projects/clr-angular/src/test.ts",
"tsConfig": "projects/clr-angular/tsconfig.spec.json",
"karmaConfig": "projects/clr-angular/karma.conf.js"
}
}
}
},
"clr-angular-dev": {
"projectType": "library",
"root": "projects/clr-angular",
"sourceRoot": "projects/clr-angular/src",
"prefix": "clr",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/clr-angular/tsconfig.lib.json",
"project": "projects/clr-angular/ng-package.dev.json"
},
"configurations": {
"production": {
"tsConfig": "projects/clr-angular/tsconfig.lib.prod.json"
}
},
"options": {
"sourceMap": {
"scripts": true,
"styles": true,
"vendor": true
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"styles": ["projects/clr-angular/src/main.scss"],
"styles": ["node_modules/@clr/ui/clr-ui.min.css"],
"main": "projects/clr-angular/src/test.ts",
"tsConfig": "projects/clr-angular/tsconfig.spec.json",
"karmaConfig": "projects/clr-angular/karma.conf.js"
Expand Down Expand Up @@ -207,7 +170,11 @@
"tsConfig": "projects/dev/tsconfig.app.json",
"aot": true,
"assets": ["projects/dev/src/favicon.ico", "projects/dev/src/assets"],
"styles": ["projects/dev/src/styles.scss", "projects/clr-angular/src/main.scss"],
"styles": [
"projects/dev/src/styles.scss",
"node_modules/@clr/ui/clr-ui.min.css",
"node_modules/@clr/icons/clr-icons.min.css"
],
"scripts": []
},
"configurations": {
Expand All @@ -221,7 +188,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
Expand Down
37 changes: 15 additions & 22 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"private": true,
"version": "4.0.0",
"scripts": {
"start": "ng build clr-angular-dev --watch",
"start:dev": "ng build clr-angular-dev --watch --prod",
"start:storybook": "stmux -w always -e ERROR -m beep,system [ \"yarn start:dev\" : \"sleep 25 && yarn storybook\" : \"yarn watch:scss\" ]",
"start": "ng build clr-angular --watch",
"start:dev": "ng build clr-angular --watch --prod",
"start:storybook": "stmux -w always -e ERROR -m beep,system [ \"yarn start:dev\" : \"sleep 25 && yarn storybook\" : \"yarn --cwd ../ui run build:watch\" ]",
"serve": "ng serve dev",
"serve:dark": "ng serve dev -c dark",
"storybook": "start-storybook -s .storybook/public -p 6006",
"storybook:build": "build-storybook -s .storybook/public -c .storybook -o ../../dist/website/storybook/angular --quiet",
"postinstall": "ngcc --create-ivy-entry-points && node ../../scripts/ngcc-clean",
"build": "npm-run-all build:ng build:package",
"build:package": "replace '@VERSION' $npm_package_version ../../dist/clr-angular/package.json",
"build:ng": "ng build clr-angular --prod",
"build:golden": "ng build clr-angular-dev --prod",
"postbuild:golden": "ts-api-guardian --out ./dist/golden/clr-angular.d.ts --stripExportPattern '^Çlr' ./dist/clr-angular/index.d.ts",
"clean:deps": "shx rm -rf ./dist/clr-icons ./dist/core",
"predev": "ng build clr-angular-dev --prod",
"build": "npm-run-all build:lib build:package build:update",
"build:preinstall": "mkdir -p ../../dist/clr-angular/ && cp ./projects/clr-angular/package.json ../../dist/clr-angular/",
"build:package": "replace '@VERSION' $npm_package_version ./dist/clr-angular/package.json",
"build:update": "node ../../scripts/update-local-packages.js /packages/angular/dist/clr-angular/package.json",
"build:lib": "ng build clr-angular --prod",
"dev": "ng build dev --prod --progress=false",
"dev:dark": "ng build dev -c dark --prod --progress=false",
"test": "npm-run-all test:unit test:golden",
"test:unit": "ng test clr-angular --watch false",
"test:unit:coverage": "ng test clr-angular --watch false --code-coverage",
"pretest:golden": "yarn build:golden",
"pretest:golden": "ts-api-guardian --out ./dist/golden/clr-angular.d.ts --stripExportPattern '^Çlr' ./dist/clr-angular/index.d.ts",
"test:golden": "diff -u golden/clr-angular.d.ts ./dist/golden/clr-angular.d.ts",
"test:watch": "ng test clr-angular --watch",
"test:watch:coverage": "ng test clr-angular --watch --code-coverage",
Expand All @@ -30,16 +30,7 @@
"lint:styles": "stylelint \"src/**/*.scss\" \"projects/**/*.scss\"",
"lint:fix": "eslint --fix -c .eslintrc.js \"src/**/*.ts\" \"projects/**/*.ts\" && stylelint --fix \"src/**/*.scss\" \"projects/**/*.scss\"",
"pregolden:fix": "yarn build:golden",
"golden:fix": "ts-api-guardian --out golden/clr-angular.d.ts --stripExportPattern '^Çlr' ./dist/clr-angular/index.d.ts",
"prestorybook": "yarn scss && yarn clean:deps && shx cp -r ../../dist/core ../../dist/clr-icons ./dist",
"storybook": "start-storybook -s .storybook/public -p 6006",
"prebuild-storybook": "yarn scss && yarn clean:deps && shx cp -r ../../dist/core ../../dist/clr-icons ./dist && yarn predev",
"build-storybook": "build-storybook -s .storybook/public .storybook -o ../../dist/website/storybook/angular",
"watch:scss": "chokidar \"projects/clr-angular/src/**/*.scss\" -c \"yarn scss\"",
"scss": "run-s scss:compile scss:prefix scss:optimize",
"scss:compile": "sass --source-map --precision=8 ./projects/clr-angular/src/main.scss dist/clr-ui/clr-ui.css; sass --source-map --precision=8 projects/clr-angular/src/dark-theme.scss dist/clr-ui/clr-ui-dark.css",
"scss:prefix": "postcss ./dist/clr-ui/clr-ui.css -o ./dist/clr-ui/clr-ui.css; postcss ./dist/clr-ui/clr-ui-dark.css -o ./dist/clr-ui/clr-ui-dark.css",
"scss:optimize": "csso -i ./dist/clr-ui/clr-ui.css -o ./dist/clr-ui/clr-ui.min.css -s file --no-restructure; csso -i ./dist/clr-ui/clr-ui-dark.css -o ./dist/clr-ui/clr-ui-dark.min.css -s file --no-restructure"
"golden:fix": "ts-api-guardian --out golden/clr-angular.d.ts --stripExportPattern '^Çlr' ./dist/clr-angular/index.d.ts"
},
"dependencies": {
"@angular/animations": "11.0.0",
Expand All @@ -50,8 +41,10 @@
"@angular/platform-browser": "11.0.0",
"@angular/platform-browser-dynamic": "11.0.0",
"@angular/router": "11.0.0",
"@clr/core": "./dist/core",
"@clr/icons": "./dist/clr-icons",
"@clr/ui": "./dist/clr-ui",
"css-vars-ponyfill": "2.3.1",
"@clr/core": "latest",
"rxjs": "6.5.4",
"tslib": "^2.0.0",
"zone.js": "0.10.3"
Expand Down
8 changes: 0 additions & 8 deletions packages/angular/projects/clr-angular/ng-package.dev.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/angular/projects/clr-angular/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../../dist/clr-angular",
"dest": "../../dist/clr-angular",
"lib": {
"entryFile": "src/public-api.ts",
"flatModuleFile": "clr-angular"
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/projects/clr-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"peerDependencies": {
"@angular/common": "^11.0.0",
"@angular/core": "^11.0.0",
"@clr/core": ">=4.0.0",
"@clr/ui": "@VERSION"
"@clr/core": "./dist/core",
"@clr/ui": "./dist/clr-ui"
},
"author": "Clarity Design System",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2020 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
Expand Down
Loading

0 comments on commit 0ea7d5e

Please sign in to comment.