@unsass/breakpoint 1.0.0 → 2.0.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [2.0.0](https://github.com/unsass/breakpoint/compare/v1.0.0...v2.0.0) (2022-06-10)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * move main files on `src` folder
11
+
12
+ ### Code Refactoring
13
+
14
+ * move main files on `src` folder ([3307439](https://github.com/unsass/breakpoint/commit/3307439cb7fb7b6d4a67b32eabcbff19c604ccb6))
15
+
5
16
  ## 1.0.0 (2022-02-28)
6
17
 
7
18
 
package/README.md CHANGED
@@ -2,12 +2,16 @@
2
2
 
3
3
  [![Version](https://flat.badgen.net/npm/v/@unsass/breakpoint)](https://www.npmjs.com/package/@unsass/breakpoint)
4
4
  [![Downloads](https://flat.badgen.net/npm/dt/@unsass/breakpoint)](https://www.npmjs.com/package/@unsass/breakpoint)
5
- [![License](https://flat.badgen.net/github/license/@unsass/breakpoint)](https://flat.badgen.net/github/license/@unsass/breakpoint)
5
+ [![License](https://flat.badgen.net/npm/license/@unsass/breakpoint)](https://www.npmjs.com/package/@unsass/breakpoint)
6
6
 
7
7
  ## Introduction
8
8
 
9
9
  Easily manage your CSS breakpoint rules.
10
10
 
11
+ > **Note:** this is new code moved
12
+ > from [`@sass-collective/breakpoint`](https://github.com/sass-collective/sass-collective/tree/master/packages/breakpoint)
13
+ > repository.
14
+
11
15
  ## Installing
12
16
 
13
17
  ```shell
@@ -82,6 +86,8 @@ with mixins.
82
86
  #### Declare config with `breakpoint.config()`
83
87
 
84
88
  ```scss
89
+ @use "@unsass/breakpoint";
90
+
85
91
  // Extend the default list...
86
92
  @include breakpoint.config((
87
93
  "3xl": 1980px
package/index.scss CHANGED
@@ -1,7 +1,7 @@
1
1
  // ============================================================================================= //
2
- // INDEX //
2
+ // BREAKPOINT //
3
3
  // ============================================================================================= //
4
4
 
5
- @forward "./variables";
6
- @forward "./mixins";
7
- @forward "./functions" hide get-next, set-min, set-max;
5
+ @forward "./src/variables";
6
+ @forward "./src/mixins";
7
+ @forward "./src/functions" hide get-next, set-min, set-max;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsass/breakpoint",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Easily manage your CSS breakpoint rules.",
5
5
  "scripts": {
6
6
  "lint:css": "stylelint --fix \"**/*.scss\"",
@@ -13,30 +13,32 @@
13
13
  "node": ">=14.0.0",
14
14
  "npm": ">=8.0.0"
15
15
  },
16
+ "sass": "index.scss",
16
17
  "devDependencies": {
17
- "@commitlint/cli": "^16.2.1",
18
- "@commitlint/config-conventional": "^16.2.1",
18
+ "@commitlint/cli": "^17.0.2",
19
+ "@commitlint/config-conventional": "^17.0.2",
19
20
  "@semantic-release/changelog": "^6.0.1",
20
21
  "@semantic-release/git": "^10.0.1",
21
- "@types/node": "^17.0.21",
22
+ "@types/node": "^17.0.41",
22
23
  "glob": "^7.2.0",
23
- "husky": "^7.0.4",
24
- "jest": "^27.5.1",
24
+ "husky": "^8.0.1",
25
+ "jest": "^28.1.1",
25
26
  "npm-run-all": "^4.1.5",
26
- "sass-true": "^6.1.0-beta.1",
27
- "semantic-release": "^19.0.2",
28
- "stylelint": "^14.5.3",
27
+ "sass-true": "^6.1.0",
28
+ "semantic-release": "^19.0.3",
29
+ "stylelint": "^14.9.0",
29
30
  "stylelint-config-unsass": "^1.0.0"
30
31
  },
31
32
  "dependencies": {
32
33
  "@sass-collective/strip-unit": "^3.1.2",
33
- "sass": "^1.49.9"
34
+ "sass": "^1.52.3"
34
35
  },
35
36
  "keywords": [
36
37
  "breakpoint",
37
38
  "unsass",
38
39
  "sass",
39
- "css"
40
+ "css",
41
+ "front-end"
40
42
  ],
41
43
  "license": "MIT",
42
44
  "homepage": "https://github.com/unsass/breakpoint#readme",
@@ -47,6 +49,11 @@
47
49
  "type": "git",
48
50
  "url": "git+https://github.com/unsass/breakpoint.git"
49
51
  },
52
+ "files": [
53
+ "src/**/*",
54
+ "*.scss",
55
+ "CHANGELOG.md"
56
+ ],
50
57
  "publishConfig": {
51
58
  "access": "public"
52
59
  }
File without changes
File without changes
File without changes
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- insert_final_newline = true
7
- indent_style = space
8
- indent_size = 4
9
- trim_trailing_whitespace = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
13
-
14
- [*.yml]
15
- indent_size = 2
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- * text=auto
@@ -1,10 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "npm"
4
- directory: "/"
5
- schedule:
6
- interval: "weekly"
7
- assignees:
8
- - "borisdamevin"
9
- reviewers:
10
- - "borisdamevin"
@@ -1,50 +0,0 @@
1
- name: Node.js CI
2
-
3
- on:
4
- push:
5
- branches: [ main, develop ]
6
- pull_request:
7
- branches: [ main, develop ]
8
-
9
- jobs:
10
- test:
11
- runs-on: ubuntu-latest
12
-
13
- strategy:
14
- matrix:
15
- node-version: [ 14.x, 16.x ]
16
-
17
- steps:
18
- - uses: actions/checkout@v2
19
-
20
- - name: Use Node.js ${{ matrix.node-version }}
21
- uses: actions/setup-node@v2
22
- with:
23
- node-version: ${{ matrix.node-version }}
24
- cache: 'npm'
25
-
26
- - name: Install Dependencies
27
- run: npm ci --ignore-scripts
28
-
29
- - name: Test
30
- run: npm run test
31
-
32
- publish:
33
- runs-on: ubuntu-latest
34
- needs: test
35
- if: ${{ github.ref == 'refs/heads/main' }}
36
-
37
- steps:
38
- - uses: actions/checkout@v2
39
- - uses: actions/setup-node@v2
40
- with:
41
- node-version: ${{ matrix.node-version }}
42
-
43
- - name: Install Dependencies
44
- run: npm ci --ignore-scripts
45
-
46
- - name: Release
47
- run: npm run release
48
- env:
49
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx --no-install commitlint --edit
package/.releaserc.json DELETED
@@ -1,76 +0,0 @@
1
- {
2
- "branches": [
3
- "main",
4
- {
5
- "name": "beta",
6
- "prerelease": true
7
- },
8
- {
9
- "name": "alpha",
10
- "prerelease": true
11
- }
12
- ],
13
- "plugins": [
14
- "@semantic-release/commit-analyzer",
15
- [
16
- "@semantic-release/changelog",
17
- {
18
- "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines."
19
- }
20
- ],
21
- "@semantic-release/npm",
22
- [
23
- "@semantic-release/release-notes-generator",
24
- {
25
- "preset": "conventionalcommits",
26
- "presetConfig": {
27
- "types": [
28
- {
29
- "type": "feat",
30
- "section": "Features"
31
- },
32
- {
33
- "type": "fix",
34
- "section": "Bug Fixes"
35
- },
36
- {
37
- "type": "chore",
38
- "hidden": true
39
- },
40
- {
41
- "type": "build",
42
- "section": "Build System"
43
- },
44
- {
45
- "type": "docs",
46
- "hidden": true
47
- },
48
- {
49
- "type": "style",
50
- "hidden": true
51
- },
52
- {
53
- "type": "refactor",
54
- "section": "Code Refactoring"
55
- },
56
- {
57
- "type": "perf",
58
- "hidden": true
59
- },
60
- {
61
- "type": "test",
62
- "hidden": true
63
- }
64
- ]
65
- }
66
- }
67
- ],
68
- [
69
- "@semantic-release/git",
70
- {
71
- "message": "chore(release): publish version ${nextRelease.version}"
72
- }
73
- ],
74
- "@semantic-release/github"
75
- ]
76
- }
package/.stylelintignore DELETED
@@ -1,5 +0,0 @@
1
- ## Files
2
- *.spec.scss
3
-
4
- ## Folders
5
- /tests
package/.stylelintrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": [
3
- "stylelint-config-unsass"
4
- ],
5
- "rules": {
6
- "function-no-unknown": null
7
- }
8
- }
@@ -1,9 +0,0 @@
1
- // ============================================================================================= //
2
- // COMMITLINT //
3
- // ============================================================================================= //
4
-
5
- module.exports = {
6
- extends: [
7
- '@commitlint/config-conventional'
8
- ]
9
- };
@@ -1,24 +0,0 @@
1
- // ============================================================================================= //
2
- // TEST //
3
- // ============================================================================================= //
4
-
5
- @use "true" as *;
6
- @use "../index" as breakpoint;
7
-
8
- @include describe("breakpoint.get-value()") {
9
- @include it("Should return value from token.") {
10
- @include assert {
11
- @include output(false) {
12
- .foo {
13
- width: breakpoint.get-value(lg);
14
- }
15
- }
16
-
17
- @include expect(false) {
18
- .foo {
19
- width: 960px;
20
- }
21
- }
22
- }
23
- }
24
- }
@@ -1,144 +0,0 @@
1
- // ============================================================================================= //
2
- // TEST //
3
- // ============================================================================================= //
4
-
5
- @use "true" as *;
6
- @use "../index" as breakpoint;
7
-
8
- @include describe("breakpoint.up()") {
9
- @include it("Should return breakpoint 'up' rules.") {
10
- @include assert {
11
- @include output(false) {
12
- .foo {
13
- @include breakpoint.up(lg) {
14
- color: darkcyan;
15
- }
16
- }
17
- }
18
-
19
- @include expect(false) {
20
- @media (min-width: 960px) {
21
- .foo {
22
- color: darkcyan;
23
- }
24
- }
25
- }
26
- }
27
- }
28
- }
29
-
30
- @include describe("breakpoint.down()") {
31
- @include it("Should return breakpoint 'down' rules.") {
32
- @include assert {
33
- @include output(false) {
34
- .foo {
35
- @include breakpoint.down(lg) {
36
- color: darkcyan;
37
- }
38
- }
39
- }
40
-
41
- @include expect(false) {
42
- @media (max-width: 959px) {
43
- .foo {
44
- color: darkcyan;
45
- }
46
- }
47
- }
48
- }
49
- }
50
- }
51
-
52
- @include describe("breakpoint.only()") {
53
- @include it("Should return breakpoint 'only' rules.") {
54
- @include assert {
55
- @include output(false) {
56
- .foo {
57
- @include breakpoint.only(lg) {
58
- color: darkcyan;
59
- }
60
- }
61
- }
62
-
63
- @include expect(false) {
64
- @media (min-width: 960px) and (max-width: 1199px) {
65
- .foo {
66
- color: darkcyan;
67
- }
68
- }
69
- }
70
- }
71
- }
72
- }
73
-
74
- @include describe("breakpoint.between()") {
75
- @include it("Should return breakpoint 'between' rules.") {
76
- @include assert {
77
- @include output(false) {
78
- .foo {
79
- @include breakpoint.between(md, xl) {
80
- color: darkcyan;
81
- }
82
- }
83
- }
84
-
85
- @include expect(false) {
86
- @media (min-width: 768px) and (max-width: 1199px) {
87
- .foo {
88
- color: darkcyan;
89
- }
90
- }
91
- }
92
- }
93
- }
94
- }
95
-
96
- @include describe("breakpoint.config()") {
97
- @include it("Should return breakpoint 'config' rules.") {
98
- @include assert {
99
- @include output(false) {
100
- @include breakpoint.config((
101
- "3xl": 1980px
102
- ));
103
-
104
- .foo {
105
- @include breakpoint.up("3xl") {
106
- color: darkcyan;
107
- }
108
- }
109
- }
110
-
111
- @include expect(false) {
112
- @media (min-width: 1980px) {
113
- .foo {
114
- color: darkcyan;
115
- }
116
- }
117
- }
118
- }
119
- }
120
-
121
- @include it("Should return breakpoint 'config' rules with '$reset' option.") {
122
- @include assert {
123
- @include output(false) {
124
- @include breakpoint.config((
125
- "tablet": 768px
126
- ), true);
127
-
128
- .foo {
129
- @include breakpoint.up("tablet") {
130
- color: darkcyan;
131
- }
132
- }
133
- }
134
-
135
- @include expect(false) {
136
- @media (min-width: 768px) {
137
- .foo {
138
- color: darkcyan;
139
- }
140
- }
141
- }
142
- }
143
- }
144
- }
@@ -1,44 +0,0 @@
1
- // ============================================================================================= //
2
- // TESTS //
3
- // ============================================================================================= //
4
-
5
- const path = require('path');
6
- const sassTrue = require('sass-true');
7
- const glob = require('glob');
8
-
9
- /**
10
- *
11
- * @param url
12
- * @param prev
13
- * @param done
14
- * @returns {{file: string}}
15
- */
16
- function importer(url, prev, done) {
17
- if (url[0] === '~') {
18
- url = path.resolve('node_modules', url.substr(1));
19
- }
20
-
21
- return {
22
- file: url
23
- };
24
- }
25
-
26
- describe('Sass', () => {
27
- // Find all the Sass files that end in `*.spec.scss` in any directory of this project.
28
- // I use path.resolve because True requires absolute paths to compile test files.
29
- const sassTestFiles = glob.sync(path.resolve(process.cwd(), '**/*.spec.scss'));
30
-
31
- // Run True on every file found with to describe and its methods provided
32
- sassTestFiles.forEach((file) =>
33
- sassTrue.runSass({
34
- importer,
35
- file,
36
- includePaths: [
37
- './node_modules'
38
- ]
39
- }, {
40
- describe,
41
- it
42
- })
43
- );
44
- });