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

feat: migrate to nx workspace #1483

Draft
wants to merge 21 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: update docs
JosefBredereck committed Feb 11, 2023
commit 9309f76bd57a44bcc0362ac1bb5b39afb4e09a4b
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
# npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -134,6 +134,7 @@
"husky": "^8.0.2",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"json-to-scss": "1.6.2",
"lit-element": "^2.2.1",
"lit-html": "^1.1.2",
"make-dir-cli": "^2.0.0",
3 changes: 2 additions & 1 deletion packages/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@ npm-debug.*
.DS_Store
.sass-cache
node_modules
dist
dist
output

# Specifics

7 changes: 0 additions & 7 deletions packages/docs/.prettierrc

This file was deleted.

16 changes: 16 additions & 0 deletions packages/docs/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable */
module.exports = {
displayName: 'docs',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/docs',
};
54 changes: 27 additions & 27 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "@pattern-lab/website",
"version": "6.0.0",
"description": "The website for patternlab.io",
"scripts": {
"sass:tokens": "npx json-to-scss src/_data/tokens.json src/scss/_tokens.scss",
"sass:process": "yarn sass:tokens && sass src/scss/style.scss dist/css/style.css --style=compressed",
"cms:precompile": "make-dir dist/admin && nunjucks-precompile src/_includes > dist/admin/templates.js -i \"\\.(njk|css|svg)$\"",
"cms:bundle": "rollup --config",
"start": "concurrently \"yarn sass:process --watch\" \"yarn cms:bundle --watch\" \"chokidar \\\"src/_includes/**\\\" -c \\\"yarn cms:precompile\\\"\" \"yarn serve\"",
"serve": "cross-env ELEVENTY_ENV=development npx eleventy --serve",
"production": "yarn sass:process && yarn cms:precompile && yarn cms:bundle && npx eleventy"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bradfrost/pl-website-eleventy.git"
},
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/bradfrost/pl-website-eleventy/issues"
},
"homepage": "https://github.com/bradfrost/pl-website-eleventy/#readme",
"engines": {
"node": ">=14.21.1"
},
"gitHead": "80f62be442223e09bafb30d0529cbd768e03f2ac"
"name": "@pattern-lab/website",
"version": "6.0.0",
"description": "The website for patternlab.io",
"scripts": {
"sass:tokens": "json-to-scss src/_data/tokens.json src/scss/_tokens.scss",
"sass:process": "yarn sass:tokens && sass src/scss/style.scss dist/css/style.css --style=compressed",
"cms:precompile": "make-dir dist/admin && nunjucks-precompile src/_includes > dist/admin/templates.js -i \"\\.(njk|css|svg)$\"",
"cms:bundle": "rollup --config",
"start": "concurrently \"yarn sass:process --watch\" \"yarn cms:bundle --watch\" \"chokidar \\\"src/_includes/**\\\" -c \\\"yarn cms:precompile\\\"\" \"yarn serve\"",
"serve": "cross-env ELEVENTY_ENV=development eleventy --serve",
"production": "yarn sass:process && yarn cms:precompile && yarn cms:bundle && eleventy"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bradfrost/pl-website-eleventy.git"
},
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/bradfrost/pl-website-eleventy/issues"
},
"homepage": "https://github.com/bradfrost/pl-website-eleventy/#readme",
"engines": {
"node": ">=14.21.1"
},
"gitHead": "80f62be442223e09bafb30d0529cbd768e03f2ac"
}
70 changes: 70 additions & 0 deletions packages/docs/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "docs",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/docs/src",
"projectType": "library",
"targets": {
"build-docs": {
"executor": "nx:run-script",
"outputs": ["{projectRoot}/output"],
"options": {
"script": "production"
}
},
"rename-output": {
"executor": "nx:run-commands",
"options": {
"command": "node packages/docs/tools/rename-output.js"
},
"dependsOn": ["build-docs"]
},
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/docs",
"main": "packages/docs/src/index.ts",
"tsConfig": "packages/docs/tsconfig.lib.json",
"assets": [
"packages/docs/*.md",
"packages/docs/LICENSE",
{
"glob": "**/*",
"input": "packages/docs/output",
"output": "dist"
}
]
},
"dependsOn": ["rename-output"]
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/publish.mjs docs {args.ver} {args.tag}"
},
"dependsOn": ["build"]
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/docs/**/*.js"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/docs/jest.config.js",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": []
}
14 changes: 7 additions & 7 deletions packages/docs/rollup.config.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ const nodeResolve = require('rollup-plugin-node-resolve');
const json = require('rollup-plugin-json');

