Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Commit 1001a0d

Browse files
author
Adam Zerella
authored
[ARCH] 01 - Sass lib -> src & Yarn workspaces (#603)
* First steps with yarn workspaces * Switched sass imports to read from src Setup yarn workspaces First attempt at modifying helper.js * Removed pancake folder * Upgraded babel and webpack * Updated circleci image and build process * Upgraded webpack ES6 for babel-loader Upgraded ES6 helper babel process * Commented out devDep checks, need to rewrite * Added node-module caching to circleci * Put restore_cache key in wrong order :'( * Removed pancake root key Gave module versions some love Updated circleci comments * Package formatting * Installed mocha/chai over jest, removed jest * Updated 50% of unit tests * Renamed packages -> components * Installed babel preset minify * added preset to .babelrc * updated README.md * Trailing process.exit for circleci * Updated autoprefixer tag to be inline with spec Trialing node direct script over yarn * Added mode flag to webpack config - creates warning in webpack 4 * Playing around with puppetter args and circle images * Removed debug flags, trying node image * Updated circleci image * Helper should read from src for file check and build to lib/ * Correct webpack config to reference babel-preset-minify as a plugin not preset * Removed all instances of babel-preset-minify * Various tweaks based on PR review * Added back missing spacing * Added back es5 name convention * Webpack formatting * Forgot es5 name convention * Dependency shuffling * Added back ES6 dep comment * Trailing why git thinks _deps is new * Updated webpack output location Reverted helper react.es5.js changes back Added gitignore for react/tests/dist Updated ES6 dependency imports to pancake root folder * Added nuke script for pancake/ * Temporary resolved yarn workspace building by pretending animate requires sass * Added missing sass: name false key to animate * Reverted pretending animate hass sass * Resolved root and core vulnerabilities * Added missing whitespace in core * Updated engines, removed verbose --pancake from animate * Added back webpack ./bundle.js -> bundle.js * Updated local install instructions for yarn and grammar * Updated FAQ notes for yarn * Updated auds.json from latest develop * Upgraded circle node images to latest lts
1 parent 6305ea2 commit 1001a0d

File tree

540 files changed

+19095
-218756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+19095
-218756
lines changed

.cfignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
# Node CircleCI 2.0 configuration file to DTA cloud 2.0
2-
31
version: 2
42
jobs:
53

6-
# DEPLOY-STAGING JOB
7-
# installing dependencies, building assets and deploying to staging
4+
# Installing dependencies, build and test.
85
build-and-test-auds:
96
docker:
10-
- image: circleci/node:8.12.0 # NodeLTS as of 10/2018
7+
- image: circleci/node:10.15.1
118
working_directory: ~/auds
129
steps:
1310
- checkout # get the files from the repo (why would you ever not want the files????)
11+
- restore_cache:
12+
keys:
13+
- v1-node-cache-{{ checksum "yarn.lock" }}
1414
- run:
1515
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
1616
name: Install packages for puppeteer
1717
command: sudo apt install -yq --no-install-recommends gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdbus-1-3 libgconf-2-4 libgtk-3-0 libnspr4 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxss1 libxtst6 fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils
1818
- run:
1919
name: Install dependencies
20-
command: npm install # duh
21-
- run:
22-
name: Bootstrap the packages
23-
command: npm run bootstrap # installing all dependencies of all packages
20+
command: yarn install # duh
21+
- save_cache:
22+
key: v1-node-cache-{{ checksum "yarn.lock" }}
23+
paths:
24+
- node_modules # Path globbing isn't supported :'(
2425
- run:
25-
name: Build all packages
26-
command: npm run build # installing all dependencies of all packages
26+
name: Build all components
27+
command: yarn build
2728
- run:
2829
name: Run all tests
29-
command: npm test
30+
command: yarn test
3031
- persist_to_workspace:
3132
root: ~/auds
3233
paths:
33-
- packages/*/tests/
34+
- components/*/tests/
3435
- .deploy/
3536
- index.html
3637

@@ -49,7 +50,7 @@ jobs:
4950
cp .deploy/nginx/mime.types site/
5051
cp .deploy/nginx/.htpasswd site/
5152
mv .deploy/nginx/nginx-staging.conf site/nginx.conf
52-
mv packages/ site/
53+
mv components/ site/
5354
mv index.html site/
5455
mv .deploy/manifest-staging.yml site/
5556
cd site/
@@ -71,7 +72,7 @@ jobs:
7172
cp .deploy/nginx/mime.types site/
7273
cp .deploy/nginx/.htpasswd site/
7374
mv .deploy/nginx/nginx-testing.conf site/nginx.conf
74-
mv packages/ site/
75+
mv components/ site/
7576
mv index.html site/
7677
mv .deploy/manifest-testing.yml site/
7778
cd site/
@@ -92,7 +93,7 @@ jobs:
9293
mkdir -p site/
9394
cp .deploy/nginx/mime.types site/
9495
mv .deploy/nginx/nginx-production.conf site/nginx.conf
95-
mv packages/ site/
96+
mv components/ site/
9697
mv index.html site/
9798
mv .deploy/manifest-production.yml site/
9899
cd site/

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ node_modules
99
validation-report.json
1010
validation-status.json
1111
*.css
12-
packages/*/tests/*/*.js
13-
!packages/*/tests/react/index.js
14-
!packages/*/tests/react/webpack.config.js
15-
packages/*/lib/
12+
components/*/tests/*/*.js
13+
components/*/tests/react/dist
14+
!components/*/tests/react/index.js
15+
!components/*/tests/react/webpack.config.js
16+
components/*/lib/
1617
npm-debug.log
1718
lerna-debug.log
1819
/index.html
20+
pancake

.templates/new-module/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The visual test: [-replace-URL-]
7272
## License
7373

7474
Copyright (c) Commonwealth of Australia.
75-
Licensed under [MIT](https://raw.githubusercontent.com/govau/design-system-components/packages/core/master/LICENSE).
75+
Licensed under [MIT](https://raw.githubusercontent.com/govau/design-system-components/components/core/master/LICENSE).
7676

7777

7878
**[⬆ back to top](#contents)**

.templates/new-module/package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
"build:pre": "node ../../scripts/helper.js precompile publish",
2727
"build:js": "node ../../scripts/helper.js compile",
28-
"build:react": "cd tests/react/ && webpack",
28+
"build:react": "cd tests/react/ && webpack --config webpack.config.js",
2929
"build": "npm run build:pre && npm run build:js && npm run build:react",
3030

3131
"serve": "browser-sync tests --files \"tests/**/*.html, tests/**/*.css, tests/**/*.js\"",
@@ -45,14 +45,14 @@
4545
"@gov.au/pancake-json"
4646
],
4747
"sass": {
48-
"path": "lib/sass/_module.scss",
48+
"path": "src/sass/_module.scss",
4949
"sass-versioning": true
5050
},
5151
"js": {
52-
"path": "lib/js/module.js"
52+
"path": "src/js/module.js"
5353
},
5454
"react": {
55-
"path": "lib/js/react.js"
55+
"path": "src/js/react.js"
5656
}
5757
}
5858
},
@@ -70,25 +70,24 @@
7070
"@gov.au/core": "^3.0.0"
7171
},
7272
"devDependencies": {
73-
"babel-core": "^6.26.0",
74-
"babel-loader": "^7.1.2",
75-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
76-
"babel-preset-es2015": "^6.24.1",
77-
"babel-preset-react": "^6.24.1",
78-
"babel-preset-stage-0": "^6.24.1",
79-
"browser-sync": "^2.18.13",
80-
"npm-run-all": "^4.1.2",
81-
"onchange": "^3.2.1",
73+
"@babel/core": "^7.2.2",
74+
"babel-loader": "^8.0.5",
75+
"@babel/preset-env": "^7.3.1",
76+
"@babel/preset-react": "^7.0.0",
77+
"browser-sync": "^2.26.3",
78+
"npm-run-all": "^4.1.5",
79+
"onchange": "^5.2.0",
8280
"react": "^16.1.1",
8381
"react-dom": "^16.1.1",
84-
"webpack": "^3.8.1"
82+
"webpack": "^4.29.0",
83+
"webpack-cli": "^3.2.1"
8584
},
8685
"files": [
8786
"lib/*"
8887
],
8988
"engines": {
90-
"node": ">=0.12.0",
91-
"npm": "^3.0.0"
89+
"node": "~10",
90+
"npm": "~6"
9291
},
9392
"repository": {
9493
"type": "git",
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//sass-versioning
2-
@import '../../../core/node_modules/sass-versioning/dist/_index.scss';
3-
2+
@import '../../../../node_modules/sass-versioning/dist/_index.scss';
43
//dependencies
5-
@import '../../../core/lib/sass/_module.scss';
4+
@import '../../../core/src/sass/_module.scss';
65

76
//this module
8-
@import '../../lib/sass/_module.scss';
7+
@import '../../src/sass/_module.scss';
98

109
//version check with sass-versioning
11-
@include versioning-check();
10+
// @include versioning-check();

.templates/new-module/src/sass/_globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $dependencies: (
1818
[replace-dependencies]
1919
);
2020

21-
@include versioning-add( $name, $version, $dependencies ); //adding dependencies to global scope
21+
// @include versioning-add( $name, $version, $dependencies ); //adding dependencies to global scope
2222

2323
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
2424
// GLOBAL VARIABLES
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"presets": ["react", ["es2015", { "modules": false }]],
3-
"plugins": ["transform-object-rest-spread"]
2+
"presets": ["@babel/preset-react", "@babel/preset-env"],
43
}

.templates/new-module/tests/react/webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
const path = require( 'path' );
2+
13
module.exports = {
24
entry: './index.js',
5+
mode: 'development',
36
output: {
47
filename: './bundle.js',
8+
path: path.resolve( __dirname )
59
},
610
module: {
711
rules: [
812
{
913
test: /\.js$/,
1014
exclude: /node_modules/,
11-
use: 'babel-loader',
15+
use: {
16+
loader: 'babel-loader',
17+
options: {
18+
presets: ['@babel/preset-env','@babel/preset-react'],
19+
}
20+
}
1221
},
1322
],
1423
},

.templates/new-module/tests/site/test.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import '../../src/sass/_dependencies.scss';
33

44
//testing includes
5-
// @import '../../../body/lib/sass/_module.scss';
5+
@import '../../../body/src/sass/_module.scss';
66

77
//styling all test files
88
@import '../../../../.templates/test-assets/_style.scss';

0 commit comments

Comments
 (0)