Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade glob to latest, verify windows #1070

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smooth-bulldogs-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'style-dictionary': patch
---

Fix Windows support by using a Linux/Windows + Node/Browser compatible path utility. Upgrade to latest Glob version. Apply posix: true to prevent breaking change glob update.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
# use lts, bump this if new major becomes lts
node-version: 20.x
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ on: pull_request
jobs:
verify:
name: Verify changes
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# latest node & minimum node according to pkg.json engines
node-version: [18.0, 21.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install Dependencies
run: npm ci
Expand Down
7 changes: 4 additions & 3 deletions __integration__/android.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -54,7 +55,7 @@ describe('integration', () => {
await sd.buildAllPlatforms();

describe(`android/resources`, () => {
const output = fs.readFileSync(`${buildPath}resources.xml`, {
const output = fs.readFileSync(resolve(`${buildPath}resources.xml`), {
encoding: 'UTF-8',
});

Expand All @@ -63,7 +64,7 @@ describe('integration', () => {
});

describe(`with references`, () => {
const output = fs.readFileSync(`${buildPath}resourcesWithReferences.xml`, {
const output = fs.readFileSync(resolve(`${buildPath}resourcesWithReferences.xml`), {
encoding: 'UTF-8',
});

Expand All @@ -73,7 +74,7 @@ describe('integration', () => {
});

describe(`with filter`, () => {
const output = fs.readFileSync(`${buildPath}colors.xml`, {
const output = fs.readFileSync(resolve(`${buildPath}colors.xml`), {
encoding: 'UTF-8',
});

Expand Down
5 changes: 3 additions & 2 deletions __integration__/compose.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -51,7 +52,7 @@ describe('integration', () => {
await sd.buildAllPlatforms();

describe(`compose/object`, () => {
const output = fs.readFileSync(`${buildPath}StyleDictionary.kt`, {
const output = fs.readFileSync(resolve(`${buildPath}StyleDictionary.kt`), {
encoding: `UTF-8`,
});

Expand All @@ -60,7 +61,7 @@ describe('integration', () => {
});

describe(`with references`, () => {
const output = fs.readFileSync(`${buildPath}StyleDictionaryWithReferences.kt`, {
const output = fs.readFileSync(resolve(`${buildPath}StyleDictionaryWithReferences.kt`), {
encoding: `UTF-8`,
});

Expand Down
7 changes: 4 additions & 3 deletions __integration__/css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -65,15 +66,15 @@ describe('integration', () => {
await sd.buildAllPlatforms();

describe('css/variables', () => {
const output = fs.readFileSync(`${buildPath}variables.css`, {
const output = fs.readFileSync(resolve(`${buildPath}variables.css`), {
encoding: 'UTF-8',
});
it(`should match snapshot`, async () => {
await expect(output).to.matchSnapshot();
});

describe(`with references`, () => {
const output = fs.readFileSync(`${buildPath}variablesWithReferences.css`, {
const output = fs.readFileSync(resolve(`${buildPath}variablesWithReferences.css`), {
encoding: 'UTF-8',
});
it(`should match snapshot`, async () => {
Expand All @@ -82,7 +83,7 @@ describe('integration', () => {
});

describe(`with selector`, () => {
const output = fs.readFileSync(`${buildPath}variablesWithSelector.css`, {
const output = fs.readFileSync(resolve(`${buildPath}variablesWithSelector.css`), {
encoding: 'UTF-8',
});
it(`should match snapshot`, async () => {
Expand Down
13 changes: 7 additions & 6 deletions __integration__/customFileHeader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -109,21 +110,21 @@ describe(`integration`, () => {

describe('file options', () => {
it(`registered file header should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}registeredFileHeader.css`, {
const output = fs.readFileSync(resolve(`${buildPath}registeredFileHeader.css`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
});

it(`config file header should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}configFileHeader.css`, {
const output = fs.readFileSync(resolve(`${buildPath}configFileHeader.css`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
});

it(`inline file header should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}inlineFileHeader.css`, {
const output = fs.readFileSync(resolve(`${buildPath}inlineFileHeader.css`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
Expand All @@ -132,21 +133,21 @@ describe(`integration`, () => {

describe('platform options', () => {
it(`no file options should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}noOptions.js`, {
const output = fs.readFileSync(resolve(`${buildPath}noOptions.js`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
});

it(`showFileHeader should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}showFileHeader.js`, {
const output = fs.readFileSync(resolve(`${buildPath}showFileHeader.js`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
});

it(`file header override should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}fileHeaderOverride.js`, {
const output = fs.readFileSync(resolve(`${buildPath}fileHeaderOverride.js`), {
encoding: 'UTF-8',
});
await expect(output).to.matchSnapshot();
Expand Down
5 changes: 3 additions & 2 deletions __integration__/customFormats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -89,7 +90,7 @@ describe('integration', () => {
await sd.buildAllPlatforms();

describe(`inline custom with new args`, async () => {
const output = fs.readFileSync(`${buildPath}inlineCustomFormatWithNewArgs.json`, {
const output = fs.readFileSync(resolve(`${buildPath}inlineCustomFormatWithNewArgs.json`), {
encoding: 'UTF-8',
});
it(`should match snapshot`, async () => {
Expand All @@ -107,7 +108,7 @@ describe('integration', () => {
});

describe(`register custom format with new args`, () => {
const output = fs.readFileSync(`${buildPath}registerCustomFormatWithNewArgs.json`, {
const output = fs.readFileSync(resolve(`${buildPath}registerCustomFormatWithNewArgs.json`), {
encoding: 'UTF-8',
});

Expand Down
14 changes: 9 additions & 5 deletions __integration__/flutter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -77,7 +78,7 @@ describe('integration', () => {
await sd.buildAllPlatforms();

describe(`flutter/class.dart`, () => {
const output = fs.readFileSync(`${buildPath}style_dictionary.dart`, {
const output = fs.readFileSync(resolve(`${buildPath}style_dictionary.dart`), {
encoding: `UTF-8`,
});

Expand All @@ -86,17 +87,20 @@ describe('integration', () => {
});

describe(`with references`, () => {
const output = fs.readFileSync(`${buildPath}style_dictionary_with_references.dart`, {
encoding: `UTF-8`,
});
const output = fs.readFileSync(
resolve(`${buildPath}style_dictionary_with_references.dart`),
{
encoding: `UTF-8`,
},
);

it(`should match snapshot`, async () => {
await expect(output).to.matchSnapshot();
});
});

describe(`separate`, () => {
const output = fs.readFileSync(`${buildPath}style_dictionary_color.dart`, {
const output = fs.readFileSync(resolve(`${buildPath}style_dictionary_color.dart`), {
encoding: `UTF-8`,
});
it(`should match snapshot`, async () => {
Expand Down
15 changes: 8 additions & 7 deletions __integration__/iOSObjectiveC.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';

Expand Down Expand Up @@ -78,49 +79,49 @@ describe('integration', () => {
await sd.buildAllPlatforms();

it(`ios/singleton.m should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}singleton.m`, {
const output = fs.readFileSync(resolve(`${buildPath}singleton.m`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/singleton.h should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}singleton.h`, {
const output = fs.readFileSync(resolve(`${buildPath}singleton.h`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/color.m should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}color.m`, {
const output = fs.readFileSync(resolve(`${buildPath}color.m`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/color.h should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}color.h`, {
const output = fs.readFileSync(resolve(`${buildPath}color.h`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/macros.h should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}macros.h`, {
const output = fs.readFileSync(resolve(`${buildPath}macros.h`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/static.h should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}static.h`, {
const output = fs.readFileSync(resolve(`${buildPath}static.h`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
});

it(`ios/static.m should match snapshot`, async () => {
const output = fs.readFileSync(`${buildPath}static.m`, {
const output = fs.readFileSync(resolve(`${buildPath}static.m`), {
encoding: `UTF-8`,
});
await expect(output).to.matchSnapshot();
Expand Down
Loading