@penskemediacorp/larva 0.3.12-develop.8 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/fixtures/src/patterns/components/c-tagline/c-tagline.prototype.js +3 -0
- package/__tests__/lib/utils/clonePatternData.test.js +23 -0
- package/__tests__/lib/utils/getAllPatternsObj.test.js +5 -2
- package/__tests__/lib/utils/getPatternRoutes.test.js +1 -0
- package/__tests__/lib/utils/getSubDirectoryNames.test.js +1 -1
- package/build/css/larva-important.css +1 -1
- package/build/css/larva.css +1 -1
- package/build/css/larva.inline-important.css +1 -1
- package/build/css/larva.inline.css +1 -1
- package/build/svg/defs/sprite.defs.html +1 -1
- package/build/tokens/rollingstone.custom-properties.css +146 -12
- package/build/tokens/rollingstone.json +147 -13
- package/build/tokens/rollingstone.map.scss +146 -12
- package/build/tokens/rollingstone.raw.json +1189 -89
- package/index.js +2 -1
- package/package.json +12 -12
- package/scripts/init.js +4 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require( 'path' );
|
|
2
|
+
const clonePatternData = require( '../../../lib/utils/clonePatternData' );
|
|
3
|
+
const getConfig = require( '../../../lib/utils/getAppConfiguration' );
|
|
4
|
+
const { projectPatternsDir, larvaPatternsDir } = getConfig( 'patterns' );
|
|
5
|
+
|
|
6
|
+
describe( 'clonePatternData', () => {
|
|
7
|
+
|
|
8
|
+
it( 'gets object from project patterns dir first', () => {
|
|
9
|
+
|
|
10
|
+
const expected = require( path.join( projectPatternsDir, '/components/c-tagline/c-tagline.prototype' ) );
|
|
11
|
+
const c_tagline = clonePatternData( 'components/c-tagline/c-tagline.prototype');
|
|
12
|
+
|
|
13
|
+
expect( c_tagline ).toStrictEqual( expected );
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it( 'falls back to object from larva patterns dir', () => {
|
|
17
|
+
const expected = require( path.join( larvaPatternsDir, '/components/c-button/c-button.prototype' ) );
|
|
18
|
+
const c_button = clonePatternData( 'components/c-button/c-button.prototype');
|
|
19
|
+
|
|
20
|
+
expect( c_button ).toStrictEqual( expected );
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
});
|
|
@@ -9,6 +9,9 @@ const expectedPatterns = {
|
|
|
9
9
|
'featured.aia',
|
|
10
10
|
'featured',
|
|
11
11
|
'prototype'
|
|
12
|
+
],
|
|
13
|
+
'c-tagline': [
|
|
14
|
+
'prototype'
|
|
12
15
|
]
|
|
13
16
|
},
|
|
14
17
|
'modules': {
|
|
@@ -33,9 +36,9 @@ describe( 'getAllPatternsObj', () => {
|
|
|
33
36
|
|
|
34
37
|
it( 'returns an object containing all patterns and variants', () => {
|
|
35
38
|
|
|
36
|
-
expect(
|
|
39
|
+
expect(
|
|
37
40
|
getAllPatternsObj( config.projectPatternsDir )
|
|
38
|
-
).toEqual(
|
|
41
|
+
).toEqual(
|
|
39
42
|
expectedPatterns
|
|
40
43
|
);
|
|
41
44
|
});
|
|
@@ -2,7 +2,7 @@ const assert = require( 'assert' );
|
|
|
2
2
|
const getPatternsList = require( '../../../lib/utils/getSubDirectoryNames' );
|
|
3
3
|
const appConfiguration = require( '../../../lib/utils/getAppConfiguration' )('patterns');
|
|
4
4
|
const expectedObjectsList = [ 'o-crap', 'o-nav' ];
|
|
5
|
-
const expectedComponentsList = [ 'c-nav-link' ];
|
|
5
|
+
const expectedComponentsList = [ 'c-nav-link', 'c-tagline' ];
|
|
6
6
|
|
|
7
7
|
console.log( appConfiguration.projectPatternsDir );
|
|
8
8
|
|