Skip to content

Commit

Permalink
refactor: move files to a near standalone setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip9587 committed Oct 9, 2023
1 parent 9c6de1f commit 5258257
Show file tree
Hide file tree
Showing 56 changed files with 96 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ jobs:
- name: Publish to NPM
if: env.IS_BETA_RELEASE == 'false'
run: |
cd dist/packages/nx-stylelint/
cd dist/nx-stylelint/
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Beta to NPM
if: env.IS_BETA_RELEASE == 'true'
run: |
cd dist/packages/nx-stylelint/
cd dist/nx-stylelint/
npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .versionrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"type": "json"
},
{
"filename": "packages/nx-stylelint/package.json",
"filename": "nx-stylelint/package.json",
"type": "json"
}
]
Expand Down
18 changes: 18 additions & 0 deletions e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
6 changes: 3 additions & 3 deletions e2e/nx-stylelint-e2e/jest.config.ts → e2e/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
displayName: 'nx-stylelint-e2e',
preset: '../../jest.preset.js',
displayName: 'e2e',
preset: '../jest.preset.js',
globals: {},
transform: {
'^.+\\.[tj]s$': [
Expand All @@ -14,7 +14,7 @@ const config: Config.InitialOptions = {
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/e2e/nx-stylelint-e2e',
coverageDirectory: '../coverage/e2e',
testEnvironment: 'node',
};

Expand Down
17 changes: 0 additions & 17 deletions e2e/nx-stylelint-e2e/project.json

This file was deleted.

9 changes: 0 additions & 9 deletions e2e/nx-stylelint-e2e/tsconfig.spec.json

This file was deleted.

31 changes: 31 additions & 0 deletions e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "e2e",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "e2e/tests",
"targets": {
"e2e": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "e2e/jest.config.ts",
"runInBand": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
},
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/**/*.ts"]
}
}
},
"implicitDependencies": ["nx-stylelint"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { checkFilesExist, ensureNxProject, readJson, runNxCommandAsync, cleanup,
import { NxJsonConfiguration, ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
import type { Config } from 'stylelint';

describe('nx-stylelint-e2e', () => {
describe('nx-stylelint E2E tests', () => {
beforeAll(() => {
cleanup();
});

beforeEach(() => {
ensureNxProject('nx-stylelint', 'dist/packages/nx-stylelint');
ensureNxProject('nx-stylelint', 'dist/nx-stylelint');
});

describe('nx-stylelint:init', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-stylelint-e2e/tsconfig.json → e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.base.json",
"files": [],
"include": [],
"references": [
Expand Down
9 changes: 9 additions & 0 deletions e2e/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": ["jest.config.ts", "tests/**/*.test.ts", "tests/**/*.spec.ts", "tests/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc.json"],
"extends": ["../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand All @@ -13,7 +13,9 @@
"@nx/nx-plugin-checks": "error",
"@nx/dependency-checks": [
"error",
{ "ignoredDependencies": ["stylelint-config-standard", "stylelint-config-standard-scss"] }
{
"ignoredDependencies": ["stylelint-config-standard", "stylelint-config-standard-scss"]
}
]
}
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
displayName: 'nx-stylelint',
preset: '../../jest.preset.js',
preset: '../jest.preset.js',
globals: {},
transform: {
'^.+\\.[tj]s$': [
Expand All @@ -14,7 +14,7 @@ const config: Config.InitialOptions = {
],
},
moduleFileExtensions: ['ts', 'js'],
coverageDirectory: '../../coverage/packages/nx-stylelint',
coverageDirectory: '../coverage/nx-stylelint',
testEnvironment: 'node',
};

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"engines": {
"node": "^18.13.0 || >=20.0.0"
},
"main": "src/index.js",
"main": "./src/index.js",
"typings": "./src/index.d.ts",
"schematics": "./generators.json",
"builders": "./executors.json",
"dependencies": {
Expand Down
34 changes: 17 additions & 17 deletions packages/nx-stylelint/project.json → nx-stylelint/project.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
{
"name": "nx-stylelint",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/nx-stylelint/src",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "nx-stylelint/src",
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"packages/nx-stylelint/**/*.ts",
"packages/nx-stylelint/generators.json",
"packages/nx-stylelint/executors.json",
"packages/nx-stylelint/package.json",
"packages/nx-stylelint/migrations.json"
"nx-stylelint/**/*.ts",
"nx-stylelint/generators.json",
"nx-stylelint/executors.json",
"nx-stylelint/package.json",
"nx-stylelint/migrations.json"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/nx-stylelint"],
"outputs": ["{workspaceRoot}/coverage/nx-stylelint"],
"options": {
"jestConfig": "packages/nx-stylelint/jest.config.ts",
"jestConfig": "nx-stylelint/jest.config.ts",
"passWithNoTests": true
}
},
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/nx-stylelint",
"outputPath": "dist/nx-stylelint",
"deleteOutputPath": true,
"tsConfig": "packages/nx-stylelint/tsconfig.lib.json",
"packageJson": "packages/nx-stylelint/package.json",
"main": "packages/nx-stylelint/src/index.ts",
"tsConfig": "nx-stylelint/tsconfig.lib.json",
"packageJson": "nx-stylelint/package.json",
"main": "nx-stylelint/src/index.ts",
"assets": [
"README.md",
"LICENSE",
{
"input": "./packages/nx-stylelint/src",
"input": "./nx-stylelint/src",
"glob": "**/schema.{json,d.ts}",
"output": "./src"
},
{
"input": "./packages/nx-stylelint",
"input": "./nx-stylelint",
"glob": "generators.json",
"output": "."
},
{
"input": "./packages/nx-stylelint",
"input": "./nx-stylelint",
"glob": "executors.json",
"output": "."
},
{
"input": "./packages/nx-stylelint",
"input": "./nx-stylelint",
"glob": "migrations.json",
"output": "."
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.base.json",
"files": [],
"include": [],
"references": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/out-tsc",
"outDir": "../dist/out-tsc",
"declaration": true,
"types": ["node"],
"removeComments": true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"outDir": "../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
Expand Down
5 changes: 0 additions & 5 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "nx-stylelint",
"affected": {
"defaultBase": "main"
},
Expand All @@ -15,10 +14,6 @@
}
}
},
"workspaceLayout": {
"appsDir": "e2e",
"libsDir": "packages"
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
"nx-stylelint": ["packages/nx-stylelint/src/index.ts"]
"nx-stylelint": ["nx-stylelint/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
Expand Down

0 comments on commit 5258257

Please sign in to comment.