lassjs / lass Goto Github PK
View Code? Open in Web Editor NEW:girl: Lass scaffolds a modern package boilerplate for Node.js
Home Page: https://lass.js.org
License: MIT License
:girl: Lass scaffolds a modern package boilerplate for Node.js
Home Page: https://lass.js.org
License: MIT License
Hi, I have an error after trying to create a project with lass new-package
:
Error: Cannot read config file: /Users/vedmant/Projects/_My/test/new-package/node_modules/eslint-config-prettier/standard.js
Error: "prettier/standard" has been merged into "prettier" in eslint-config-prettier 8.0.0. See: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
Referenced from: BaseConfig
at Object.<anonymous> (/Users/vedmant/Projects/_My/test/new-package/node_modules/eslint-config-prettier/standard.js:1:7)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at module.exports (/Users/vedmant/Projects/_My/test/new-package/node_modules/import-fresh/index.js:32:59)
at loadJSConfigFile (/Users/vedmant/Projects/_My/test/new-package/node_modules/@eslint/eslintrc/lib/config-array-factory.js:225:16)
at loadConfigFile (/Users/vedmant/Projects/_My/test/new-package/node_modules/@eslint/eslintrc/lib/config-array-factory.js:309:20)
at ConfigArrayFactory._loadConfigData (/Users/vedmant/Projects/_My/test/new-package/node_modules/@eslint/eslintrc/lib/config-array-factory.js:609:42)
(node:6492) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1: ./node_modules/.bin/xo --fix
at makeError (/Users/vedmant/.config/yarn/global/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/vedmant/.config/yarn/global/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async post (/Users/vedmant/.config/yarn/global/node_modules/lass/sao.js:222:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Macos: 11.4 (20F71)
node -v
v14.16.0
yarn -v
1.22.4
This might be useful, it allows to use lass
with the defaults for all answers, just like npm init -y
Add an initial git commit to the project with a commit message like Initial commit from Lass
I think it allows more flexibility for a dev to want to change or squash their initial commit/changes without having to go through a bunch of steps. Plus it brands Lass a little more. I think it's still pretty clean in git history.
Thoughts?
Link: https://lass.js.org/#/ >>> https://lass.js.org/
Directly builds on top of work that will need to be first completed per #40 first
parse-err
(if and only if this option was true)eslint dist
as well https://github.com/niftylettuce/parse-err/blob/master/package.json#L135 (if and only if this option was true)parse-err
it would have the package name - if and only if this option was true). for parseRequest
camelcased you can use https://github.com/sindresorhus/camelcase.browserlistrc
file (using filters to selectively filter this if and only if this option was true) https://github.com/niftylettuce/parse-err/blob/master/.browserslistrc.babelrc
target for browsers as well (see https://github.com/niftylettuce/parse-err/blob/master/.babelrc#L6).eslintrc
file https://github.com/niftylettuce/parse-err/blob/master/.eslintrcSince the string passed to lass starts with @
it should prompt to use @ladjs/email
as the package name not just the directory name.
➜ code lass @ladjs/email
> Generating package in /Users/xo/code/@ladjs/email
? What is the name of the new package (email)
if the user selects yes for this option in the CLI, then the following needs to happen:
.babelrc
file needs created similar to https://github.com/niftylettuce/parse-err/blob/master/.babelrc (omit the "browsers" target for now) - (if and only if this option was true - you can use filters concept in sao to whitelist this file https://sao.js.org/#/create?id=filters if babel option was true).babelrc
is v8.x+ LTSlib/index.js
(if and only if this option was true)Currently if you want to do an initial commit without 100% coverage husky will throw an error.
If we could pass --no-verify
somehow it'd allow a first commit without the need to write every test right at the start.
@niftylettuce I really like your tool because it exposed me to new packages!
That said, I feel that it goes against one of the core principles of build processes. If a developer commits 4000 times in a year, every second spent waiting for the commit to go thru equates to a wasted hour. If committing runs a slew of different processes and takes 20 seconds, I might have spent 20+ hours by the end of the year waiting for my code to commit. On team and company scales, that's a lot of wasted time & resources.
The nice thing about working in interpreted languages like JS is that you can avoid compilation and building. Linting is really fast, and it's widely accepted. And adding a hook for unit testing makes a lot of sense, because your IDE is going to miss certain types of errors in your code, and committing broken code is expensive.
In practice, I've found that using lass has generated pedantic errors and warnings during committing - XO and the default settings are very strict, perfectly valid JS is treated as an error. And when things do work, loading up the various steps of the githook process takes 6+ seconds for a simple project, and much longer for project with 50,000 LOC.
Just wanted to share my thoughts! I think there are benefits to doing things the way you're doing them, but I'm not sure I can rely on a tool like lass.
Hey,
loving lass, so I'm adding a few suggestions here, hopefully following up with PRs later :)
So, my github name is mixed case and when lass lowercases it, the link to travis will be broken because they treat their URLs case sensitive.
Minor issue.
(node:3252) UnhandledPromiseRejectionWarning: Error: Line: 4 Column: 60 - Unexpected identifier
at Object.exports.parse (/Users/user/Projects/lass/node_modules/alce/lib/alce.js:20:11)
at module.exports (/Users/user/Projects/lass/node_modules/fixpack/fixpack.js:49:19)
at post (/Users/user/Projects/lass/sao.js:195:5)
at kopy.then.stream (/Users/user/Projects/lass/node_modules/sao/lib/generate.js:226:40)
@3imed-jaberi hey, there is a core bug here with your changes to xo:
❯ yarn test
yarn run v1.22.4
$ yarn run lint
$ yarn run lint:js && yarn run lint:md
$ xo --extend xo-lass --prettier --space
test/test.js:6:1
✖ 6:1 Replace ↹ with ·· prettier/prettier
✖ 7:1 Replace ↹Object.assign(t.context,·{script with ··Object.assign(t.context,·{·script· prettier/prettier
✖ 11:1 Replace ↹ with ·· prettier/prettier
✖ 15:1 Replace ↹ with ·· prettier/prettier
✖ 16:1 Replace ↹ with ·· prettier/prettier
✖ 20:1 Replace ↹const·{script with ··const·{·script· prettier/prettier
✖ 21:1 Replace ↹ with ·· prettier/prettier
✖ 25:1 Replace ↹const·{script with ··const·{·script· prettier/prettier
✖ 26:1 Replace ↹ with ·· prettier/prettier
index.js:2:1
✖ 2:1 Replace ↹ with ·· prettier/prettier
✖ 3:1 Replace ↹↹config·=·{...config with ····config·=·{·...config· prettier/prettier
✖ 4:1 Replace ↹↹ with ···· prettier/prettier
✖ 6:1 Replace ↹↹ with ···· prettier/prettier
✖ 7:1 Replace ↹ with ·· prettier/prettier
✖ 9:1 Replace ↹ with ·· prettier/prettier
✖ 10:1 Replace ↹↹ with ···· prettier/prettier
✖ 11:1 Replace ↹ with ·· prettier/prettier
17 errors
remark -qfo
not terminated after run git commit
. I think it should be fixed with change
"*.md": ["remark -qfo", "git add"]
to "*.md": ["remark . -qfo", "git add"]
in lint-staged
eslint is bundled with xo - version mismatch causes errors.
The one thing I need in my code is no semicolons (don’t judge! :-))
So right now the first thing I do after lass
is to "fix" package.json
accordingly.
I would like to have personal settings that lass uses. Could be environment variables or a config file in ~
.
I guess that's somehow related to #12
@OmgImAlexis open to your thoughts - shouldn't we have this set to false
by default? it's very hard to achieve 100% in projects without wasting time
Such as husky or something like that?
With scoped packages the user is most likely wanting to push to an org so we should offer to attribute the license, readme, etc. to the org by default.
Right now the second biggest package in node_modules is lodash
, used by npm-name
for a feature we don’t even use.
I made a clone of this module without that feature. Using this one would improve npm i -g lass
install time.
Thinks for this nice scaffolds!
But seems it's only ava right now. How about an option for something like mocha, jest, e.t.c ? :)
npm WARN deprecated [email protected]: Please upgrade to v0.0.9+, see https://github.com/remarkjs/remark/issues/359 for more information
Currently we can't make scoped packages. This should allow using @USERNAME/PACKAGE_NAME
.
➜ code lass @lad/mongoose
> Generating package in /Users/xo/code/@lad/mongoose
? What is the name of the new package (mongoose)
>> Please change the name from "@lad/mongoose" to "lad-mongoose"
Hey, great package!
lass new-package
doesn't work when using the latest version 1.0.13, when installed on node 10.x and npm 5.6.0 and osx highsierra 10.13.6. I also tried node 8.x to no avail.
Downgrading to 1.0.11 fixed the issue.
Currently package manager choice is yarn
or npm5
I'm getting the following error creating a new package:
test/test.js:1:14
✖ 1:14 Do not use "require". unicorn/prefer-module
✖ 3:16 Do not use "require". unicorn/prefer-module
index.js:14:1
✖ 14:1 Do not use "module". unicorn/prefer-module
3 errors
(node:86940) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1: ./node_modules/.bin/xo --fix
at makeError (/Users/sebas/.npm-global/lib/node_modules/lass/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/sebas/.npm-global/lib/node_modules/lass/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async post (/Users/sebas/.npm-global/lib/node_modules/lass/sao.js:222:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:86940) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:86940) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Can you get me a hint on how to fix it?
Settings: version 1.0.11, node 10.x and 8.x, npm 5.6.0:
When selecting GPL-3.0 as the license during the 'lass new-package' process, I got this error:
Initialized empty Git repository in /Users/hoopda/Documents/TerraClear/new-package/.git/ TypeError: console.log.error is not a function at post (/usr/local/lib/node_modules/lass/sao.js:168:21) at kopy.then.stream (/usr/local/lib/node_modules/lass/node_modules/sao/lib/generate.js:226:40) at <anonymous>
Switching to MIT fixed the issue.
thx to suggestion by @shaunwarman
On a brand new project (e.g. npx lass my-new-project
) I get the following error when running npm run lint
:
test/test.js:3:35
✖ 3:35 Test files should not be imported. ava/no-import-test-files
Is there a way I can fix this?
For example in the readme we get this after using Lad's logger
for the description.
> Lad&[#39](https://github.com/omgimalexis/lad-logger/issues/39);s logger
Per https://docs.npmjs.com/private-modules/intro#publishing-your-package:
By default, scoped packages are published as private. You can read more about this in the scopes documentation.
Since not everyone will want 100% coverage to be required maybe we can add an option to allow the user to select a prefered percentage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.