export default {
input: 'src/admin/util',
output: {
file: 'dist/admin/util.js',
format: 'iife',
name: 'previewUtil',
},
plugins: [builtins(), nodeResolve(), commonjs(), json()],
input: 'src/admin/util',
output: {
file: 'dist/admin/util.js',
format: 'iife',
name: 'previewUtil',
},
plugins: [builtins(), nodeResolve(), commonjs(), json()],
};
Empty file added packages/docs/src/index.ts
Empty file.
13 changes: 13 additions & 0 deletions packages/docs/tools/rename-output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const fs = require('fs');
const { resolve } = require('path');

const distPath = resolve(process.cwd(), 'dist');
const outputPath = resolve(process.cwd(), 'output');

if (fs.existsSync(outputPath)) {
fs.rmSync(outputPath, { recursive: true, force: true });
}

if (fs.existsSync(distPath)) {
fs.renameSync(distPath, outputPath);
}
23 changes: 23 additions & 0 deletions packages/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
10 changes: 10 additions & 0 deletions packages/docs/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/index.ts", "src/index.js"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.js", "src/**/*.test.js"]
}
9 changes: 9 additions & 0 deletions packages/docs/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", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
}
62 changes: 61 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
@@ -4531,6 +4531,13 @@ [email protected], cli-cursor@^3.1.0:
dependencies:
restore-cursor "^3.1.0"

cli-cursor@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==
dependencies:
restore-cursor "^2.0.0"

[email protected]:
version "2.6.1"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d"
@@ -9475,6 +9482,19 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==

[email protected]:
version "1.6.2"
resolved "https://registry.yarnpkg.com/json-to-scss/-/json-to-scss-1.6.2.tgz#8efbd21bb3d655e7ef0e3680f04e3c3d883c402a"
integrity sha512-ha9o8xiQVb0f/ErOYmmAtnz2jox0W5qJz8O6mfIM4+kMVikule/wUD0kuQ5B2HKYLqcDtVJqMRxl12tFEWzfkw==
dependencies:
chalk "^2.4.2"
glob "^7.1.4"
lodash.isinteger "^4.0.4"
lodash.isplainobject "^4.0.6"
node-emoji "^1.10.0"
terminal-overwrite "^2.0.1"
yargs "^13.3.2"

json5@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
@@ -9975,6 +9995,11 @@ lodash.isfunction@^3.0.9:
resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051"
integrity sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==

lodash.isinteger@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343"
integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==

lodash.ismatch@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37"
@@ -10438,6 +10463,11 @@ [email protected], mime@^1.4.1, mime@^1.6.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==

mimic-fn@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==

mimic-fn@^2.0.0, mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
@@ -10724,6 +10754,13 @@ node-addon-api@^3.2.1:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161"
integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==

node-emoji@^1.10.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==
dependencies:
lodash "^4.17.21"

[email protected], node-fetch@^2.6.7:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
@@ -11026,6 +11063,13 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0:
dependencies:
wrappy "1"

onetime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==
dependencies:
mimic-fn "^1.0.0"

onetime@^5.1.0, onetime@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
@@ -12994,6 +13038,14 @@ responselike@^1.0.2:
dependencies:
lowercase-keys "^1.0.0"

restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==
dependencies:
onetime "^2.0.0"
signal-exit "^3.0.2"

restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
@@ -14363,6 +14415,14 @@ terminal-link@^2.0.0, terminal-link@^2.1.1:
ansi-escapes "^4.2.1"
supports-hyperlinks "^2.0.0"

terminal-overwrite@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/terminal-overwrite/-/terminal-overwrite-2.0.1.tgz#c732aefeba38900667bf088b4f1b12edbee62841"
integrity sha512-CP8KtcHQjSlKtaXIZTJt4I4II8oEdXyGJtx54gXVVys9plYIaK4ahiXPD6XxZ2efrqayH1B7uR/5Wr7N2cTgFA==
dependencies:
cli-cursor "^2.0.0"
string-width "^2.0.0"

terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.3:
version "5.3.6"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c"
@@ -15743,7 +15803,7 @@ yargs@^12.0.5:
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^11.1.1"

yargs@^13.3.0:
yargs@^13.3.0, yargs@^13.3.2:
version "13.3.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==