Skip to content

Commit

Permalink
chore: repository clean (#1722)
Browse files Browse the repository at this point in the history
* chore: Removes lerna & formats pkg.jsons for consistency

* refactor: Rename prerender-data-provider 'src' -> 'lib'

* chore: Update CLI author in package.jsons

Co-authored-by: Leah <github.leah@hrmny.sh>

* chore: Renaming source code dir in cli & prerender-data-provider

Co-authored-by: Leah <github.leah@hrmny.sh>
  • Loading branch information
rschristian and ForsakenHarmony committed Nov 18, 2022
1 parent 396aec8 commit d9b442f
Show file tree
Hide file tree
Showing 46 changed files with 215 additions and 2,163 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export default () => {
A template is used to render your page by [EJS](https://ejs.co/).
You can uses the data of `prerenderUrls` which does not have `title`, using `htmlWebpackPlugin.options.CLI_DATA.preRenderData` in EJS.

The default one is visible [here](packages/cli/lib/resources/template.html) and it's going to be enough for the majority of cases.
The default one is visible [here](packages/cli/src/resources/template.html) and it's going to be enough for the majority of cases.

If you want to customise your template you can pass a custom template with the `--template` flag.

Expand Down Expand Up @@ -420,7 +420,7 @@ Automatic code splitting is applied to all JavaScript and TypeScript files in th
[prpl]: https://developers.google.com/web/fundamentals/performance/prpl-pattern
[`@babel/preset-env`]: https://babeljs.io/docs/en/babel-preset-env.html
[proof]: https://googlechrome.github.io/lighthouse/viewer/?gist=142af6838482417af741d966e7804346
[preact cli preset]: https://github.com/preactjs/preact-cli/blob/master/packages/cli/lib/lib/babel-config.js
[preact cli preset]: https://github.com/preactjs/preact-cli/blob/master/packages/cli/src/lib/babel-config.js
[service workers]: https://developers.google.com/web/fundamentals/getting-started/primers/service-workers
[customize babel]: https://github.com/preactjs/preact-cli/wiki/Config-Recipes#customising-babel-options-using-loader-helpers
[`async!`]: https://github.com/preactjs/preact-cli/blob/1.4.1/examples/full/src/components/app.js#L7
Expand Down
7 changes: 0 additions & 7 deletions lerna.json

This file was deleted.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
],
"scripts": {
"pretest": "yarn lint",
"test": "lerna run test --stream",
"test": "run-p test:*",
"test:cli": "yarn workspace preact-cli test",
"prettier": "prettier --write **/*.{js,ts,tsx,json,css,scss,md,yml}",
"lint": "eslint .",
"changeset": "changeset",
"release": "ncp README.md packages/cli/README.md && changeset publish && rimraf packages/cli/README.md",
"prepare": "husky install"
},
"dependencies": {},
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write"
],
"*.{ts,tsx,json,css,scss,md,yml}": [
"prettier --write"
]
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.0",
"@changesets/cli": "^2.16.0",
Expand All @@ -23,19 +32,10 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"husky": "^6.0.0",
"lerna": "^4.0.0",
"lint-staged": "^11.0.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"rimraf": "^3.0.2"
},
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write"
],
"*.{ts,tsx,json,css,scss,md,yml}": [
"prettier --write"
]
}
}
20 changes: 10 additions & 10 deletions packages/async-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"name": "@preact/async-loader",
"version": "3.0.1",
"description": "Preact's async component loader for Webpack",
"files": [
"*.js"
],
"homepage": "https://github.com/preactjs/preact-cli",
"bugs": "https://github.com/preactjs/preact-cli/issues",
"repository": {
"type": "git",
"url": "https://github.com/preactjs/preact-cli.git",
"directory":"packages/async-loader"
"directory": "packages/async-loader"
},
"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
"license": "MIT",
"bugs": "https://github.com/preactjs/preact-cli/issues",
"homepage": "https://github.com/preactjs/preact-cli",
"engines": {
"node": ">=8"
},
"author": "The Preact CLI Authors (https://github.com/preactjs/preact-cli/contributors)",
"files": [
"*.js"
],
"dependencies": {
"kleur": "^4.1.4",
"loader-utils": "^2.0.0"
},
"peerDependencies": {
"preact": ">= 10.0.0"
},
"engines": {
"node": ">=8"
}
}
2 changes: 1 addition & 1 deletion packages/cli/babel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var defaultBrowserListDev = [
];

