Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 89d9831

Browse files
authored
chore(infrastructure): Move src to packages/ folder (#1145)
### What it does - Moves source files from `src/lib` to `packages/` - This will make the directories easier to navigate
1 parent 92140cd commit 89d9831

379 files changed

Lines changed: 118 additions & 89 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
demos/* linguist-documentation
22
/package-lock.json linguist-generated
3-
src/theme/material-components-web/* linguist-documentation
3+
packages/material-components-web/scss/* linguist-documentation

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/node_modules/
22
/dist/
33
/npm-debug.log
4-
/build/
54
/coverage
65
*.log

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ npm-debug.log
44
/typings
55
/publish
66
/dist
7-
/src
7+
/packages
8+
/demos
89

910
#ignore files added by travis ci script
1011
google-chrome-stable_current*

.stylelint-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ extends: stylelint-config-standard
22
ignoreFiles:
33
- node_modules/**/*
44
- dist/**/*
5-
- build/**/*
65
- demos/**/*
7-
- src/theme/material-components-web/**/*
6+
- packages/material-components-web/scss/**/*
87
plugins:
98
- stylelint-selector-bem-pattern
109
- stylelint-scss

build-config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
*/
55
const { join } = require('path');
66

7-
const package = require('./package.json');
7+
const packageJson = require('./package.json');
88

99
/** Current version of the project*/
10-
const buildVersion = package.version;
10+
const buildVersion = packageJson.version;
1111

12-
/** Required Angular version for the project. */
13-
const angularVersion = package.dependencies['@angular/core'];
12+
/**
13+
* Required Angular version for all Angular Material packages. This version will be used
14+
* as the peer dependency version for Angular in all release packages.
15+
*/
16+
const angularVersion = '>=6.0.0-beta.0 <7.0.0';
1417

1518
/** License that will be placed inside of all created bundles. */
1619
const buildLicense = `/**
@@ -25,7 +28,7 @@ module.exports = {
2528
projectVersion: buildVersion,
2629
angularVersion: angularVersion,
2730
projectDir: __dirname,
28-
packagesDir: join(__dirname, 'src'),
31+
packagesDir: join(__dirname, 'packages'),
2932
outputDir: join(__dirname, 'dist'),
3033
licenseBanner: buildLicense
3134
};

demos/components/ripple-demo/ripple-demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>Ripple</h1>
44
Ripple provides components (or any element) with a material "ink ripple" interaction effect.
55
<h2>References</h2>
66
<ul>
7-
<li><a mdc-button href="https://material.io/guidelines/motion/choreography.html#choreography-radial-reaction"
7+
<li><a mdc-button href="https://material.io/design/interaction/states.html"
88
target="_blank" rel="noopener noreferrer">Material Design guidelines: Ripple</a>
99
</li>
1010
<li><a mdc-button href="https://github.com/material-components/material-components-web/blob/master/packages/mdc-ripple/README.md"
@@ -26,7 +26,7 @@ <h3>mdc-ripple</h3>
2626
</thead>
2727
<tbody>
2828
<tr>
29-
<td>ripple: <a href="https://github.com/trimox/angular-mdc-web/blob/master/src/lib/ripple/ripple.service.ts"
29+
<td>ripple: <a href="https://github.com/trimox/angular-mdc-web/blob/master/packages/ripple/ripple.service.ts"
3030
target="_blank" rel="noopener noreferrer">MdcRipple</a></td>
3131
<td>Use ripple methods.</td>
3232
</tr>

demos/tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"rootDir": "..",
1313
"baseUrl": ".",
1414
"paths": {
15-
"@angular-mdc/web/*": ["../src/lib/*"],
16-
"@angular-mdc/web": ["../src/lib/public-api.ts"],
17-
"@angular-mdc/theme/*": ["../src/theme/*"],
18-
"@angular-mdc/theme": ["../src/theme/material.scss"]
15+
"@angular-mdc/web/*": ["../packages/*"],
16+
"@angular-mdc/web": ["../packages/public-api.ts"],
17+
"@angular-mdc/theme/*": ["../packages/material-components-web/*"],
18+
"@angular-mdc/theme": ["../packages/material-components-web/material.scss"]
1919
}
2020
},
2121
"files": [

demos/webpack.config.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
44

55
module.exports = {
66
mode: 'development',
7-
devtool: 'source-map',
7+
devtool: 'eval-source-map',
88
context: path.resolve(__dirname, './'),
99
entry: {
1010
'polyfills': './polyfills.ts',
1111
'app': './main.ts'
1212
},
13+
devServer: {
14+
contentBase: './demos',
15+
port: 4000,
16+
inline: true
17+
},
18+
plugins: [
19+
// Workaround for angular/angular#1158
20+
new webpack.ContextReplacementPlugin(
21+
/(.+)?angular(\\|\/)core(.+)?/,
22+
path.resolve(__dirname, "./demos")
23+
)
24+
],
1325
resolve: {
1426
extensions: ['.ts', '.js'],
1527
alias: {
16-
'@angular-mdc/web': path.resolve(__dirname, '../src/lib')
28+
'@angular-mdc/web': path.resolve(__dirname, '../packages')
1729
},
1830
plugins: [
1931
new TsconfigPathsPlugin({
@@ -57,10 +69,5 @@ module.exports = {
5769
loader: 'html-loader'
5870
},
5971
]
60-
},
61-
devServer: {
62-
contentBase: './demos',
63-
port: 4000,
64-
inline: true
6572
}
6673
}

package-lock.json

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-mdc",
3-
"description": "Angular Material Design Components",
3+
"description": "Material Web Components for Angular",
44
"homepage": "https://github.com/trimox/angular-mdc-web",
55
"bugs": "https://github.com/trimox/angular-mdc-web/issues",
66
"repository": {
@@ -12,14 +12,13 @@
1212
"node": ">= 9.11.1"
1313
},
1414
"scripts": {
15-
"build": "gulp web:build",
1615
"build:release": "gulp web:build && gulp web:build-release",
17-
"migrate-mdc-sass": "rimraf src/theme/material-components-web && node scripts/migrate-mdc-scss.js",
16+
"migrate-mdc-sass": "rimraf packages/material-components-web/scss && node scripts/migrate-mdc-scss.js",
1817
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
1918
"lint": "npm run lint:ts && npm run lint:css",
20-
"lint:ts": "tslint 'src/lib/**/*.ts'",
21-
"lint:css": "stylelint src/**/*.scss --config .stylelint-config.yaml",
22-
"fix:css": "stylelint --fix src/**/*.scss --config .stylelint-config.yaml",
19+
"lint:ts": "tslint 'packages/**/*.ts'",
20+
"lint:css": "stylelint packages/material-components-web/**/*.scss --config .stylelint-config.yaml",
21+
"fix:css": "stylelint --fix packages/material-components-web/**/*.scss --config .stylelint-config.yaml",
2322
"test": "npm run test:unit",
2423
"test:unit": "karma start --single-run",
2524
"test:watch": "karma start --auto-watch",

0 commit comments

Comments
 (0)