// preact-cli babel configs
var babelConfigs = require('../lib/lib/babel-config');
var babelConfigs = require('../src/lib/babel-config');

/**
* preset as a function means allow users to override some options
Expand Down
119 changes: 61 additions & 58 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,36 @@
"name": "preact-cli",
"version": "3.4.1",
"description": "Start building a Preact Progressive Web App in seconds.",
"repository": "preactjs/preact-cli",
"main": "lib/index.js",
"bin": {
"preact": "lib/index.js"
},
"types": "types.d.ts",
"scripts": {
"pretest": "rimraf ./tests/output",
"test": "jest"
},
"engines": {
"node": ">=12"
},
"files": [
"sw",
"lib",
"babel",
"types.d.ts"
],
"keywords": [
"preact",
"cli",
"pwa",
"project",
"generator"
],
"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
"license": "MIT",
"bugs": "https://github.com/preactjs/preact-cli/issues",
"homepage": "https://github.com/preactjs/preact-cli",
"devDependencies": {
"@types/express": "^4.17.13",
"@types/jest": "^24.9.1",
"html-looks-like": "^1.0.2",
"jest": "^24.9.0",
"less": "^4.1.1",
"less-loader": "^7.3.0",
"ncp": "^2.0.0",
"p-retry": "^4.5.0",
"polka": "^0.5.2",
"preact": "^10.5.13",
"preact-render-to-string": "^5.1.19",
"preact-router": "^3.0.1",
"puppeteer": "^9.1.1",
"sass": "^1.34.0",
"sass-loader": "^10.2.0",
"shelljs": "^0.8.3",
"sirv": "^1.0.11",
"stylus": "^0.54.8",
"stylus-loader": "^4.3.3"
"bugs": "https://github.com/preactjs/preact-cli/issues",
"repository": {
"type": "git",
"url": "https://github.com/preactjs/preact-cli.git",
"directory": "packages/cli"
},
"peerDependencies": {
"less-loader": "^7.3.0",
"preact": "*",
"preact-render-to-string": "*",
"sass-loader": "^10.2.0",
"stylus-loader": "^4.3.3"
"license": "MIT",
"author": "The Preact CLI Authors (https://github.com/preactjs/preact-cli/contributors)",
"main": "src/index.js",
"types": "types.d.ts",
"bin": {
"preact": "src/index.js"
},
"peerDependenciesMeta": {
"less-loader": {
"optional": true
},
"sass-loader": {
"optional": true
},
"stylus-loader": {
"optional": true
}
"files": [
"sw",
"src",
"babel",
"types.d.ts"
],
"scripts": {
"pretest": "rimraf ./tests/output",
"test": "jest"
},
"dependencies": {
"@babel/core": "^7.13.16",
Expand Down Expand Up @@ -151,5 +113,46 @@
"workbox-routing": "^6.5.3",
"workbox-strategies": "^6.5.3",
"workbox-webpack-plugin": "^6.5.3"
},
"devDependencies": {
"@types/express": "^4.17.13",
"@types/jest": "^24.9.1",
"html-looks-like": "^1.0.2",
"jest": "^24.9.0",
"less": "^4.1.1",
"less-loader": "^7.3.0",
"p-retry": "^4.5.0",
"polka": "^0.5.2",
"preact": "^10.5.13",
"preact-render-to-string": "^5.1.19",
"preact-router": "^3.0.1",
"puppeteer": "^9.1.1",
"sass": "^1.34.0",
"sass-loader": "^10.2.0",
"shelljs": "^0.8.3",
"sirv": "^1.0.11",
"stylus": "^0.54.8",
"stylus-loader": "^4.3.3"
},
"peerDependencies": {
"less-loader": "^7.3.0",
"preact": "*",
"preact-render-to-string": "*",
"sass-loader": "^10.2.0",
"stylus-loader": "^4.3.3"
},
"peerDependenciesMeta": {
"less-loader": {
"optional": true
},
"sass-loader": {
"optional": true
},
"stylus-loader": {
"optional": true
}
},
"engines": {
"node": ">=12"
}
}
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.
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
Expand Up @@ -346,7 +346,7 @@ module.exports = function createBaseConfig(env) {
assetHookStage: webpack.Compiler.PROCESS_ASSETS_STAGE_ANALYSE,
// TODO: Remove this next breaking change and use the full filepath from this manifest
// when referring to built assets, i.e.:
// https://github.com/preactjs/preact-cli/blob/master/packages/cli/lib/resources/head-end.ejs#L1
// https://github.com/preactjs/preact-cli/blob/master/packages/cli/src/resources/head-end.ejs#L1
// This is just to avoid any potentially breaking changes for right now.
publicPath: '',
}),
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.
8 changes: 4 additions & 4 deletions packages/cli/tests/images/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const common = {
'polyfills.70f66.js': 6426,
'polyfills.70f66.js.map': 21668,
'polyfills.1ea90.js': 6426,
'polyfills.1ea90.js.map': 21668,
};

exports.default = Object.assign({}, common, {
Expand All @@ -17,8 +17,8 @@ exports.default = Object.assign({}, common, {
'ssr-build/ssr-bundle.js.map': 32557,
'ssr-build/asset-manifest.json': 178,
'bundle.259c5.css': 901,
'bundle.fbf55.js': 21429,
'bundle.fbf55.js.map': 111801,
'bundle.fcca3.js': 21429,
'bundle.fcca3.js.map': 111801,
'favicon.ico': 15086,
'index.html': 2034,
'manifest.json': 455,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/lib/cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { join } = require('path');
const { mkdir, symlink } = require('fs').promises;
const cmd = require('../../lib/commands');
const cmd = require('../../src/commands');
const { tmpDir } = require('./output');
const shell = require('shelljs');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { readFile, writeFile } = require('fs').promises;
const { resolve } = require('path');
const startChrome = require('./lib/chrome');
const { create, watch } = require('./lib/cli');
const { determinePort } = require('../lib/commands/watch');
const { determinePort } = require('../src/commands/watch');
const { subject } = require('./lib/output');
const { getServer } = require('./server');

Expand Down
23 changes: 9 additions & 14 deletions packages/prerender-data-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
{
"name": "@preact/prerender-data-provider",
"version": "3.0.1",
"description": "Prerender Prerender data provider for preact-cli apps",
"description": "Prerender data provider for preact-cli apps",
"keywords": [
"preact",
"preact-cli"
],
"author": "Preact Authors <core@preactjs.com>",
"homepage": "https://github.com/developit/preact-cli#readme",
"homepage": "https://github.com/preactjs/preact-cli",
"bugs": "https://github.com/preactjs/preact-cli/issues",
"repository": {
"type": "git",
"url": "https://github.com/preactjs/preact-cli.git",
"directory": "packages/prerender-data-provider"
},
"license": "MIT",
"author": "The Preact CLI Authors (https://github.com/preactjs/preact-cli/contributors)",
"main": "src/index.js",
"directories": {
"lib": "src",
"test": "__tests__"
},
"files": [
"src"
],
"repository": {
"type": "git",
"url": "git+https://github.com/developit/preact-cli.git"
},
"bugs": {
"url": "https://github.com/developit/preact-cli/issues"
},
"peerDependencies": {
"preact": "^10.0.0"
}
Expand Down

0 comments on commit d9b442f

Please sign in to comment.